pixel-virtual-tree 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ object-assign
|
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/function Y5(){return W5||(W5=1,e=G5,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var i=r-1>>>1,o=e[i];if(!(a(o,t)>0))return;e[i]=t,e[r]=o,r=i}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,c=e[l],s=l+1,u=e[s];if(a(c,t)<0)s<i&&a(u,c)<0?(e[r]=u,e[s]=t,r=s):(e[r]=c,e[l]=t,r=l);else{if(!(s<i&&a(u,t)<0))return;e[r]=u,e[s]=t,r=s}}}(e,n,0)),t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],s=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,v="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(s);null!==a;){if(null===a.callback)r(s);else{if(!(a.startTime<=e))return;r(s),a.sortIndex=a.expirationTime,t(c,a)}a=n(s)}}function b(e){if(m=!1,_(e),!p)if(null!==n(c))p=!0,N(w);else{var t=n(s);null!==t&&j(b,t.startTime-e)}}function w(t,a){p=!1,m&&(m=!1,T()),h=!0;var i=f;try{return function(t,a){var i=a;for(_(i),d=n(c);null!==d&&(!(d.expirationTime>i)||t&&!M());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var l=o(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(c)&&r(c),_(i)}else r(c);d=n(c)}if(null!==d)return!0;var u=n(s);return null!==u&&j(b,u.startTime-i),!1}(t,a)}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,A=null,x=-1,C=5,k=-1;function M(){return!(e.unstable_now()-k<C)}var z,S=function(){if(null!==A){var t=e.unstable_now();k=t;var n=!0;try{n=A(!0,t)}finally{n?z():(E=!1,A=null)}}else E=!1};if("function"==typeof y)z=function(){y(S)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,I=O.port2;O.port1.onmessage=S,z=function(){I.postMessage(null)}}else z=function(){v(S,0)};function N(e){A=e,E||(E=!0,z())}function j(t,n){x=v(function(){t(e.unstable_now())},n)}function T(){g(x),x=-1}var D=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,N(w))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=D,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,a,i){var o,l,d=e.unstable_now();if("object"==typeof i&&null!==i){var f=i.delay;o="number"==typeof f&&f>0?d+f:d}else o=d;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var v=o+l,g={id:u++,callback:a,priorityLevel:r,startTime:o,expirationTime:v,sortIndex:-1};return o>d?(g.sortIndex=o,t(s,g),null===n(c)&&g===n(s)&&(m?T():m=!0,j(b,o-d))):(g.sortIndex=v,t(c,g),p||h||(p=!0,N(w))),g},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),G5;var e}var K5=(Q5||(Q5=1,"production"===process.env.NODE_ENV?U5.exports=(F5||(F5=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,c=e[l],s=l+1,u=e[s];if(0>a(c,n))s<i&&0>a(u,c)?(e[r]=u,e[s]=n,r=s):(e[r]=c,e[l]=n,r=l);else{if(!(s<i&&0>a(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],s=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,v="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(s);null!==a;){if(null===a.callback)r(s);else{if(!(a.startTime<=e))break;r(s),a.sortIndex=a.expirationTime,t(c,a)}a=n(s)}}function b(e){if(m=!1,_(e),!p)if(null!==n(c))p=!0,N(w);else{var t=n(s);null!==t&&j(b,t.startTime-e)}}function w(t,a){p=!1,m&&(m=!1,g(C),C=-1),h=!0;var i=f;try{for(_(a),d=n(c);null!==d&&(!(d.expirationTime>a)||t&&!z());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var l=o(d.expirationTime<=a);a=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(c)&&r(c),_(a)}else r(c);d=n(c)}if(null!==d)var u=!0;else{var v=n(s);null!==v&&j(b,v.startTime-a),u=!1}return u}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,A=!1,x=null,C=-1,k=5,M=-1;function z(){return!(e.unstable_now()-M<k)}function S(){if(null!==x){var t=e.unstable_now();M=t;var n=!0;try{n=x(!0,t)}finally{n?E():(A=!1,x=null)}}else A=!1}if("function"==typeof y)E=function(){y(S)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,I=O.port2;O.port1.onmessage=S,E=function(){I.postMessage(null)}}else E=function(){v(S,0)};function N(e){x=e,A||(A=!0,E())}function j(t,n){C=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,N(w))},e.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"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,a,i){var o=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?o+i:o,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:u++,callback:a,priorityLevel:r,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>o?(r.sortIndex=i,t(s,r),null===n(c)&&r===n(s)&&(m?(g(C),C=-1):m=!0,j(b,i-o))):(r.sortIndex=l,t(c,r),p||h||(p=!0,N(w))),r},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(V5)),V5):U5.exports=Y5()),U5.exports);const Z5=Symbol(),X5=Symbol(),J5="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:d,$5=K5.unstable_runWithPriority?e=>{try{K5.unstable_runWithPriority(K5.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function e6(e,t){const n=u(e)[Z5];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:a},l:i}=n,o=t(r),[l,c]=_((e,n)=>{if(!n)return[r,o];if("p"in n)throw n.p;if(n.n===a)return Object.is(e[1],o)?e:[r,o];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,o]);return Object.is(l[1],o)||c(),J5(()=>(i.add(c),()=>{i.delete(c)}),[i]),l[1]}const t6=function(e){const t=c({[Z5]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[X5]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=o(e),a=o(0),[i,l]=s(null);i&&(i(e),l(null));const c=o();if(!c.current){const e=new Set,t=(t,n)=>{a.current+=1;const r={n:a.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};c.current={[Z5]:{v:r,n:a,l:e,u:t}}}return J5(()=>{r.current=e,a.current+=1,$5(()=>{c.current[Z5].l.forEach(t=>{t({n:a.current,v:e})})})},[e]),m(n,{value:c.current},t)}),delete t.Consumer,t}([B5,()=>{}]),n6=({children:t,useTableRef:n,totalWidth:r})=>{const a=o(null);return l(()=>{n&&a.current&&n(a)},[n]),e("table",{className:"ff-spreadsheet-table",ref:a,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},r6=t=>e("tr",{...t}),a6=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function i6(){return e6(t6,([,e])=>e)}function o6(e){return e6(t6,([t])=>e(t))}const l6=({selected:t,onSelect:n})=>{const a=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:a,tabIndex:0,children:e("div",{className:T("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(lF,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},c6=t=>function(n){const a=i6(),i=r.useCallback(()=>a({type:$2}),[a]),o=o6(e=>e.selected instanceof D4);return e(t,{...n,selected:o,onSelect:i})},s6=t=>function(n){const a=i6(),i=r.useCallback((e,t)=>a(function(e,t){return{type:J2,payload:{column:e,extend:t}}}(e,t)),[a]),o=o6(e=>e.selected.hasEntireColumn(n.column)),l=o6(e=>e.selectedColumn??void 0),c=o6(e=>e.active?g4(e.active,e.model.data):void 0);return e(t,{...n,cell:c,selected:o,selectedColumn:l,onSelect:i,scrollToColumn:n.scrollToColumn})},u6=s6(({column:t,label:a,selected:i,onSelect:o,setContextMenu:l,deleteColumn:c,addColumnLeft:s,addColumnRight:u,columnContextEnable:d,cell:f,selectedColumn:p,minimumColumnWidth:m,maxColLimit:v,disableDeleteOption:g,contextMenu:y,onAddColumn:_,onDeleteColumn:b,setVisibleRange:w,scrollToColumn:E})=>{const A=i6(),x=o6(e=>e.model.data),C=o6(e=>e.active),k=m,M=o6(e=>e.columnDimensions[t]?.width||k),z=o6(e=>e.model.data),{columnCount:S}=u5(z),O=r.useRef(x),I=r.useCallback(()=>{if(C){O.current?.[C.row]?.[C.column]!==o5&&O.current?.[0]?.length===x?.[0]?.length||(O.current=x);const e=O.current?.[C.row]?.[C.column]?.value,t=x?.[C.row]?.[C.column]?.value;return e===t}return!1},[C,x,O,o5]),N=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},j=h(()=>{const e=f?.contextDisable?.["Delete Column"]&&I();return[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{N("increment"),s(k),_?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:S>=v},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{N("increment"),u(k),_?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:S>=v},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{N("decrement"),c(),b?.(p??t)},disableTooltip:"",visible:!!e,disable:!1}]]},[p,f,s,u,c,k,S,v,g,_,b,t,I]),D=r.useCallback((e,n)=>{const r=n?t-1:t,a=Math.max(r,0);o(a,e.shiftKey);const i=e.clientX,l=M,c=e=>{const t=Math.max(k,l+(e.clientX-i));A(B3(a,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),A(h4())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),A(f4())},[t,M]),L=r.useCallback(e=>A(l4(e)),[A]),P=r.useCallback(e=>{o(t,e.shiftKey)},[o,t]),R=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:d,contextType:"column",options:j})},[t,p,d,j]);return r.useEffect(()=>{void 0!==p&&"column"===y?.contextType&&l(e=>({open:e.open,contextType:"column",options:j}))},[t,p,d,j,"column"===y?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":i}),style:{minWidth:`${M}px`},onClick:P,onContextMenu:R,tabIndex:0,children:[e(cF,{fontWeight:"medium",children:a??d6(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>D(e,!1),onDoubleClick:()=>A(B3(t,k)),onClick:()=>L({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>D(e,!0),onDoubleClick:()=>A(B3(t,k)),onClick:()=>L({row:-1,column:t})})]},t)});function d6(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const f6=({row:t,label:a,selected:i,onSelect:o,setContextMenu:l,addRowTop:c,addRowBottom:s,deleteRow:u,rowContextEnable:d,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:m,contextMenu:v,setVisibleRange:g,scrollToRow:y})=>{const _=i6(),b=o6(e=>e.rowDimensions[t]?.height||32),w=o6(e=>e.model.data),{rowCount:E}=u5(w),A=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&y(f),n})},x=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{A("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{A("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...m?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{A("decrement"),u()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),C=r.useCallback((e,n)=>{const r=n?t:t-1,a=Math.max(r,0);o(a,e.shiftKey);const i=e.clientY,l=b,c=e=>{const t=Math.max(32,l+(e.clientY-i));_(H3(a,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),_(h4())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),_(h4())},[b,t]),k=r.useCallback(e=>_(l4(e)),[_]),M=r.useCallback(e=>{o(t,e.shiftKey)},[t]),z=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:d,contextType:"row",options:x})},[t,d,x,f]);return r.useEffect(()=>{void 0!==f&&"row"===v?.contextType&&l(e=>({open:e.open,contextType:"row",options:x}))},[t,d,x,f,"row"===v?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":i}),style:{height:`${b}px`,minWidth:"60px"},onClick:M,onContextMenu:z,tabIndex:0,children:[e(cF,{fontWeight:"medium",children:void 0!==a?a:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>C(e,!0),onDoubleClick:()=>_(H3(t,32)),onClick:()=>k({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>C(e,!1),onDoubleClick:()=>_(H3(t,32)),onClick:()=>k({row:t,column:-1})})]})},h6=t=>function(n){const a=i6(),i=o6(e=>e.selected.hasEntireRow(n.row)),o=o6(e=>e.active?g4(e.active,e.model.data):void 0),l=o6(e=>e.selectedRow??void 0),c=r.useCallback((e,t)=>a(function(e,t){return{type:X2,payload:{row:e,extend:t}}}(e,t)),[a]);return e(t,{...n,selected:i,cell:o,selectedRow:l,onSelect:c,scrollToRow:n.scrollToRow})},p6=({row:t,column:n,DataViewer:a,active:i,dragging:o,mode:l,data:c,evaluatedData:s,select:u,activate:d,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),m=r.useMemo(()=>({row:t,column:n}),[t,n]),v=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(m,W4(e.currentTarget)),e.shiftKey?u(m):d(m))},[l,f,m,u,d]),g=r.useCallback(e=>{o&&(f(m,W4(e.currentTarget)),u(m))},[f,u,o,m]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(m,W4(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,m]),c&&c.DataViewer&&(a=c.DataViewer),e("td",{ref:p,style:{...c?.style,..."dropDown"===c?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===c?.style?.textDecoration?c?.style?.textDecoration:"none"},className:T("ff-spreadsheet-cell",c?.className,{"ff-spreadsheet-active-cell":i||o}),onMouseEnter:g,onMouseDown:v,tabIndex:0,children:e(a,{row:t,column:n,cell:c,active:i,evaluatedCell:s,setCellData:h,inputValue:()=>null})})},m6=t=>function(n){const{row:a,column:i}=n,o=i6(),l=r.useMemo(()=>({row:a,column:i}),[a,i]),c=r.useCallback(e=>o(c4(l,e)),[o,l]),s=r.useCallback(e=>o(function(e){return{type:t3,payload:{point:e}}}(e)),[o]),u=r.useCallback(e=>o(l4(e)),[o]),d=r.useCallback((e,t)=>o(s4(e,t)),[o]),f=o6(e=>V4(e.active,l)),h=o6(e=>f?e.mode:"view"),p=o6(e=>g4(l,e.model.data)),m=o6(e=>g4(l,e.model.evaluatedData)),v=o6(e=>e.dragging),g=o6(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:v,mode:h,evaluatedData:m,data:p,select:s,activate:u,setCellDimensions:d,setCellData:c})},v6=({cell:r,evaluatedCell:a,active:i})=>{const o=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,a);return e("span","boolean"==typeof o?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:g6(o)}:{className:T("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":r5(o)}),children:i||"dropDown"!==r?.inputType?.type?i||"file"!==r?.inputType?.type?!i&&o:e(t,{children:hF(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(lF,{name:"attachment_icon"})," Attachment"]}):(n=>{if(hF(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(CV,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(o)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[o,e(lF,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function g6(e){return e?"TRUE":"FALSE"}const y6=a.forwardRef(({initialValue:t="",onChange:n,className:r="",style:i={}},c)=>{const s=o(null);a.useImperativeHandle(c,()=>s.current),l(()=>{s.current&&t!==s.current.innerText&&(s.current.innerText=t)},[t]);const u=()=>{if(s.current){const e=s.current.innerText;n?.(e)}};return e("div",{style:i,children:e("div",{ref:s,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void u();s.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:u,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const a=document.createTextNode(t);r.insertNode(a),r.setStartAfter(a),r.collapse(!0),n.removeAllRanges(),n.addRange(r),u()},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),_6=({onChange:t,cell:n})=>{const a=r.useRef(null),i=r.useCallback(e=>{t({...n,value:e,style:n?.style,inputType:n?.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{a.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(a.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(y6,{ref:a,initialValue:n?.value??"",onChange:i,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},b6=t=>{const a=r.useRef(null),i=r.useRef(null),o=i6(),l=r.useCallback((e,t)=>o(c4(e,t)),[o]),c=r.useCallback(e=>o(l4(e)),[o]),s=r.useCallback(()=>o({type:c3}),[o]),u=r.useCallback(e=>o({type:T3,payload:{autofill:e}}),[o]),d=r.useCallback(e=>o(function(e){return{type:m3,payload:{changes:e}}}(e)),[o]),f=r.useCallback(()=>{o({type:s3})},[o]),h=o6(e=>e.rowDimensions),p=o6(e=>e.active),m=o6(e=>e.mode),v=o6(e=>e.active?g4(e.active,e.model.data):void 0),g=o6(e=>e.selected),y=o6(e=>g&&$4(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),_=o6(e=>{let t=p?X4(p,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),b=r.useMemo(()=>!p||!_||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,_,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),E=r.useRef(null),A=r.useRef(void 0),x=r.useCallback(e=>{p&&l(p,e)},[l,p]),[C,k]=r.useState({value:"",name:""}),[M,z]=r.useState(!1),[S,O]=r.useState(),[I,N]=r.useState([]);r.useEffect(()=>{v&&p&&t.getActiveCell({value:v.value,active:p});const n=a.current;if(!b&&n){if(n.focus({preventScroll:!0}),"file"===v?.inputType?.type&&v?.value)try{const e=JSON.parse(v.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));N(e)}catch(e){console.error("Error parsing cell value for files:",e),N([])}else N([]);if("dropDown"===v?.inputType?.type){k({value:v?.value,name:v?.value}),z(e=>!e);const t=v?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));O(t)}}},[a,b,p]),r.useEffect(()=>{const e=E.current,t=A.current;if(E.current=p,A.current=v,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==m){const e=w.current;t!==e?d([{prevCell:e||null,nextCell:t}]):n||v===t||d([{prevCell:t,nextCell:v||null}]),w.current=v}});const j=v&&v.DataEditor||t.DataEditor,D=v&&v.readOnly,L=r.useCallback(e=>{p&&(e.preventDefault(),u(!0))},[c,u,p]),P=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),R=y?.height!==_?.height||y?.width!==_?.width,H=r.useCallback(e=>{p&&R&&(s4(p,W4(e.currentTarget)),c(p))},[p,R]),B=t.isAtRight?t.maxWidth-(_?.left-t.scrollPos.left)+100:t.maxWidth,q=t.isAtBottom?t.maxHeight-(_?.top-t.scrollPos.top)+64:t.maxHeight,F=["file","dropDown"].includes(v?.inputType?.type||"");return n("div",{ref:a,className:T("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${m}`,{"ff-spreadsheet-active-cell--hidden":b,"ff-spreadsheet-active-cell--dragging":R&&"text"!==v?.inputType?.type}),onMouseDown:H,style:{..._,backgroundColor:v?.style?.backgroundColor,...F?{display:"flex",alignItems:v?.style?.alignContent,justifyContent:v?.style?.textAlign}:{},..."edit"===m&&p?{minWidth:Math.min(_?.width,t.maxWidth),minHeight:Math.min(_?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${q}px`,overflow:"auto",..."dropDown"===v?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:P,onClick:"view"!==m||D?void 0:s,tabIndex:0,children:[e("div",{className:F?"":"active-cell-main",children:"dropDown"===v?.inputType?.type?e(AW,{...v?.inputType?.inputProps,dropDownRef:i,showOptions:{open:!("edit"!==m||!p),toggle:M},selectedOption:C,optionsList:S||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{k({value:e.value,name:e.label}),x({...v,value:e.value,style:v?.style,inputType:v?.inputType})}}):"file"===v?.inputType?.type?e(q2,{...v?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&v?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(v.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],a=Array.from(r).indexOf(n);if(-1===a||!e[a])return void console.error("File index not found or invalid");const i=e[a];t.attachmentAction.viewAttachment(i.id,i.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:I,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===v?.inputType?.type){let n=[];try{v?.value&&(n=JSON.parse(v.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const a=e.filter((e,t,a)=>{const i=e.name.split("*")[0],o=a.findIndex(e=>e.name.split("*")[0]===i)!==t,l=n.some(e=>e.name.split("*")[0]===i);return!o&&!l||(r++,!1)});if(n.length+a.length>5)return void iY.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&a.length>0)try{let e=0,r=0,i=0;const l=I?.length+a?.length,c=l>0?25*l:1,s=[...n],u=a?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(u)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:a}=t.value;"success"===n&&a?.id&&a?.name?(s.push(a),e++):"existing"===n&&a?.name?s.push(a):"memory_full"===n?i++:r++}else r++}),e>0||s.length>n.length){const e=s.length>0?JSON.stringify(s):"";x({...v,value:e,style:v?.style,inputType:v?.inputType}),o(H3(p?.row||0,Math.max(c,h?.[p.row]?.height||c))),N(s.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}i>0&&iY.info("No memory available to add the file"),e>0&&iY.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&iY.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),iY.error("Operation failed")}}else if("DELETE"===r&&"file"===v?.inputType?.type)try{let e=[...v&&JSON.parse(v.value)],r=0;for(const a of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===a.name.split("*")[0]),i=e[n]?.id;if(-1!==n&&i&&t.attachmentAction?.deleteAttachment)try{const o=await t.attachmentAction.deleteAttachment(i);"SUCCESS"===o||"object"==typeof o&&null!==o&&("status"in o&&"SUCCESS"===o.status||"responseCode"in o&&200===o.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${a.name}: Invalid response`,o)}catch(e){console.error(`Delete error for ${a.name}:`,e),iY.error("Error deleting file")}else console.error(`Cannot delete ${a.name}: Invalid fileId or no match`,{index:n,fileId:i,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),iY.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";x({...v,value:t,style:v?.style,inputType:v?.inputType}),N(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),iY.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";x({...v,value:e,style:v?.style,inputType:v?.inputType}),N(t.map(e=>new File([new Blob],e.name.split("*")[0]))),iY.error("Failed to delete file(s). Invalid file data detected.")}else iY.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),iY.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),iY.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(_?.width??0)-60}):"edit"===m&&p&&t.editable?e(j,{row:p.row,column:p.column,cell:v,onChange:x,exitEditMode:f}):e(y6,{initialValue:v?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...v?.style,textDecoration:"underline"===v?.style?.textDecoration?"underline":"none",backgroundColor:R?"#1e161f00":v?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(v?.inputType?.type??"")&&("edit"===m||p&&e("div",{onMouseDown:L,className:"select_dot"}))]})},w6=({dimensions:t,dragging:n,hidden:r,variant:a})=>{const i=o6(e=>e.active),o=o6(e=>e.autoFill),l=o6(e=>i?X4(i,e.rowDimensions,e.columnDimensions):void 0),{width:c,height:s,top:u,left:d}=t||{};let f=l?.height??0,h=l?.width??0,p=c,m=s;return o.open&&c&&s&&l&&(c-h>s-f?(p=c,m=l.height):(m=s,p=l.width)),e("div",{className:T("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${a}`]:a,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(m??0)+1,top:u,left:d}})},E6=({scrollPos:t={top:0,left:0}})=>{const n=o6(e=>e.selected),a=o6(e=>e.dragging),i=o6(e=>e.selected.size(e.model.data)<2),o=o6(e=>n&&$4(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(o)return{...o,top:o.top,left:o.left,height:o.height-1,width:o.width-1}},[o,t]);return e(w6,{variant:"selected",dimensions:l,dragging:a,hidden:i||!o})},A6=({scrollPos:t={top:0,left:0}})=>{const n=o6(e=>e.copied),a=null===n,i=o6(e=>n&&J4(e.rowDimensions,e.columnDimensions,n)),o=r.useMemo(()=>{if(i)return{...i,top:i.top,left:i.left,height:i.height-1,width:i.width-1}},[i,t]);return e(w6,{variant:"copied",dimensions:o,hidden:a||!i,dragging:!1})},x6=({getColorValue:t,disabled:n,initialColor:r})=>{const a=o(null),[i,l]=s(r);return e("div",{className:T("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:i},onClick:()=>{a.current&&!n&&a.current.click()},children:e("input",{type:"color",disabled:n,className:T("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:a,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},C6=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},k6=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},M6=e=>c5.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function z6(e){const{border:t}=e;let n="",r="",a="",i="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(a="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(i="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:a5(M6(String(e.size))),fontFamily:(o=e.name,l5.some(e=>e.label===o)?o:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:a,borderLeft:i,textAlign:C6(e.alignment.horizontal),alignContent:C6(e.alignment.vertical)};var o}const S6=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},O6=e=>({name:e.fontFamily||"Arial",size:i5(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:S6(e.borderTop?e.borderTop.toString():void 0),right:S6(e.borderRight?e.borderRight.toString():void 0),bottom:S6(e.borderBottom?e.borderBottom.toString():void 0),left:S6(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:k6(e.textAlign),vertical:k6(e.alignContent),wrapText:!1}}),I6=({toolbar:t="show",editable:r,onBold:a,onItalic:i,setUnderlineType:c,setColor:u,setFontSize:d,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:m,setFormatePainter:v})=>{const g=o6(e=>e.selected instanceof D4),[y,_]=s("disable"===t||!r),b=o6(e=>e.active?g4(e.active,e.model.data):null),w=o6(e=>e.model.data),E=o6(e=>e.formattedStyle.open),A={...o5.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[x,C]=s(b?.style||A),k=o(null);l(()=>{b?.style&&JSON.stringify(b.style)!==JSON.stringify(x)&&C(b?.style||A),g?_(!r):b&&"boolean"==typeof b.readOnly&&_(b.readOnly||"disable"===t||!r||"dropDown"===b?.inputType?.type)},[b,r]);const M=O6(x),[z,S]=s("border-none"),[O,I]=s({label:"",value:""}),[N,j]=s({label:"",value:""}),[T,D]=s({color:A.color,backgroundColor:A.backgroundColor,borderColor:A.borderColor}),L=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],P=c5.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{u(w,T.color)},0);return()=>{clearTimeout(e)}},[T.color]),l(()=>{let e=setTimeout(()=>{p(w,T.backgroundColor)},0);return()=>{clearTimeout(e)}},[T.backgroundColor]);return l(()=>{const e=x.fontFamily,t=`${i5(x.fontSize)}`;I({label:e??"Times New Roman",value:e??"Times New Roman"}),j({label:t??"11",value:t??"11"})},[x]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(AW,{disabled:y,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{I({label:e.label,value:e.label}),f(w,e.value)},required:!1,optionsList:l5,selectedOption:O})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(AW,{disabled:y,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{j({label:e.label,value:e.value}),d(w,e.value)},optionsList:P,selectedOption:N})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(pF,{placement:"top",title:"Text Left",children:e(lF,{disabled:y,variant:"left"===x.textAlign?"dark":"light",hoverEffect:"left"!==x.textAlign,onClick:()=>h(w,"left"),name:"text_align_left"})}),e(pF,{placement:"top",title:"Text Center",children:e(lF,{disabled:y,variant:"center"===x.textAlign?"dark":"light",hoverEffect:"center"!==x.textAlign,onClick:()=>h(w,"center"),name:"text_align_center"})}),e(pF,{placement:"top",title:"Text Right",children:e(lF,{disabled:y,variant:"right"===x.textAlign?"dark":"light",hoverEffect:"right"!==x.textAlign,onClick:()=>h(w,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(pF,{placement:"top",title:"Bold",children:e(lF,{disabled:y,variant:M.bold?"dark":"light",hoverEffect:!M.bold,onClick:()=>a(w),name:"bold"})}),e(pF,{placement:"top",title:"Italic",children:e(lF,{disabled:y,variant:M.italic?"dark":"light",hoverEffect:!M.italic,onClick:()=>i(w),name:"italic"})}),e(pF,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(lF,{disabled:y,variant:"underline"===x.textDecoration?"dark":"light",hoverEffect:"underline"!==x.textDecoration,onClick:()=>c(w),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(pF,{placement:"top",title:"Format Painter",children:e(lF,{disabled:y,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{v(w)},name:"formate_painter"})}),e(pF,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(lF,{disabled:y,hoverEffect:!0,width:12,height:12,onClick:()=>{u(w,T.color)},name:"text_color"}),e(x6,{disabled:y,getColorValue:e=>{D(t=>({...t,color:e}))},initialColor:T.color})]})}),e(pF,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(lF,{disabled:y,hoverEffect:!0,width:12,height:12,onClick:()=>p(w,T.backgroundColor),name:"fill_color"}),e(x6,{disabled:y,getColorValue:e=>{D(t=>({...t,backgroundColor:e}))},initialColor:T.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(pF,{placement:"top",title:"Border Type",children:e(lF,{hoverEffect:!0,disabled:y,onClick:()=>m(w,z,"var(--input-hover-border-color)"),name:(()=>{const e=L.find(e=>e.value===z);return e?e.icon:""})()})}),e("span",{ref:k,children:e(SW,{disabled:y,iconName:"arrow_down",targetRef:k,iconSize:12,zIndex:2e3,options:L,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;m(w,t,"var(--input-hover-border-color)"),S(t)}})})]})})]})},N6=(e,t)=>{let n,r=null;const a=function(...a){const i=this;null===r||Date.now()-r>=t?(e.apply(i,a),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(i,a),r=Date.now()},t-(Date.now()-r)))};return a.cancel=()=>{n&&clearTimeout(n),n=null,r=null},a},j6=r.forwardRef(function(t,a){const{className:i,columnLabels:o=[],rowLabels:l=[],toolbar:c,editable:s,onKeyDown:u,Table:d=n6,Row:f=r6,sheetHeight:h,HeaderRow:p=a6,DataEditor:m=_6,DataViewer:v=v6,onSelect:g=()=>{},onActivate:y=()=>{},onEvaluatedDataChange:_=()=>{},contextOption:b,attachmentAction:w,workRef:E,minimumColumnWidth:A,setContextMenu:x,maxRowLimit:C,maxColLimit:k,disableDeleteOption:M,contextMenu:z,getActiveCell:S,onAddColumn:O,onDeleteColumn:I}=t,N=t.minimumColumnWidth||100,j=r.useRef(!1),D=o6(e=>e.model.data),[L,P]=r.useState(!1),[R,H]=r.useState(0),[B,q]=r.useState(0),[F,U]=r.useState({top:0,left:0}),[V,W]=r.useState(!1),[Q,G]=r.useState(!1),Y=r.useMemo(()=>{const e=t.createFormulaParser||f5,n=new g5(e,t.data);return P(e=>!e),{...B5,model:n,selected:t.selected||B5.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(q5,Y),[Z,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:a}=C4(e);return{rows:t?Math.max(a,t.length):a,columns:n?Math.max(r,n.length):r}}(Z.model.data,l,o),[Z.model.data,l,o]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Z.rowDimensions[n]?.height||32;return t},[Z.rowDimensions,32]),ae=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Z.columnDimensions[n]?.width||N;return t},[Z.columnDimensions,N]),ie=re(J.rows),oe=ae(J.columns),le=re($.start),ce=ie-re($.end),se=ae(te.start),ue=oe-ae(te.end),de=Z.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(R3),me=he(m4),ve=he(p4),ge=he(v4),ye=he(u4),_e=he(d4),be=he(r4),we=he(f4),Ee=he(h4),Ae=he(a4),xe=he(i4),Ce=he(o4),ke=he(q3),Me=he(F3),ze=he(V3),Se=he(G3),Oe=he(W3),Ie=he(Q3),Ne=he(U3),je=he(Y3),Te=he(K3),De=he(Z3),Le=he(P3),Pe=he(X3),Re=he(J3),He=he($3),Be=he(e4),qe=he(t4),Fe=he(n4);r.useImperativeHandle(a,()=>({removeSelect:ge}));const Ue=r.useRef(Z.active);r.useEffect(()=>{if(Z.active!==Ue.current)if(Z.active)y(Z.active);else{const e=E.current;e&&n5(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=Z.active},[y,Z.active]);const Ve=r.useRef(Z.model.evaluatedData);r.useEffect(()=>{Z?.model?.evaluatedData!==Ve?.current&&_(Z?.model?.evaluatedData),Ve.current=Z.model.evaluatedData},[Z?.model?.evaluatedData,_]);const We=r.useRef(Z.selected);r.useEffect(()=>{Z.selected.equals(We.current)||t.selected&&Z.selected.equals(t.selected)||g(Z.selected),We.current=Z.selected},[Z.selected,g,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&Ce(t.selected),Qe.current=t.selected},[t.selected,Ce]);let Ge=r.useRef(t.data);r.useEffect(()=>{pe(s),t.data!==Ge.current&&Ae(t.data),Ge.current=t.data},[t.data,Ae,s]);const Ye=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ye.current&&t.createFormulaParser&&xe(t.createFormulaParser),Ye.current=t.createFormulaParser},[t.createFormulaParser,xe]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Z,{data:r}=t,a=n.toRange(r);if(a){!function(e,t){e.clipboardData?.setData(F4,t)}(e,e5(function(e,t,n){const r=[],a=t.column-e.column;for(let i=e.row;i<=t.row;i++){const o=i-e.row;r[o]=r[o]||Array(a);for(let a=e.column;a<=t.column;a++)r[o][a-e.column]=g4({row:i,column:a},n)}return r}(a.start,a.end,r)))}},[Z]),Ze=r.useCallback(e=>{t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[de,Ke,me]),Xe=r.useCallback(e=>{t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ve())},[de,Ke,ve]),Je=r.useCallback(e=>{if(t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(F4):""}(e);ye(t)}},[de,ye]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(D)):t&&"i"===n?(e.preventDefault(),Me(D)):t&&"u"===n&&(e.preventDefault(),ze(D)),u&&u(e),e.defaultPrevented||(function(e,t){return void 0!==P5(e,t)}(Z,e)&&e.nativeEvent.preventDefault(),_e(e))},[Z,u,_e]),et=r.useCallback(()=>{Z.formattedStyle.open&&Z.active&&Le(Z.active)},[Z]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Z.dragging||1!==e.buttons||"view"!==de||(we(),document.addEventListener("mouseup",tt))},[Z,we,tt,de]),rt=r.useMemo(()=>m6(t.Cell||p6),[t.Cell,L,s]),at=r.useMemo(()=>c6(t.CornerIndicator||l6),[t.CornerIndicator,L]),it=r.useMemo(()=>h6(t.RowIndicator||f6),[t.RowIndicator,L]),ot=r.useMemo(()=>s6(t.ColumnIndicator||u6),[t.ColumnIndicator,L]);r.useEffect(()=>(document.addEventListener("cut",Ze),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ze),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ze,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;q(Math.min(fe.current.clientHeight,n)),H(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},ct=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:a,clientWidth:i}=t;U({top:n,left:a});let o=0;for(;o<J.rows&&re(o)<n;)o++;let l=o;for(;l<J.rows&&re(l)<n+r;)l++;o=Math.max(0,o-10),l=Math.min(J.rows,l+10),ee({start:o,end:l});const c=l===J.rows;W(c);let s=0;for(;s<J.columns&&ae(s)<a;)s++;let u=s;for(;u<J.columns&&ae(u)<a+i;)u++;s=Math.max(0,s-10),u=Math.min(J.columns,u+10),ne({start:s,end:u});const d=u===J.columns;G(d),z.open&&x({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ae]),st=r.useMemo(()=>N6(ct,16),[ct]),ut=e=>{j.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Z.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},dt=e=>{j.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Z.columnDimensions?.[n]?.width||N;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{j.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,j.current]);const ft=U4($.end,$.start),ht=U4(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${se}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Z.columnDimensions[t]?.width||N}px`}},t)),e("col",{style:{width:`${ue}px`}},"right-spacer")," "]}),mt=r.useMemo(()=>n(d,{useTableRef:lt,totalWidth:oe,children:[pt,n("tbody",{children:[n(p,{children:[e(at,{}),e("div",{className:"spacer left"}),ht.map(n=>e(ot,{column:n,minimumColumnWidth:A,setContextMenu:t.setContextMenu,label:n in o?o[n]:void 0,deleteColumn:Fe,addColumnLeft:He,addColumnRight:Be,columnContextEnable:t.columnContextEnable,maxColLimit:k,disableDeleteOption:M,contextMenu:z,onAddColumn:O,onDeleteColumn:I,setVisibleRange:ne,scrollToColumn:dt},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(it,{label:r in l?l?.[r]:void 0,row:r,addRowTop:Pe,addRowBottom:Re,deleteRow:qe,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:C,disableDeleteOption:M,contextMenu:z,setVisibleRange:ee,scrollToRow:ut},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:v},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${ce}px`}})]})]}),[d,J.rows,J.columns,f,p,at,o,ot,l,it,rt,v,$,te,le,ce,se,ue,Z.rowDimensions,Z.columnDimensions]),vt=r.useMemo(()=>e(b6,{attachmentAction:w,contextOption:b,getActiveCell:S,setContextMenu:t.setContextMenu,DataEditor:m,visibleRowRange:$,visibleColRange:te,maxHeight:B-64,maxWidth:R-A,totalHeight:ie,totalWidth:oe,isAtBottom:V,isAtRight:Q,scrollPos:F,editable:s}),[m,$,te,Z.active,B,R,ie,oe,V,Q,s]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${R}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),e("div",{style:{height:`${B}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),"hide"!==c&&e("div",{className:"ff-excel-toolbar-container",children:e(I6,{editable:s,toolbar:c,onBold:ke,onItalic:Me,setUnderlineType:ze,setColor:je,setBorderType:Ne,setFontSize:Oe,setFontFamily:Ie,setTextAlign:Se,setBackgroundColor:Te,setFormatePainter:De})}),n("div",{ref:fe,style:{height:h},className:T("ff-excel-spreadsheet",i),onKeyPress:be,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>st(e),children:[mt,vt,e(E6,{scrollPos:F}),e(A6,{scrollPos:F})]})]}),[i,be,$e,nt,mt,vt,R]);return e(t6.Provider,{value:K,children:gt})}),T6=({contextMenu:t,position:r,editable:a})=>{if(!t.open)return null;return a&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const a=t.disable;return e(pF,{title:a?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(a?"disabled":""),onClick:()=>{a||t.action()},children:[t.iconName&&e(lF,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:a}),e(cF,{as:"label",children:t.label})]})},t.label)}var r;return null})})},D6=({excelData:r,contextOption:i,toolbar:c="show",sheetBar:u="show",rowCount:d=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:m=0,contextWidthPositioning:v=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:y,attachmentAction:_={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:b=3e3,scroller:w=!1,columnContextEnable:E=!0,rowContextEnable:A=!0,sheetBarContextEnable:x=!0,minimumColumnWidth:C=100,disableDeleteOption:k=!1,maxRowLimit:M=1/0,maxColLimit:z=1/0,maxSheetLimit:S=1/0,getActiveCell:O=()=>{}})=>{const I=o(null),[N,j]=s([]),[D,L]=s(""),[P,R]=a.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[H,B]=s({name:"defaultSheet",index:0}),[q,F]=s({defaultSheet:[[o5]]}),[U,V]=s([[o5]]),[W,Q]=s((g.length,{})),[G,Y]=s({x:0,y:0}),K=o(""),Z=o(null),X=o(null),J=o(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);j(t),hF(t.length)||(K.current=t[0]||"",B({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,a=e.data,i=Math.max(d,a.length),o=Math.max(f,Math.max(...a.map(e=>e.length)));let l=Array.from({length:i},()=>Array(o).fill({value:"",style:o5.style,readOnly:!1,inputType:void 0}));a.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<i&&n<o&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:hF(e?.style)?o5.style:z6(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const c=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const a=c.has(`r${n+1}`)||c.has(`c${r+1}`)||c.has(`${n+1},${r+1}`),i=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||o5);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:a,inputType:i,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=a[0]||[];r[t]=Array.from({length:o},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),F(n),g.length>1&&Q(r);const a=Object.keys(n)[0];a&&void 0!==n[a]&&V(n[a])}},[r]),l(()=>{y&&y(D),"File saved"===D&&setTimeout(()=>{L("")},2e3)},[D]),l(()=>{L("Saving..."),$(te())},[q,K.current]);const $=a.useCallback(HW(e=>{if(g.length>1){const t={...W};N.forEach((n,r)=>{const a=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:a[t]||""}))}),Q(t);const n=N.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);L("File saved")},b),[g,W,N]),ee=a.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),$(te()))},[g]);a.useEffect(()=>(document.addEventListener("keydown",ee),()=>{document.removeEventListener("keydown",ee)}),[ee]);const te=()=>N.map(e=>{const t=q[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:O6(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:hF(n.length)?[[]]:n}}),[ne,re]=s(null),ae=()=>N.length>=S,ie=()=>{if(ae())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,a=2;for(;n.includes(r.toLowerCase());)r=`${e}${a}`,a++;return r})("Sheet",N),t=Array.from({length:d},()=>Array.from({length:f},()=>o5));j(t=>[...t,e]),B({index:N?.length,name:e}),F({...q,[e]:t}),V(t),g.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),K.current=e},oe=(e=[[o5]])=>{V(e)},le=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void re(null);const a=(r.textContent||"").trim();if(!a)return iY.warning("Sheet name cannot be empty."),r.textContent=H.name,void re(null);if(a.length>50)return iY.warning("The sheet name cannot be greater than 50 characters"),r.textContent=H.name,void re(null);if(N.map(e=>e.toLowerCase()).includes(a.toLowerCase())&&n.trim()?.toLowerCase()!==a?.toLowerCase())return iY.warning("Sheet name already exists"),r.textContent=H.name,void re(null);let i=N;oe(q?.[n]),i.splice(t,1,a);const o=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...a}=e;return{...a,[n]:r??[]}}(q,n,a);K.current=a,B(e=>({...e,name:a})),F(o),g.length>1&&Q(e=>{const t={...e},r=t[n];return delete t[n],t[a]=r??[],t}),re(null)};const ce=(e,t)=>{e!==H.name&&t!==H.index&&(B({index:t,name:e}),j(n=>{const r=[...n];return r[t]=e,r}),oe(q[e]),K.current=e)},se=a.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&P.open&&(R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[P.open]);a.useEffect(()=>(document.addEventListener("contextmenu",se),document.addEventListener("click",e=>se(e,!0)),()=>{document.removeEventListener("contextmenu",se),document.removeEventListener("click",e=>se(e,!0))}),[se]);const ue=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ie(),disableTooltip:"Sheet limit reached",visible:!1,disable:ae()},...k?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(N.length>1){let n=N.slice();n.splice(t,1);const r={...q};delete r[e];const a=Math.min(t,n.length-1);j(n),F(r),g.length>1&&Q(t=>{const n={...t};return delete n[e],n});const i=n[a]?n[a]:"";B({index:a,name:i}),oe(r?.[i]),K.current=i}else iY.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];R(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{J.current?.removeSelect()},[H.name]);return e(t,{children:N.length>0&&n("div",{ref:Z,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=X.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let a=e.clientX-(t?.left||0)+n,i=e.clientY-(t?.top||0)+r;const o=300,l=window.innerWidth,c=window.innerHeight,s=l-e.clientX,u=e.clientX,d=c-e.clientY,f=e.clientY;s<o&&u>=o?a=e.clientX-(t?.left||0)+n-150:a+=2,d<200&&f>=200?i=e.clientY-(t?.top||0)+r-20:i+=2,e.target.classList.contains("ff-excel-tab-list")?Y({x:a,y:i-(k?32:65)}):(a+o>l&&(a=l-o-2),a<0&&(a=2),Y({x:a+v,y:i+m}))},onClick:e=>{e.stopPropagation(),P.open&&R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:X,className:"ff-excel-sheet",children:e(j6,{ref:J,editable:p,attachmentAction:_,toolbar:c,sheetHeight:h,setContextMenu:R,contextOption:i,data:U,columnContextEnable:E,rowContextEnable:A,minimumColumnWidth:C,onEvaluatedDataChange:e=>{F(t=>({...t,[K.current]:e}))},workRef:Z,scroller:w,maxRowLimit:M,maxColLimit:z,disableDeleteOption:k,contextMenu:P,getActiveCell:O,onAddColumn:(e,t)=>{g.length>1&&Q(n=>{const r=H.name,a=[...n[r]||[]],i=t?e:e+1;return a.splice(i,0,{newData:"",oldData:""}),{...n,[r]:a}})},onDeleteColumn:e=>{g.length>1&&Q(t=>{const n=H.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},H.name)}),"hide"!==u&&n("div",{className:"ff-excel-sheet-bar",children:["show"===u&&n("div",{className:"ff-excel-add-sheet-set",children:[e(pF,{title:ae()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(lF,{disabled:!p||ae(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ie,name:"plus_icon",height:20,width:20})}),e(SW,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[H?.name===t?e(lF,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(pF,{title:xF(t,20,"count")?t:"",children:e(cF,{children:AF(t,20,"count")})})]}),name:r,value:t})))(N),targetRef:I,onOptionClick:e=>{const{value:t,name:n=""}=e;ce(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:H.name})]}),e("div",{className:"ff-excel-tab-container",children:N.map((t,n)=>e(cF,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{ce(t,n),x&&ue(e,t,n)},className:T("ff-excel-tab-list",{active:t===H.name}),onClick:()=>{ce(t,n)},suppressContentEditableWarning:ne===n,onDoubleClick:e=>{"show"===u&&(re(n),null===ne&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&ne===n,onBlur:e=>{le(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),le(e,n,t))},children:t})},t))})]}),P.open&&e(T6,{contextMenu:P,position:G,editable:p}),e(aY,{})]})})},L6=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:a=!1})=>{const i=a?"filter":"module";return e("div",{className:T("ff-module-chip",{"ff-filter-chip":a,[`ff-${i}-chip--active`]:n,[`ff-${i}-chip--hover`]:!n}),onClick:r,children:e(cF,{lineHeight:"18px",className:"module-typography",children:t})})},P6=({x:e,y:t,radius:n,startAngle:r,endAngle:a})=>{const i=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(a),c=t+n*Math.sin(a),s=a-r>Math.PI?1:0;return a-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${i} ${o} A ${n} ${n} 0 ${s} 1 ${l} ${c}`},R6=({radius:t=15,lineWidth:r=5,label:a,percentageValue:i,icon:l,fontSize:c=10,labelColor:u="",arcColor:d="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[m,v]=s({x:0,y:0}),[g,y]=s(!1),_=o(null);let b=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:E,foregroundArcPath:A}=((e,t,n)=>{const r=t,a=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:P6({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:P6({x:0,y:0,radius:n,startAngle:r,endAngle:a})}})(i,b,t),x=()=>{y(!0)},C=()=>{v({x:0,y:0}),y(!1)},k=e=>{if(_.current){const t=_.current.getBoundingClientRect();v({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:_,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${c}px`},onClick:p,children:[e("svg",{width:w,height:w,viewBox:`0 0 ${w} ${w}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),e("path",{d:A,fill:"none",stroke:d,strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),h&&e("path",{d:A,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(lF,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:u||d,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(i)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${m.x+15}px`,top:m.y-5+"px"},children:[e(cF,{children:`${a} : `}),n(cF,{children:[i,"%"]})]})]})},H6=({mediaSrc:t,fileId:r,onExpandClick:a,onDeleteClick:i,onDownloadClick:o,height:l="75px",width:c="79px",fileName:s,thumbnailMediaSrc:u,isDelete:d})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:c},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:c},children:[e("img",{src:u||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(pF,{title:"Download File",placement:"bottom",children:e(lF,{name:"download_file_icon",height:10,width:10,onClick:o,color:"var(--icons-default-color)"})})}),d&&e("div",{className:"ff-icon-container",children:e(pF,{title:"Delete",placement:"bottom",children:e(lF,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{i&&i(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(pF,{title:"Maximize",placement:"bottom",children:e(lF,{name:"expand_icon",height:16,width:16,onClick:a})})})]}),e(cF,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:s})]})}),B6=({icon:r,status:a,count:i,text:o,style:c={width:"196.4px"},resetToggle:u,onSelectedStatus:d=e=>{}})=>{const[f,h]=s(!1),p=["total defects","defect density","open defects","closed defects","quality score"],m=p.includes(a.toLowerCase()),v=p.includes(a.toLowerCase());l(()=>{h(!u)},[u]);return n("div",{className:`ff-card-container ${a.toLowerCase()} ${f?"toggled":""}`,style:c,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),d(e))})(a),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(lF,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(a.toLowerCase())&&e(cF,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(v?"red-background":""),children:n(t,m?{children:[e(cF,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:o}),e(cF,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===a.toLowerCase()?n(t,{children:[i.toString().padStart(2,"0"),e(cF,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===a.toLowerCase()?`${parseFloat(i.toString()).toFixed(2)}%`:i.toString().padStart(2,"0")})]}:{children:[e(cF,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:i.toString().padStart(2,"0")}),e(cF,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:o})]})})]})},q6=({option:t})=>{const r=o(null),[a,i]=s(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{i(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const c={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(pF,{title:a?u(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:u(t)})}),e(lF,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":c[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function F6(e){return()=>e}function U6(e){e()}function V6(e,t){return n=>e(t(n))}function W6(e,t){return()=>e(t)}function Q6(e){return void 0!==e}function G6(){}function Y6(e,t){return t(e),e}function K6(e,t){return t(e)}function Z6(...e){return e}function X6(e,t){return e(1,t)}function J6(e,t){e(0,t)}function $6(e){e(2)}function e7(e){return e(4)}function t7(e,t){return X6(e,function(e,t){return n=>e(t,n)}(t,0))}function n7(e,t){const n=e(1,e=>{n(),t(e)});return n}function r7(e){let t,n;return r=>a=>{t=a,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function a7(e,t){return e===t}function i7(e=a7){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function o7(e){return t=>n=>{e(n)&&t(n)}}function l7(e){return t=>V6(t,e)}function c7(e){return t=>()=>{t(e)}}function s7(e,...t){const n=function(...e){return t=>e.reduceRight(K6,t)}(...t);return(t,r)=>{switch(t){case 2:return void $6(e);case 1:return X6(e,n(r))}}}function u7(e,t){return n=>r=>{n(t=e(t,r))}}function d7(e){return t=>n=>{e>0?e--:t(n)}}function f7(e){let t,n=null;return r=>a=>{n=a,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function h7(...e){const t=new Array(e.length);let n=0,r=null;const a=Math.pow(2,e.length)-1;return e.forEach((e,i)=>{const o=Math.pow(2,i);X6(e,e=>{const l=n;n|=o,t[i]=e,l!==a&&n===a&&r&&(r(),r=null)})}),e=>i=>{const o=()=>{e([i].concat(t))};n===a?o():r=o}}function p7(e){let t=e;const n=v7();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function m7(e,t){return Y6(p7(t),t=>t7(e,t))}function v7(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function g7(e){return Y6(v7(),t=>t7(e,t))}function y7(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:_7(),singleton:n}}const _7=()=>Symbol();function b7(...e){const t=v7(),n=new Array(e.length);let r=0;const a=Math.pow(2,e.length)-1;return e.forEach((e,i)=>{const o=Math.pow(2,i);X6(e,e=>{n[i]=e,r|=o,r===a&&J6(t,n)})}),function(e,i){switch(e){case 2:return void $6(t);case 1:return r===a&&i(n),X6(t,i)}}}function w7(e,t=a7){return s7(e,i7(t))}function E7(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(U6)}}(...e.map(e=>X6(e,n)))}}}var A7=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(A7||{});const x7={0:"debug",3:"error",1:"log",2:"warn"},C7=y7(()=>{const e=p7(3);return{log:p7((t,n,r=1)=>{var a;r>=(null!=(a=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?a:e7(e))&&console[x7[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function k7(e,t,n){return M7(e,t,n).callbackRef}function M7(e,t,n){const r=a.useRef(null);let i=e=>{};const o=a.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(null==o||o.observe(e),r.current=e):(r.current&&(null==o||o.unobserve(r.current)),r.current=null)},{callbackRef:i,ref:r}}function z7(e,t,n,r,i,o,l,c,s){const u=a.useCallback(n=>{const a=function(e,t,n,r){const a=e.length;if(0===a)return null;const i=[];for(let o=0;o<a;o++){const a=e.item(o);if(void 0===a.dataset.index)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),s=t(a,n);if(0===s&&r("Zero-sized element, this should not happen",{child:a},A7.ERROR),s===c)continue;const u=i[i.length-1];0===i.length||u.size!==s||u.endIndex!==l-1?i.push({endIndex:l,size:s,startIndex:l}):i[i.length-1].endIndex++}return i}(n.children,t,c?"offsetWidth":"offsetHeight",i);let s=n.parentElement;for(;!s.dataset.virtuosoScroller;)s=s.parentElement;const u="window"===s.lastElementChild.dataset.viewportType;let d;u&&(d=s.ownerDocument.defaultView);const f=l?c?l.scrollLeft:l.scrollTop:u?c?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:c?s.scrollLeft:s.scrollTop,h=l?c?l.scrollWidth:l.scrollHeight:u?c?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:c?s.scrollWidth:s.scrollHeight,p=l?c?l.offsetWidth:l.offsetHeight:u?c?d.innerWidth:d.innerHeight:c?s.offsetWidth:s.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:p}),null==o||o(c?S7("column-gap",getComputedStyle(n).columnGap,i):S7("row-gap",getComputedStyle(n).rowGap,i)),null!==a&&e(a)},[e,t,i,o,l,r,c]);return M7(u,n,s)}function S7(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,A7.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function O7(e,t,n){const r=a.useRef(null),i=a.useCallback(n=>{if(null==n||!n.offsetParent)return;const a=n.getBoundingClientRect(),i=a.width;let o,c;if(t){const e=t.getBoundingClientRect(),n=a.top-e.top;c=e.height-Math.max(0,n),o=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,a.top),o=a.top+e.scrollY}r.current={offsetTop:o,visibleHeight:c,visibleWidth:i},e(r.current)},[e,t]),{callbackRef:o,ref:l}=M7(i,!0,n),c=a.useCallback(()=>{i(l.current)},[i,l]);return a.useEffect(()=>{var e;if(t){t.addEventListener("scroll",c);const e=new ResizeObserver(()=>{requestAnimationFrame(c)});return e.observe(t),()=>{t.removeEventListener("scroll",c),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",c),null==t||t.addEventListener("resize",c),()=>{null==t||t.removeEventListener("scroll",c),null==t||t.removeEventListener("resize",c)}}},[c,t,l]),o}const I7=y7(()=>{const e=v7(),t=v7(),n=p7(0),r=v7(),a=p7(0),i=v7(),o=v7(),l=p7(0),c=p7(0),s=p7(0),u=p7(0),d=v7(),f=v7(),h=p7(!1),p=p7(!1),m=p7(!1);return t7(s7(e,l7(({scrollTop:e})=>e)),t),t7(s7(e,l7(({scrollHeight:e})=>e)),o),t7(t,a),{deviation:n,fixedFooterHeight:s,fixedHeaderHeight:c,footerHeight:u,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:h,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:a,viewportHeight:i}},[],{singleton:!0}),N7={lvl:0};function j7(e,t){const n=e.length;if(0===n)return[];let{index:r,value:a}=t(e[0]);const i=[];for(let o=1;o<n;o++){const{index:n,value:l}=t(e[o]);i.push({end:n-1,start:r,value:a}),r=n,a=l}return i.push({end:1/0,start:r,value:a}),i}function T7(e){return e===N7}function D7(e,t){if(!T7(e))return t===e.k?e.v:t<e.k?D7(e.l,t):D7(e.r,t)}function L7(e,t,n="k"){if(T7(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=L7(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return L7(e.l,t,n)}function P7(e,t,n){return T7(e)?Y7(t,n,1):t===e.k?V7(e,{k:t,v:n}):t<e.k?K7(V7(e,{l:P7(e.l,t,n)})):K7(V7(e,{r:P7(e.r,t,n)}))}function R7(){return N7}function H7(e,t,n){if(T7(e))return[];return function(e){return j7(e,({k:e,v:t})=>({index:e,value:t}))}(F7(e,L7(e,t)[0],n))}function B7(e,t){if(T7(e))return N7;const{k:n,l:r,r:a}=e;if(t===n){if(T7(r))return a;if(T7(a))return r;{const[t,n]=G7(r);return U7(V7(e,{k:t,l:W7(r),v:n}))}}return U7(V7(e,t<n?{l:B7(r,t)}:{r:B7(a,t)}))}function q7(e){return T7(e)?[]:[...q7(e.l),{k:e.k,v:e.v},...q7(e.r)]}function F7(e,t,n){if(T7(e))return[];const{k:r,l:a,r:i,v:o}=e;let l=[];return r>t&&(l=l.concat(F7(a,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(F7(i,t,n))),l}function U7(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Q7(t))return Z7(V7(e,{lvl:n-1}));if(!T7(t)&&!T7(t.r))return V7(t.r,{l:V7(t,{r:t.r.l}),lvl:n,r:V7(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Q7(e))return X7(V7(e,{lvl:n-1}));if(T7(r)||T7(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,a=Q7(t)?r.lvl-1:r.lvl;return V7(t,{l:V7(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:X7(V7(r,{l:t.r,lvl:a}))})}}function V7(e,t){return Y7(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function W7(e){return T7(e.r)?e.l:U7(V7(e,{r:W7(e.r)}))}function Q7(e){return T7(e)||e.lvl>e.r.lvl}function G7(e){return T7(e.r)?[e.k,e.v]:G7(e.r)}function Y7(e,t,n,r=N7,a=N7){return{k:e,l:r,lvl:n,r:a,v:t}}function K7(e){return X7(Z7(e))}function Z7(e){const{l:t}=e;return T7(t)||t.lvl!==e.lvl?e:V7(t,{r:V7(e,{l:t.r})})}function X7(e){const{lvl:t,r:n}=e;return T7(n)||T7(n.r)||n.lvl!==t||n.r.lvl!==t?e:V7(n,{l:V7(e,{r:n.l}),lvl:t+1})}function J7(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function $7(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const e8=y7(()=>({recalcInProgress:p7(!1)}),[],{singleton:!0});function t8(e,t,n){return e[n8(e,t,n)]}function n8(e,t,n,r=0){let a=e.length-1;for(;r<=a;){const i=Math.floor((r+a)/2),o=n(e[i],t);if(0===o)return i;if(-1===o){if(a-r<2)return i-1;a=i-1}else{if(a===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function r8(e,t){return Math.round(e.getBoundingClientRect()[t])}function a8(e){return!T7(e.groupOffsetTree)}function i8({index:e},t){return t===e?0:t<e?-1:1}function o8({offset:e},t){return t===e?0:t<e?-1:1}function l8(e,t,n){if(0===t.length)return 0;const{index:r,offset:a,size:i}=t8(t,e,i8),o=e-r,l=i*o+(o-1)*n+a;return l>0?l+n:l}function c8(e,t){if(!a8(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function s8(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=c8("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function u8(e,t,n,r=0){return r>0&&(t=Math.max(t,t8(e,r,i8).offset)),j7(function(e,t,n,r){const a=n8(e,t,r),i=n8(e,n,r,a);return e.slice(a,i+1)}(e,t,n,o8),p8)}function d8(e,[t,n,r,a]){t.length>0&&r("received item sizes",t,A7.DEBUG);const i=e.sizeTree;let o=i,l=0;if(n.length>0&&T7(i)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>P7(P7(t,n,e),n+1,r),o)}else[o,l]=function(e,t){let n=T7(e)?0:1/0;for(const r of t){const{endIndex:t,size:a,startIndex:i}=r;if(n=Math.min(n,i),T7(e)){e=P7(e,0,a);continue}const o=H7(e,i-1,t+1);if(o.some(m8(r)))continue;let l=!1,c=!1;for(const{end:n,start:r,value:i}of o)l?(t>=r||a===i)&&(e=B7(e,r)):(c=i!==a,l=!0),n>t&&t>=r&&i!==a&&(e=P7(e,t+1,i));c&&(e=P7(e,i,a))}return[e,n]}(o,t);if(o===i)return e;const{lastIndex:c,lastOffset:s,lastSize:u,offsetTree:d}=h8(e.offsetTree,l,o,a);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>P7(e,t,l8(t,d,a)),R7()),lastIndex:c,lastOffset:s,lastSize:u,offsetTree:d,sizeTree:o}}function f8(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function h8(e,t,n,r){let a=e,i=0,o=0,l=0,c=0;if(0!==t){c=n8(a,t-1,i8),l=a[c].offset;const e=L7(n,t-1);i=e[0],o=e[1],a.length&&a[c].size===L7(n,t)[1]&&(c-=1),a=a.slice(0,c+1)}else a=[];for(const{start:e,value:c}of H7(n,t,1/0)){const t=e-i,n=t*o+l+t*r;a.push({index:e,offset:n,size:c}),i=e,l=n,o=c}return{lastIndex:i,lastOffset:l,lastSize:o,offsetTree:a}}function p8(e){return{index:e.index,value:e}}function m8(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const v8={offsetHeight:"height",offsetWidth:"width"},g8=y7(([{log:e},{recalcInProgress:t}])=>{const n=v7(),r=v7(),a=m7(r,0),i=v7(),o=v7(),l=p7(0),c=p7([]),s=p7(void 0),u=p7(void 0),d=p7(void 0),f=p7(void 0),h=p7((e,t)=>r8(e,v8[t])),p=p7(void 0),m=p7(0),v={groupIndices:[],groupOffsetTree:R7(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:R7()},g=m7(s7(n,h7(c,e,m),u7(d8,v),i7()),v),y=m7(s7(c,i7(),u7((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),l7(({prev:e})=>e)),[]);t7(s7(c,o7(e=>e.length>0),h7(g,m),l7(([e,t,n])=>{const r=e.reduce((e,r,a)=>P7(e,r,l8(r,t.offsetTree,n)||a),R7());return{...t,groupIndices:e,groupOffsetTree:r}})),g),t7(s7(r,h7(g),o7(([e,{lastIndex:t}])=>e<t),l7(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),t7(s,u);const _=m7(s7(s,l7(e=>void 0===e)),!0);t7(s7(u,o7(e=>void 0!==e&&T7(e7(g).sizeTree)),l7(e=>{const t=e7(d),n=e7(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),t7(s7(f,o7(e=>void 0!==e&&e.length>0&&T7(e7(g).sizeTree)),l7(e=>{const t=[];let n=e[0],r=0;for(let a=1;a<e.length;a++){const i=e[a];i!==n&&(t.push({endIndex:a-1,size:n,startIndex:r}),n=i,r=a)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),t7(s7(c,h7(d,u),o7(([,e,t])=>void 0!==e&&void 0!==t),l7(([e,t,n])=>{const r=[];for(let a=0;a<e.length;a++){const i=e[a],o=e[a+1];r.push({startIndex:i,endIndex:i,size:t}),void 0!==o&&r.push({startIndex:i+1,endIndex:o-1,size:n})}return r})),n);const b=g7(s7(n,h7(g),u7(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:v}),l7(e=>e.changed)));X6(s7(l,u7((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),l7(e=>e.diff)),e=>{const{groupIndices:n}=e7(g);if(e>0)J6(t,!0),J6(i,e+f8(e,n));else if(e<0){const t=e7(y);t.length>0&&(e-=f8(-e,t)),J6(o,e)}}),X6(s7(l,h7(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},A7.ERROR)});const w=g7(i);t7(s7(i,h7(g),l7(([e,t])=>{const n=t.groupIndices.length>0,r=[],a=t.lastSize;if(n){const n=D7(t.sizeTree,0);let i=0,o=0;for(;i<e;){const e=t.groupIndices[o],l=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:a,startIndex:e+1}),o++,i+=l+1}const l=q7(t.sizeTree);return i!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let a=t.ranges;return 0!==t.prevSize&&(a=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:a}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return q7(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:a,ranges:[]}).ranges})),n);const E=g7(s7(o,h7(g,m),l7(([e,{offsetTree:t},n])=>l8(-e,t,n))));return t7(s7(o,h7(g,m),l7(([e,t,n])=>{if(t.groupIndices.length>0){if(T7(t.sizeTree))return t;let r=R7();const a=e7(y);let i=0,o=0,l=0;for(;i<-e;){l=a[o];const e=a[o+1]-l-1;o++,i+=e+1}if(r=q7(t.sizeTree).reduce((t,{k:n,v:r})=>P7(t,Math.max(0,n+e),r),r),i!==-e){r=P7(r,0,D7(t.sizeTree,l));r=P7(r,1,L7(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...h8(t.offsetTree,0,r,n)}}{const r=q7(t.sizeTree).reduce((t,{k:n,v:r})=>P7(t,Math.max(0,n+e),r),R7());return{...t,sizeTree:r,...h8(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:w,data:p,defaultItemSize:u,firstItemIndex:l,fixedItemSize:s,fixedGroupSize:d,gap:m,groupIndices:c,heightEstimates:f,itemSize:h,listRefresh:b,shiftWith:o,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:a,totalCount:r,trackItemSizes:_,unshiftWith:i}},Z6(C7,e8),{singleton:!0});function y8(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const _8=y7(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:a}])=>{const i=v7(),o=v7(),l=g7(s7(i,l7(y8)));return t7(s7(l,l7(e=>e.totalCount)),n),t7(s7(l,l7(e=>e.groupIndices)),e),t7(s7(b7(a,t,r),o7(([e,t])=>a8(t)),l7(([e,t,n])=>L7(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),i7(),l7(e=>[e])),o),{groupCounts:i,topItemsIndexes:o}},Z6(g8,I7)),b8=y7(([{log:e}])=>{const t=p7(!1),n=g7(s7(t,o7(e=>e),i7()));return X6(t,t=>{t&&e7(e)("props updated",{},A7.DEBUG)}),{didMount:n,propsReady:t}},Z6(C7),{singleton:!0}),w8=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function E8(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!w8)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const A8=y7(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:a,fixedHeaderHeight:i,footerHeight:o,headerHeight:l,scrollingInProgress:c,scrollTo:s,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const h=v7(),p=v7(),m=p7(0);let v=null,g=null,y=null;function _(){v&&(v(),v=null),y&&(y(),y=null),g&&(clearTimeout(g),g=null),J6(c,!1)}return t7(s7(h,h7(n,d,r,m,l,o,f),h7(e,i,a),l7(([[e,n,r,a,i,o,l,s],d,f,m])=>{const b=E8(e),{align:w,behavior:E,offset:A}=b,x=a-1,C=s8(b,n,x);let k=l8(C,n.offsetTree,d)+o;"end"===w?(k+=f+L7(n.sizeTree,C)[1]-r+m,C===x&&(k+=l)):"center"===w?k+=(f+L7(n.sizeTree,C)[1]-r+m)/2:k-=i,A&&(k+=A);const M=t=>{_(),t?(s("retrying to scroll to",{location:e},A7.DEBUG),J6(h,e)):(J6(p,!0),s("list did not change, scroll successful",{},A7.DEBUG))};if(_(),"smooth"===E){let e=!1;y=X6(t,t=>{e=e||t}),v=n7(u,()=>{M(e)})}else v=n7(s7(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),M);return g=setTimeout(()=>{_()},1200),J6(c,!0),s("scrolling from index to",{behavior:E,index:C,top:k},A7.DEBUG),{behavior:E,top:k}})),s),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},Z6(g8,I7,C7),{singleton:!0});function x8(e,t){0==e?t():requestAnimationFrame(()=>{x8(e-1,t)})}function C8(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const k8=y7(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:a,scrollToIndex:i},{didMount:o}])=>{const l=p7(!0),c=p7(0),s=p7(!0);return t7(s7(o,h7(c),o7(([e,t])=>!!t),c7(!1)),l),t7(s7(o,h7(c),o7(([e,t])=>!!t),c7(!1)),s),X6(s7(b7(t,o),h7(l,n,e,s),o7(([[,e],t,{sizeTree:n},r,a])=>e&&(!T7(n)||Q6(r))&&!t&&!a),h7(c)),([,e])=>{n7(a,()=>{J6(s,!0)}),x8(4,()=>{n7(r,()=>{J6(l,!0)}),J6(i,e)})}),{initialItemFinalLocationReached:s,initialTopMostItemIndex:c,scrolledToInitialItem:l}},Z6(g8,I7,A8,b8),{singleton:!0});function M8(e,t){return Math.abs(e-t)<1.01}const z8="up",S8="down",O8={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},I8=y7(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:a,viewportHeight:i}])=>{const o=p7(!1),l=p7(!0),c=v7(),s=v7(),u=p7(4),d=p7(0),f=m7(s7(E7(s7(w7(a),d7(1),c7(!0)),s7(w7(a),d7(1),c7(!1),r7(100))),i7()),!1),h=m7(s7(E7(s7(n,c7(!0)),s7(n,c7(!1),r7(200))),i7()),!1);t7(s7(b7(w7(a),w7(d)),l7(([e,t])=>e<=t),i7()),l),t7(s7(l,f7(50)),s);const p=g7(s7(b7(r,w7(i),w7(t),w7(e),w7(u)),u7((e,[{scrollHeight:t,scrollTop:n},r,a,i,o])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-o){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let c;return c=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:c,state:l}},O8),i7((e,t)=>e&&e.atBottom===t.atBottom))),m=m7(s7(r,u7((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(M8(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const a=t-(n+r)<1;return e.scrollTop!==n&&a?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),o7(e=>e.changed),l7(e=>e.jump)),0);t7(s7(p,l7(e=>e.atBottom)),o),t7(s7(o,f7(50)),c);const v=p7(S8);t7(s7(r,l7(({scrollTop:e})=>e),i7(),u7((e,t)=>e7(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?z8:S8,prevScrollTop:t},{direction:S8,prevScrollTop:0}),l7(e=>e.direction)),v),t7(s7(r,f7(50),c7("none")),v);const g=p7(0);return t7(s7(f,o7(e=>!e),c7(0)),g),t7(s7(a,f7(100),h7(f),o7(([e,t])=>!!t),u7(([e,t],[n])=>[t,n],[0,0]),l7(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:s,atTopThreshold:d,isAtBottom:o,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:m,scrollDirection:v,scrollVelocity:g}},Z6(I7)),N8="top",j8="bottom",T8="none";function D8(e,t,n){return"number"==typeof e?n===z8&&t===N8||n===S8&&t===j8?e:0:n===z8?t===N8?e.main:e.reverse:t===j8?e.main:e.reverse}function L8(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const P8=y7(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:a}])=>{const i=v7(),o=p7(0),l=p7(0),c=p7(0),s=m7(s7(b7(w7(r),w7(a),w7(n),w7(i,$7),w7(c),w7(o),w7(t),w7(e),w7(l)),l7(([e,t,n,[r,a],i,o,l,c,s])=>{const u=e-c,d=o+l,f=Math.max(n-u,0);let h=T8;const p=L8(s,N8),m=L8(s,j8);return r-=c,a+=n+l,(r+=n+l)>e+d-p&&(h=z8),(a-=c)<e-f+t+m&&(h=S8),h!==T8?[Math.max(u-n-D8(i,N8,h)-p,0),u-f-l+t+D8(i,j8,h)+m]:null}),o7(e=>null!=e),i7($7)),[0,0]);return{increaseViewportBy:l,listBoundary:i,overscan:c,topListHeight:o,visibleRange:s}},Z6(I7),{singleton:!0});const R8={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function H8(e,t,n,r,a,i){const{lastIndex:o,lastOffset:l,lastSize:c}=a;let s=0,u=0;if(e.length>0){s=e[0].offset;const t=e[e.length-1];u=t.offset+t.size}const d=n-o,f=s,h=l+d*c+(d-1)*r-u;return{bottom:u,firstItemIndex:i,items:q8(e,a,i),offsetBottom:h,offsetTop:s,top:f,topItems:q8(t,a,i),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function B8(e,t,n,r,a,i){let o=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-o>=e)break;o++}const l=e+o,c=C8(t,l);return H8(Array.from({length:l}).map((e,t)=>({data:i[t+c],index:t+c,offset:0,size:0})),[],l,a,n,r)}function q8(e,t,n){if(0===e.length)return[];if(!a8(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,a=e[e.length-1].index,i=[],o=H7(t.groupOffsetTree,r,a);let l,c=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=o.shift(),c=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:c,type:"group"}:{groupIndex:c,index:r.index-(c+1)+n},i.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return i}function F8(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const U8=y7(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:a},i,{listBoundary:o,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:s,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:p}])=>{const m=p7([]),v=p7(0),g=v7(),y=p7(0);t7(i.topItemsIndexes,m);const _=m7(s7(b7(h,p,w7(c,$7),w7(a),w7(r),w7(s),u,w7(m),w7(t),w7(n),w7(y),e),o7(([e,t,,n,,,,,,,,r])=>{const a=r&&r.length!==n;return e&&!t&&!a}),l7(([,,[e,t],n,r,a,i,o,l,c,s,u])=>{var d,f,h,p;const m=r,{offsetTree:g,sizeTree:y}=m,_=e7(v);if(0===n)return{...R8,totalCount:n};if(0===e&&0===t)return 0===_?{...R8,totalCount:n}:B8(_,a,r,l,c,u||[]);if(T7(y))return _>0?null:H8(function(e,t,n){if(a8(t)){const r=c8(e,t);return[{index:L7(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(C8(a,n),m,u),[],n,c,m,l);const b=[];if(o.length>0){const e=o[0],t=o[o.length-1];let n=0;for(const r of H7(y,e,t)){const a=r.value,i=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=i;e<=o;e++)b.push({data:null==u?void 0:u[e],index:e,offset:n,size:a}),n+=a}}if(!i)return H8([],b,n,c,m,l);const w=o.length>0?o[o.length-1]+1:0,E=u8(g,e,t,w);if(0===E.length)return null;const A=n-1,x=Y6([],n=>{for(const r of E){const a=r.value;let i=a.offset,o=r.start;const l=a.size;if(a.offset<e){o+=Math.floor((e-a.offset+c)/(l+c));const t=o-r.start;i+=t*l+t*c}o<w&&(i+=(w-o)*l,o=w);const s=Math.min(r.end,A);for(let e=o;e<=s&&!(i>=t);e++)n.push({data:null==u?void 0:u[e],index:e,offset:i,size:l}),i+=l+c}}),C=F8(s,N8),k=F8(s,j8);if(x.length>0&&(C>0||k>0)){const e=x[0],t=x[x.length-1];if(C>0&&e.index>w){const t=Math.min(C,e.index-w),n=[];let r=e.offset;for(let a=e.index-1;a>=e.index-t;a--){const t=null!=(f=null==(d=H7(y,a,a)[0])?void 0:d.value)?f:e.size;r-=t+c,n.unshift({data:null==u?void 0:u[a],index:a,offset:r,size:t})}x.unshift(...n)}if(k>0&&t.index<A){const e=Math.min(k,A-t.index);let n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=H7(y,r,r)[0])?void 0:h.value)?p:t.size;x.push({data:null==u?void 0:u[r],index:r,offset:n,size:e}),n+=e+c}}}return H8(x,b,n,c,m,l)}),o7(e=>null!==e),i7()),R8);t7(s7(e,o7(Q6),l7(e=>null==e?void 0:e.length)),a),t7(s7(_,l7(e=>e.topListHeight)),d),t7(d,l),t7(s7(_,l7(e=>[e.top,e.bottom])),o),t7(s7(_,l7(e=>e.items)),g);const b=g7(s7(_,o7(({items:e})=>e.length>0),h7(a,e),o7(([{items:e},t])=>e[e.length-1].originalIndex===t-1),l7(([,e,t])=>[e-1,t]),i7($7),l7(([e])=>e))),w=g7(s7(_,f7(200),o7(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),l7(({items:e})=>e[0].index),i7())),E=g7(s7(_,o7(({items:e})=>e.length>0),l7(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),i7(J7)));return{endReached:b,initialItemCount:v,itemsRendered:g,listState:_,minOverscanItemCount:y,rangeChanged:E,startReached:w,topItemsIndexes:m,...f}},Z6(g8,_8,P8,k8,A8,I8,b8,e8),{singleton:!0}),V8=y7(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:a}])=>{const i=v7(),o=m7(s7(b7(n,e,r,t,a),l7(([e,t,n,r,a])=>e+t+n+r+a.offsetBottom+a.bottom)),0);return t7(w7(o),i),{totalListHeight:o,totalListHeightChanged:i}},Z6(I7,U8),{singleton:!0}),W8=y7(([{viewportHeight:e},{totalListHeight:t}])=>{const n=p7(!1);return{alignToBottom:n,paddingTopAddition:m7(s7(b7(n,e,t),o7(([e])=>e),l7(([,e,t])=>Math.max(0,e-t)),f7(0),i7()),0)}},Z6(I7,V8),{singleton:!0}),Q8=y7(()=>({context:p7(null)})),G8=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...a},viewportBottom:i,viewportTop:o})=>t<o?{...a,align:null!=n?n:"start",behavior:r}:e>i?{...a,align:null!=n?n:"end",behavior:r}:null,Y8=y7(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:a,headerHeight:i,scrollingInProgress:o,scrollTop:l,viewportHeight:c},{scrollToIndex:s}])=>{const u=v7();return t7(s7(u,h7(t,c,n,i,a,r,l),h7(e),l7(([[e,t,n,r,a,i,l,c],s])=>{const{align:u,behavior:d,calculateViewLocation:f=G8,done:h,...p}=e,m=s8(e,t,r-1),v=l8(m,t.offsetTree,s)+a+i,g=f({itemBottom:v+L7(t.sizeTree,m)[1],itemTop:v,locationParams:{align:u,behavior:d,...p},viewportBottom:c+n-l,viewportTop:c+i});return g?h&&n7(s7(o,o7(e=>!e),d7(e7(o)?1:2)),h):h&&h(),g}),o7(e=>null!==e)),s),{scrollIntoView:u}},Z6(g8,I7,A8,U8,C7),{singleton:!0});function K8(e){return!!e&&("smooth"===e?"smooth":"auto")}const Z8=y7(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:a,isAtBottom:i},{scrollToIndex:o},{scrolledToInitialItem:l},{didMount:c,propsReady:s},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:h}])=>{const p=p7(!1),m=v7();let v=null;function g(e){J6(o,{align:"end",behavior:e,index:"LAST"})}function y(e){const t=n7(a,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!v&&(e7(u)("scrolling to bottom due to increased size",{},A7.DEBUG),g("auto"))});setTimeout(t,100)}X6(s7(b7(s7(w7(t),d7(1)),c),h7(w7(p),i,l,d),l7(([[e,t],n,r,a,i])=>{let o=t&&a,l="auto";return o&&(l=((e,t)=>"function"==typeof e?K8(e(t)):t&&K8(e))(n,r||i),o=o&&!!l),{followOutputBehavior:l,shouldFollow:o,totalCount:e}}),o7(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{v&&(v(),v=null),e7(n)?requestAnimationFrame(()=>{e7(u)("following output to ",{totalCount:r},A7.DEBUG),g(t)}):v=n7(e,()=>{e7(u)("following output to ",{totalCount:r},A7.DEBUG),g(t),v=null})}),X6(s7(b7(w7(p),t,s),o7(([e,,t])=>e&&t),u7(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),o7(({refreshed:e})=>e),h7(p,t)),([,e])=>{e7(l)&&y(!1!==e)}),X6(m,()=>{y(!1!==e7(p))}),X6(b7(w7(p),a),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const _=p7(null),b=v7();return t7(E7(s7(w7(r),l7(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),s7(w7(t))),b),X6(s7(b7(s7(b,d7(1)),c),h7(w7(_),l,d,f),l7(([[e,t],n,r,a,i])=>t&&r&&(null==n?void 0:n({context:i,totalCount:e,scrollingInProgress:a}))),o7(e=>!!e),f7(0)),t=>{v&&(v(),v=null),e7(n)?requestAnimationFrame(()=>{e7(u)("scrolling into view",{}),J6(h,t)}):v=n7(e,()=>{e7(u)("scrolling into view",{}),J6(h,t),v=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:_}},Z6(g8,I8,A8,k8,b8,C7,I7,Q8,Y8)),X8=y7(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:a},{initialItemCount:i,listState:o},{didMount:l}])=>(t7(s7(l,h7(i),o7(([,e])=>0!==e),h7(a,r,t,n,e),l7(([[,e],t,n,r,a,i=[]])=>B8(e,t,n,r,a,i))),o),{}),Z6(g8,k8,U8,b8),{singleton:!0}),J8=y7(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=p7(0);return X6(s7(e,h7(r),o7(([,e])=>0!==e),l7(([,e])=>({top:e}))),e=>{n7(s7(n,d7(1),o7(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{J6(t,e)})})}),{initialScrollTop:r}},Z6(b8,I7,U8),{singleton:!0}),$8=y7(([{scrollVelocity:e}])=>{const t=p7(!1),n=v7(),r=p7(!1);return t7(s7(e,h7(r,t,n),o7(([e,t])=>!!t),l7(([e,t,n,r])=>{const{enter:a,exit:i}=t;if(n){if(i(e,r))return!1}else if(a(e,r))return!0;return n}),i7()),t),X6(s7(b7(t,e,n),h7(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Z6(I8),{singleton:!0}),e9=y7(([{scrollContainerState:e,scrollTo:t}])=>{const n=v7(),r=v7(),a=v7(),i=p7(!1),o=p7(void 0);return t7(s7(b7(n,r),l7(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),t7(s7(t,h7(r),l7(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),a),{customScrollParent:o,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:a,windowViewportRect:r}},Z6(I7)),t9=y7(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:a},{didMount:i},{useWindowScroll:o,windowScrollContainerState:l,windowViewportRect:c}])=>{const s=v7(),u=p7(void 0),d=p7(null),f=p7(null);return t7(l,d),t7(c,f),X6(s7(s,h7(t,r,o,d,f,n)),([e,t,n,r,a,i,o])=>{const l=function(e){return q7(e).map(({k:e,v:t},n,r)=>{const a=r[n+1];return{endIndex:a?a.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==a&&null!==i&&(n=a.scrollTop-i.offsetTop),e({ranges:l,scrollTop:n-=o})}),t7(s7(u,o7(Q6),l7(n9)),a),t7(s7(i,h7(u),o7(([,e])=>void 0!==e),i7(),l7(([,e])=>e.ranges)),e),{getState:s,restoreStateFrom:u}},Z6(g8,I7,k8,b8,e9));function n9(e){return{align:"start",index:0,offset:e.scrollTop}}const r9=y7(([{topItemsIndexes:e}])=>{const t=p7(0);return t7(s7(t,o7(e=>e>=0),l7(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Z6(U8));function a9(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const i9=a9(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),o9=y7(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:a,isScrolling:i,lastJumpDueToItemResize:o,scrollDirection:l},{listState:c},{beforeUnshiftWith:s,gap:u,shiftWithOffset:d,sizes:f},{log:h},{recalcInProgress:p}])=>{const m=g7(s7(c,h7(o),u7(([,e,t,n],[{bottom:r,items:a,offsetBottom:i,totalCount:o},l])=>{const c=r+i;let s=0;return t===o&&e.length>0&&a.length>0&&(0===a[0].originalIndex&&0===e[0].originalIndex||(s=c-n,0!==s&&(s+=l))),[s,a,o,c]},[0,[],0,0]),o7(([e])=>0!==e),h7(r,l,n,a,h,p),o7(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===z8),l7(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},A7.DEBUG),e))));function v(n){n>0?(J6(t,{behavior:"auto",top:-n}),J6(e,0)):(J6(e,0),J6(t,{behavior:"auto",top:-n}))}return X6(s7(m,h7(e,i)),([t,n,r])=>{r&&i9()?J6(e,n-t):v(-t)}),X6(s7(b7(m7(i,!1),e,p),o7(([e,t,n])=>!e&&!n&&0!==t),l7(([e,t])=>t),f7(1)),v),t7(s7(d,l7(e=>({top:-e}))),t),X6(s7(s,h7(f,u),l7(([e,{groupIndices:t,lastSize:n,sizeTree:r},a])=>{function i(e){return e*(n+a)}if(0===t.length)return i(e);{let n=0;const a=D7(r,0);let o=0,l=0;for(;o<e;){o++,n+=a;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;o+r>e&&(n-=a,r=e-o+1),o+=r,n+=i(r),l++}return n}})),n=>{J6(e,n),requestAnimationFrame(()=>{J6(t,{top:n}),requestAnimationFrame(()=>{J6(e,0),J6(p,!1)})})}),{deviation:e}},Z6(I7,I8,U8,g8,C7,e8)),l9=y7(([e,t,n,r,a,i,o,l,c,s,u])=>({...e,...t,...n,...r,...a,...i,...o,...l,...c,...s,...u}),Z6(P8,X8,b8,$8,V8,J8,W8,e9,Y8,C7,Q8)),c9=y7(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:a,gap:i,groupIndices:o,heightEstimates:l,itemSize:c,sizeRanges:s,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:v},g,y,_,b,{scrollToIndex:w},E,{topItemCount:A},{groupCounts:x},C])=>{const{listState:k,minOverscanItemCount:M,topItemsIndexes:z,rangeChanged:S,...O}=b;return t7(S,C.scrollSeekRangeChanged),t7(s7(C.windowViewportRect,l7(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:a,gap:i,groupCounts:x,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:v,sizeRanges:s,topItemCount:A,topItemsIndexes:z,totalCount:f,..._,groupIndices:o,itemSize:c,listState:k,minOverscanItemCount:M,scrollToIndex:w,statefulTotalCount:d,trackItemSizes:h,rangeChanged:S,...O,...C,...g,sizes:u,...y}},Z6(g8,k8,I7,t9,Z8,U8,A8,o9,r9,_8,l9));function s9(e,t){const n={},r={};let a=0;const i=e.length;for(;a<i;)r[e[a]]=1,a+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const u9=typeof document<"u"?a.useLayoutEffect:a.useEffect;function d9(t,n,r){const i=Object.keys(n.required||{}),o=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),c=Object.keys(n.events||{}),s=a.createContext({});function u(e,t){e.propsReady&&J6(e.propsReady,!1);for(const r of i){J6(e[n.required[r]],t[r])}for(const r of o)if(r in t){J6(e[n.optional[r]],t[r])}e.propsReady&&J6(e.propsReady,!0)}function d(e){return c.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(a,i){switch(a){case 1:return i?n===i?void 0:(r(),n=i,t=X6(e,i),t):(r(),G6);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=a.forwardRef((f,h)=>{const{children:p,...m}=f,[v]=a.useState(()=>Y6(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:a,singleton:i})=>{if(i&&t.has(a))return t.get(a);const o=e(r.map(e=>n(e)));return i&&t.set(a,o),o};return n(e)}(t),e=>{u(e,m)})),[g]=a.useState(W6(d,v));u9(()=>{for(const e of c)e in m&&X6(g[e],m[e]);return()=>{Object.values(g).map($6)}},[m,g,v]),u9(()=>{u(v,m)}),a.useImperativeHandle(h,F6(function(e){return l.reduce((t,r)=>(t[r]=t=>{J6(e[n.methods[r]],t)},t),{})}(v)));const y=r;return e(s.Provider,{value:v,children:r?e(y,{...s9([...i,...o,...c],m),children:p}):p})});return{Component:f,useEmitter:(e,t)=>{const n=a.useContext(s)[e];u9(()=>X6(n,t),[t,n])},useEmitterValue:a.version.startsWith("18")?e=>{const t=a.useContext(s)[e],n=a.useCallback(e=>X6(t,e),[t]);return a.useSyncExternalStore(n,()=>e7(t),()=>e7(t))}:e=>{const t=a.useContext(s)[e],[n,r]=a.useState(W6(e7,t));return u9(()=>X6(t,e=>{e!==n&&r(F6(e))}),[t,n]),n},usePublisher:e=>{const t=a.useContext(s);return a.useCallback(n=>{J6(t[e],n)},[t,e])}}}const f9=a.createContext(void 0),h9=a.createContext(void 0),p9=typeof document<"u"?a.useLayoutEffect:a.useEffect;function m9(e){return"self"in e}function v9(e,t,n,r=G6,i,o){const l=a.useRef(null),c=a.useRef(null),s=a.useRef(null),u=a.useCallback(n=>{let r,a,i;const l=n.target;if(function(e){return"body"in e}(l)||m9(l)){const e=m9(l)?l:l.defaultView;i=o?e.scrollX:e.scrollY,r=o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,a=o?e.innerWidth:e.innerHeight}else i=o?l.scrollLeft:l.scrollTop,r=o?l.scrollWidth:l.scrollHeight,a=o?l.offsetWidth:l.offsetHeight;const u=()=>{e({scrollHeight:r,scrollTop:Math.max(i,0),viewportHeight:a})};n.suppressFlushSync?u():A.flushSync(u),null!==c.current&&(i===c.current||i<=0||i===r-a)&&(c.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t,o]);return a.useEffect(()=>{const e=i||l.current;return r(i||l.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",u)}},[l,u,n,r,i]),{scrollByCallback:function(e){o&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(o?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const a="smooth"===n.behavior;let i,u,d;m9(r)?(u=Math.max(r8(r.document.documentElement,o?"width":"height"),o?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),i=o?r.innerWidth:r.innerHeight,d=o?window.scrollX:window.scrollY):(u=r[o?"scrollWidth":"scrollHeight"],i=r8(r,o?"width":"height"),d=r[o?"scrollLeft":"scrollTop"]);const f=u-i;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),M8(i,u)||n.top===d)return e({scrollHeight:u,scrollTop:d,viewportHeight:i}),void(a&&t(!0));a?(c.current=n.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,c.current=null,t(!0)},1e3)):c.current=null,o&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const g9="-webkit-sticky",y9="sticky",_9=a9(()=>{if(typeof document>"u")return y9;const e=document.createElement("div");return e.style.position=g9,e.style.position===g9?g9:y9});function b9(e){return e}const w9=y7(()=>{const e=p7(e=>`Item ${e}`),t=p7(e=>`Group ${e}`),n=p7({}),r=p7(b9),a=p7("div"),i=p7(G6),o=(e,t=null)=>m7(s7(n,l7(t=>t[e]),i7()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:a,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),E9=y7(([e,t])=>({...e,...t}),Z6(c9,w9)),A9=({height:t})=>e("div",{style:{height:t}}),x9={overflowAnchor:"none",position:_9(),zIndex:1},C9={overflowAnchor:"none"},k9={...C9,display:"inline-block",height:"100%"},M9=a.memo(function({showTopList:t=!1}){const n=V9("listState"),r=W9("sizeRanges"),i=V9("useWindowScroll"),o=V9("customScrollParent"),l=W9("windowScrollContainerState"),c=W9("scrollContainerState"),s=o||i?l:c,u=V9("itemContent"),d=V9("context"),f=V9("groupContent"),h=V9("trackItemSizes"),p=V9("itemSize"),v=V9("log"),g=W9("gap"),y=V9("horizontalDirection"),{callbackRef:_}=z7(r,p,h,t?G6:s,v,g,o,y,V9("skipAnimationFrameInResizeObserver")),[b,w]=a.useState(0);U9("deviation",e=>{b!==e&&w(e)});const E=V9("EmptyPlaceholder"),A=V9("ScrollSeekPlaceholder")||A9,x=V9("ListComponent"),C=V9("ItemComponent"),k=V9("GroupComponent"),M=V9("computeItemKey"),z=V9("isSeeking"),S=V9("groupIndices").length>0,O=V9("alignToBottom"),I=V9("initialItemFinalLocationReached"),N=t?{}:{boxSizing:"border-box",...y?{display:"inline-block",height:"100%",marginLeft:0!==b?b:O?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==b?b:O?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...I?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...N9(E,d)}):e(x,{...N9(x,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:_,style:N,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=M(t+n.firstItemIndex,e.data,d);return z?m(A,{...N9(A,d),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?m(k,{...N9(k,d),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:x9},f(e.index,d)):m(C,{...N9(C,d),...j9(C,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:y?k9:C9},S?u(e.index,e.groupIndex,e.data,d):u(e.index,e.data,d))})})}),z9={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},S9={outline:"none",overflowX:"auto",position:"relative"},O9=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),I9={position:_9(),top:0,width:"100%",zIndex:1};function N9(e,t){if("string"!=typeof e)return{context:t}}function j9(e,t){return{item:"string"==typeof e?void 0:t}}const T9=a.memo(function(){const t=V9("HeaderComponent"),n=W9("headerHeight"),r=V9("HeaderFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,V9("skipAnimationFrameInResizeObserver")),o=V9("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),D9=a.memo(function(){const t=V9("FooterComponent"),n=W9("footerHeight"),r=V9("HeaderFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,V9("skipAnimationFrameInResizeObserver")),o=V9("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null});function L9({useEmitter:t,useEmitterValue:n,usePublisher:r}){return a.memo(function({children:a,style:i,context:o,...l}){const c=r("scrollContainerState"),s=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:m}=v9(c,u,s,d,void 0,f);return t("scrollTo",m),t("scrollBy",h),e(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?S9:z9,...i},tabIndex:0,...l,...N9(s,o),children:a})})}function P9({useEmitter:t,useEmitterValue:n,usePublisher:r}){return a.memo(function({children:i,style:o,context:l,...c}){const s=r("windowScrollContainerState"),u=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),m=a.useRef(null),v=n("scrollerRef"),{scrollByCallback:g,scrollerRef:y,scrollToCallback:_}=v9(s,d,u,v,p);return p9(()=>{var e;return y.current=p||(null==(e=m.current)?void 0:e.ownerDocument.defaultView),()=>{y.current=null}},[y,p]),t("windowScrollTo",_),t("scrollBy",g),e(u,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...0!==f?{height:f+h}:{}},...c,...N9(u,l),children:i})})}const R9=({children:t})=>{const n=a.useContext(f9),r=W9("viewportHeight"),i=W9("fixedItemHeight"),o=V9("alignToBottom"),l=V9("horizontalDirection"),c=k7(a.useMemo(()=>V6(r,e=>r8(e,l?"width":"height")),[r,l]),!0,V9("skipAnimationFrameInResizeObserver"));return a.useEffect(()=>{n&&(r(n.viewportHeight),i(n.itemHeight))},[n,r,i]),e("div",{"data-viewport-type":"element",ref:c,style:O9(o),children:t})},H9=({children:t})=>{const n=a.useContext(f9),r=W9("windowViewportRect"),i=W9("fixedItemHeight"),o=V9("customScrollParent"),l=O7(r,o,V9("skipAnimationFrameInResizeObserver")),c=V9("alignToBottom");return a.useEffect(()=>{n&&(i(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,i]),e("div",{"data-viewport-type":"window",ref:l,style:O9(c),children:t})},B9=({children:t})=>{const n=V9("TopItemListComponent")||"div",r=V9("headerHeight"),a={...I9,marginTop:`${r}px`},i=V9("context");return e(n,{style:a,...N9(n,i),children:t})},q9=a.memo(function(t){const r=V9("useWindowScroll"),a=V9("topItemsIndexes").length>0,i=V9("customScrollParent"),o=V9("context");return n(i||r?G9:Q9,{...t,context:o,children:[a&&e(B9,{children:e(M9,{showTopList:!0})}),n(i||r?H9:R9,{children:[e(T9,{}),e(M9,{}),e(D9,{})]})]})}),{Component:F9,useEmitter:U9,useEmitterValue:V9,usePublisher:W9}=d9(E9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},q9),Q9=L9({useEmitter:U9,useEmitterValue:V9,usePublisher:W9}),G9=P9({useEmitter:U9,useEmitterValue:V9,usePublisher:W9}),Y9=F9,K9=y7(()=>{const e=p7(e=>n("td",{children:["Item $",e]})),t=p7(null),r=p7(e=>n("td",{colSpan:1e3,children:["Group ",e]})),a=p7(null),i=p7(null),o=p7({}),l=p7(b9),c=p7(G6),s=(e,t=null)=>m7(s7(o,l7(t=>t[e]),i7()),t);return{components:o,computeItemKey:l,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FillerRow:s("FillerRow"),fixedFooterContent:i,fixedHeaderContent:a,itemContent:e,groupContent:r,ScrollerComponent:s("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TableBodyComponent:s("TableBody","tbody"),TableComponent:s("Table","table"),TableFooterComponent:s("TableFoot","tfoot"),TableHeadComponent:s("TableHead","thead"),TableRowComponent:s("TableRow","tr"),GroupComponent:s("Group","tr")}});Z6(c9,K9),_9();const Z9={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},X9={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:J9,floor:$9,max:eee,min:tee,round:nee}=Math;function ree(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function aee(e,t){return e&&e.width===t.width&&e.height===t.height}function iee(e,t){return e&&e.column===t.column&&e.row===t.row}const oee=y7(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:a,headerHeight:i,scrollBy:o,scrollContainerState:l,scrollTo:c,scrollTop:s,smoothScrollTargetReached:u,viewportHeight:d},f,h,{didMount:p,propsReady:m},{customScrollParent:v,useWindowScroll:g,windowScrollContainerState:y,windowScrollTo:_,windowViewportRect:b},w])=>{const E=p7(0),A=p7(0),x=p7(Z9),C=p7({height:0,width:0}),k=p7({height:0,width:0}),M=v7(),z=v7(),S=p7(0),O=p7(null),I=p7({column:0,row:0}),N=v7(),j=v7(),T=p7(!1),D=p7(0),L=p7(!0),P=p7(!1),R=p7(!1);X6(s7(p,h7(D),o7(([e,t])=>!!t)),()=>{J6(L,!1)}),X6(s7(b7(p,L,k,C,D,P),o7(([e,t,n,r,,a])=>e&&!t&&0!==n.height&&0!==r.height&&!a)),([,,,,e])=>{J6(P,!0),x8(1,()=>{J6(M,e)}),n7(s7(s),()=>{J6(t,[0,0]),J6(L,!0)})}),t7(s7(j,o7(e=>null!=e&&e.scrollTop>0),c7(0)),A),X6(s7(p,h7(j),o7(([,e])=>null!=e)),([,e])=>{e&&(J6(C,e.viewport),J6(k,e.item),J6(I,e.gap),e.scrollTop>0&&(J6(T,!0),n7(s7(s,d7(1)),e=>{J6(T,!1)}),J6(c,{top:e.scrollTop})))}),t7(s7(C,l7(({height:e})=>e)),d),t7(s7(b7(w7(C,aee),w7(k,aee),w7(I,(e,t)=>e&&e.column===t.column&&e.row===t.row),w7(s)),l7(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),N),t7(s7(b7(w7(E),r,w7(I,iee),w7(k,aee),w7(C,aee),w7(O),w7(A),w7(T),w7(L),w7(D)),o7(([,,,,,,,e])=>!e),l7(([e,[t,n],r,a,i,o,l,,c,s])=>{const{column:u,row:d}=r,{height:f,width:h}=a,{width:p}=i;if(0===l&&(0===e||0===p))return Z9;if(0===h){const t=C8(s,e);return function(e){return{...X9,items:e}}(ree(t,t+Math.max(l-1,0),o))}const m=lee(p,h,u);let v,g;c?0===t&&0===n&&l>0?(v=0,g=l-1):(v=m*$9((t+d)/(f+d)),g=m*J9((n+d)/(f+d))-1,g=tee(e-1,eee(g,m-1)),v=tee(g,eee(0,v))):(v=0,g=-1);const y=ree(v,g,o),{bottom:_,top:b}=cee(i,r,a,y),w=J9(e/m);return{bottom:_,itemHeight:f,items:y,itemWidth:h,offsetBottom:w*f+(w-1)*d-_,offsetTop:b,top:b}})),x),t7(s7(O,o7(e=>null!==e),l7(e=>e.length)),E),t7(s7(b7(C,k,x,I),o7(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),l7(([e,t,{items:n},r])=>{const{bottom:a,top:i}=cee(e,r,t,n);return[i,a]}),i7($7)),t);const H=p7(!1);t7(s7(s,h7(H),l7(([e,t])=>t||0!==e)),H);const B=g7(s7(b7(x,E),o7(([{items:e}])=>e.length>0),h7(H),o7(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),l7(([[,e]])=>e-1),i7())),q=g7(s7(w7(x),o7(({items:e})=>e.length>0&&0===e[0].index),c7(0),i7())),F=g7(s7(w7(x),h7(T),o7(([{items:e},t])=>e.length>0&&!t),l7(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),i7(J7),f7(0)));t7(F,h.scrollSeekRangeChanged),t7(s7(M,h7(C,k,E,I),l7(([e,t,n,r,a])=>{const i=E8(e),{align:o,behavior:l,offset:c}=i;let s=i.index;"LAST"===s&&(s=r-1),s=eee(0,s,tee(r-1,s));let u=see(t,a,n,s);return"end"===o?u=nee(u-t.height+n.height):"center"===o&&(u=nee(u-t.height/2+n.height/2)),c&&(u+=c),{behavior:l,top:u}})),c);const U=m7(s7(x,l7(e=>e.offsetBottom+e.bottom)),0);return t7(s7(b,l7(e=>({height:e.visibleHeight,width:e.visibleWidth}))),C),{customScrollParent:v,data:O,deviation:S,footerHeight:a,gap:I,headerHeight:i,increaseViewportBy:e,initialItemCount:A,itemDimensions:k,overscan:n,restoreStateFrom:j,scrollBy:o,scrollContainerState:l,scrollHeight:z,scrollTo:c,scrollToIndex:M,scrollTop:s,smoothScrollTargetReached:u,totalCount:E,useWindowScroll:g,viewportDimensions:C,windowScrollContainerState:y,windowScrollTo:_,windowViewportRect:b,...h,gridState:x,horizontalDirection:R,initialTopMostItemIndex:D,totalListHeight:U,...f,endReached:B,propsReady:m,rangeChanged:F,startReached:q,stateChanged:N,stateRestoreInProgress:T,...w}},Z6(P8,I7,I8,$8,b8,e9,C7));function lee(e,t,n){return eee(1,$9((e+n)/($9(t)+n)))}function cee(e,t,n,r){const{height:a}=n;if(void 0===a||0===r.length)return{bottom:0,top:0};const i=see(e,t,n,r[0].index);return{bottom:see(e,t,n,r[r.length-1].index)+a,top:i}}function see(e,t,n,r){const a=lee(e.width,n.width,t.column),i=$9(r/a),o=i*n.height+eee(0,i-1)*t.row;return o>0?o+t.row:o}const uee=y7(()=>{const e=p7(e=>`Item ${e}`),t=p7({}),n=p7(null),r=p7("virtuoso-grid-item"),a=p7("virtuoso-grid-list"),i=p7(b9),o=p7("div"),l=p7(G6),c=(e,n=null)=>m7(s7(t,l7(t=>t[e]),i7()),n),s=p7(!1),u=p7(!1);return t7(w7(u),s),{components:t,computeItemKey:i,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:o,itemClassName:r,ItemComponent:c("Item","div"),itemContent:e,listClassName:a,ListComponent:c("List","div"),readyStateChanged:s,reportReadyState:u,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),dee=y7(([e,t])=>({...e,...t}),Z6(oee,uee)),fee=a.memo(function(){const t=_ee("gridState"),n=_ee("listClassName"),r=_ee("itemClassName"),i=_ee("itemContent"),o=_ee("computeItemKey"),l=_ee("isSeeking"),c=bee("scrollHeight"),s=_ee("ItemComponent"),u=_ee("ListComponent"),d=_ee("ScrollSeekPlaceholder"),f=_ee("context"),h=bee("itemDimensions"),p=bee("gap"),v=_ee("log"),g=_ee("stateRestoreInProgress"),y=bee("reportReadyState"),_=k7(a.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;c(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:Aee("column-gap",getComputedStyle(e).columnGap,v),row:Aee("row-gap",getComputedStyle(e).rowGap,v)})},[c,h,p,v]),!0,!1);return p9(()=>{t.itemHeight>0&&t.itemWidth>0&&y(!0)},[t]),g?null:e(u,{className:n,ref:_,...N9(u,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const a=o(n.index,n.data,f);return l?e(d,{...N9(d,f),height:t.itemHeight,index:n.index,width:t.itemWidth},a):m(s,{...N9(s,f),className:r,"data-index":n.index,key:a},i(n.index,n.data,f))})})}),hee=a.memo(function(){const t=_ee("HeaderComponent"),n=bee("headerHeight"),r=_ee("headerFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,!1),o=_ee("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),pee=a.memo(function(){const t=_ee("FooterComponent"),n=bee("footerHeight"),r=_ee("headerFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,!1),o=_ee("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),mee=({children:t})=>{const n=a.useContext(h9),r=bee("itemDimensions"),i=bee("viewportDimensions"),o=k7(a.useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return a.useEffect(()=>{n&&(i({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,i,r]),e("div",{ref:o,style:O9(!1),children:t})},vee=({children:t})=>{const n=a.useContext(h9),r=bee("windowViewportRect"),i=bee("itemDimensions"),o=_ee("customScrollParent"),l=O7(r,o,!1);return a.useEffect(()=>{n&&(i({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,i]),e("div",{ref:l,style:O9(!1),children:t})},gee=a.memo(function({...t}){const r=_ee("useWindowScroll"),a=_ee("customScrollParent"),i=a||r?Eee:wee,o=a||r?vee:mee,l=_ee("context");return e(i,{...t,...N9(i,l),children:n(o,{children:[e(hee,{}),e(fee,{}),e(pee,{})]})})}),{useEmitter:yee,useEmitterValue:_ee,usePublisher:bee}=d9(dee,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},gee),wee=L9({useEmitter:yee,useEmitterValue:_ee,usePublisher:bee}),Eee=P9({useEmitter:yee,useEmitterValue:_ee,usePublisher:bee});function Aee(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,A7.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const xee=({optionsList:r=[],onSelectVariable:a,dropdownPosition:i,position:o="relative",width:l,height:c="160px",zIndex:s=9999})=>{const u={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":u[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:T("ff-variable-dropdown",o),style:i?{top:i.top+30,left:i.left-30,width:l,height:c,zIndex:s}:{width:l,height:c,zIndex:s},children:hF(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(cF,{as:"span",fontSize:12,children:"No Option"})}):e(Y9,{totalCount:r.length,itemContent:i=>{const o=r[i];return o?e("div",{className:"ff-variable-data",onMouseDown:()=>a(o),children:l.endsWith("px")?n(t,{children:[e(pF,{title:xF(f(o),h(l),"pixel")?f(o):"",style:{width:`${h(l)}px`},children:e(cF,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(o)})}),e(lF,{name:d(o),height:24,width:24,hoverEffect:!0})]}):e(q6,{option:o})},`${o.id}-${i}`):null},style:{height:c,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},Cee=({data:r=[],width:a,height:i,lineChartWidth:o,yAxisLabel:c,xAxisLabel:u,yAxisValueColor:d,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:m,fontWeight:v,numberSize:g,chartName:y,shouldCenterSinglePoint:_,xAxisLabelGap:b=16,isLeftOverflow:w=!1})=>{const E=40,A=a-80,x=i-80,[C,k]=s(!1),[M,z]=s({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{k(!1),z(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,o=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:a+20+b,gap:b},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:i},children:e(cF,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:i,width:a,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:x,x2:A,y2:x,stroke:f,strokeWidth:1}),e("text",{x:A/2.1,y:x+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:v},children:u}),t.map((t,n)=>e("text",{x:n*(A/(l-1)),y:x+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:o}).map((t,n)=>{const a=n*r/(o-1),i=a/1024;return e("text",{x:-10,y:x-a*x/r,textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:i?.toFixed(1)},`y-${n}`)})]})})})]})}function S(e){if(!isNaN(e))return parseFloat(e);const t=CU,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const O=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),I="date",N=O?"totalMemory":"value",j=e=>{const t=r?.[0]?.data?.length;if(1===t)return _?A/2:A;const n=r[0].data.findIndex(t=>t[I]===e);return-1===n?0:n/(t-1)*A},T=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[N]))),5),D=e=>{if("memory"===y){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[N]))));return x-e*x/(t>1024?t:1024)}return x-e*x/(0===T?1024:T)},L=e=>{if(1===e?.length){const t=e?.[0],n=j(t[I]),r=D(S(t[N]));return`M 0 ${D(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const a=j(n[I]),i=D(S(n[N]));if(0===r)return`M ${a} ${i}`;const o=e[r-1],l=o?j(o[I]):0;return`${t} C ${l+(a-l)/2} ${o?D(S(o[N])):0}, ${a-(a-l)/2} ${i}, ${a} ${i}`},"")},P=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:a+20+b,gap:b},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:i},children:e(cF,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:i,width:a,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>x)return k(!1),void z({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let a={hoverValues:{},dotPositions:{}},i=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-j(t[I]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(i=r[I],a.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(EU),r=e.match(AU);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[N]),a.dotPositions[t]={x:j(r[I]),y:D(S(r[N]))})}),k(!0),z({cursorX:n,hoverValues:a.hoverValues,dotPositions:a.dotPositions,currentXValue:i,tooltip:i?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>z({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:x,strokeWidth:2}),e("line",{x1:0,y1:x,x2:A,y2:x,stroke:f,strokeWidth:1}),e("text",{x:A/2.1,y:x+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:v},children:u}),r.map((r,a)=>{return!1!==r.show?n("g",{children:[e("path",{d:L(r.data),fill:"none",stroke:r.color,strokeWidth:o,opacity:(i=r.data,i.every(e=>0===S(e[N]))?.5:1)}),M.dotPositions[a]&&n(t,{children:[e("line",{x1:M.dotPositions[a].x,y1:0,x2:M.dotPositions[a].x,y2:x,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:M.dotPositions[a].x,cy:M.dotPositions[a].y,r:5,fill:"white",stroke:r.color,strokeWidth:o,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:M.dotPositions[a].y,x2:A,y2:M.dotPositions[a].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},a):null;var i}),(()=>{if(1===P.length){const t=P?.[0];return e("text",{x:_?A/2:A,y:x+15,textAnchor:_?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[I]?String(t[I]):""},String(t[I]))}if(P.length<7)return P.map(t=>e("text",{x:j(t[I]),y:x+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[I]?String(t[I]):""},String(t[I])));{const t=(a-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const a=Math.floor(r*(P?.length-1)/6),i=P[a];return e("text",{x:r*t,y:x+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=i?.[I]?String(i?.[I]):""},String(i?.[I]))})}})(),(()=>{if("memory"===y){const t=Math.max(T,1024);return Array.from({length:6}).map((n,r)=>{const a=r*t/5,i=a/1024;return e("text",{x:-10,y:D(a),textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:i.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*T/5;return e("text",{x:-10,y:D(r),textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),C&&M.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&M.tooltip.left/2>a/1.75?M.tooltip.left-180:M.tooltip.left,top:M.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:M.currentXValue}),Object.entries(M.hoverValues).map(([t,a])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",a]},t))]})]})]})},kee=({onClose:t,top:r="100px",left:a="0px",className:i,description:o="Download and Install the fireflink client to run the script",onClick:c=()=>{},optionZIndex:s=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${i}`,style:{top:r,left:a,zIndex:s},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(cF,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(lF,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(cF,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:o}),e(cF,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"].map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{c("mac_icon"===t?"mac":t)},children:e(lF,{name:t,height:36,width:36})},t))})]})]})},Mee=({legendName:t,height:r,width:a,children:i})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:a},children:[e("legend",{className:"ff_legend_container",children:e(cF,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:i})]})}),zee=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:a="relative",width:i="100%",zIndex:o,truncateTextValue:l=34})=>e("div",{className:T(`ff-variable-dropdown-container ${a}`),style:n?{top:n.top+30,left:n.left-30,width:i,zIndex:o}:{width:i,zIndex:o},children:hF(r)?e("div",{className:"ff-variable-option no-data",children:e(cF,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(pF,{title:xF(n?.name,l,"pixel")?n?.name:"",children:e(cF,{children:AF(n?.name,l,"pixel")})})},n?.id))}),See=i(({label:t="",hashInputValue:r="",setHashInputValue:a,variableList:i=[],placeholder:c="Enter text",onChange:u,onPaste:d,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:m="100%",dropdownHeight:v="160px",isHash:g=!1,isOnlyHash:_=!1,dataFiles:b=[],showAddVariableIcon:w=!0,helperText:E="",error:A,autoComplete:x="off",required:C=!1,zIndex:k=9999,truncateTextValue:M=34,formProps:z={},getSelectedVariable:S=()=>{},symbol:O="$",type:I="text",clearIcon:N=!0,inputTitle:j="",onBlur:D,helperTextWidth:L,iconProps:P={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...R},H)=>{const[B,q]=s(!1),[F,U]=s(!1),[V,W]=s(!1),[Q,G]=s(null),[Y,K]=s(0),[Z,X]=s(!1),[J,$]=s([]),ee=o(null),te=o(null),[ne,re]=s("auto"),ae=P?.isShowIcon;l(()=>{const e=te.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;re(e)}});return t.observe(e),()=>{t.disconnect()}},[]),y(H,()=>ee.current),l(()=>{null!==Q&&ee.current&&(ee.current.setSelectionRange(Q,Q),ee.current.focus())},[Q]),l(()=>{g&&q(p.startsWith("#"));const e=b?.find(e=>e.name===p),t=i?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=b.filter(t=>t.name.toLowerCase().includes(e));$(t),q(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),a=p.length>(t?.name.length||0),o=p.length>0&&!r||p.startsWith("#");_?X(!1):r||n||p.includes("$")||p.includes("#")?(X(!1),o&&X(!0)):a&&!p.includes("$")&&X(!0)},[p]);const ie=()=>{ee.current&&K(ee.current.selectionStart||0)},oe=ie,le=ie;l(()=>{ee.current&&K(ee.current.selectionStart||0)},[p]);const ce=e=>{if(ee.current){const{selectionStart:t,selectionEnd:n}=ee.current,r=`${e.name}`;let i;if(i=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,u){u({target:{value:i}},e),S(e.name)}ee.current.value=i,a?.(e),G((t||0)+r.length),q(!1),U(!0)}};const se=function(e,t,n){let r=!1,a="";const i="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:a};const o=e.lastIndexOf(O,t-1),l=e.indexOf(O,t);if(-1!==o&&(_&&"$"===e[o]?r=!1:t===o+1?(r=!0,a=""):(a=e.slice(o+1,-1===l?void 0:l),t>o+1&&(a=e.slice(o+1,t)),r=!0),F&&i&&(r=!1),(/[{}]/.test(a)||0===t)&&(r=!1,a=""),a)){n.some(e=>e.name.toLowerCase().includes(a.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:a}}(p,Y,i),ue=()=>i?.filter(e=>e?.name?.toLowerCase()?.includes(se?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:te,children:[e(pF,{title:j,style:{width:"100%"},children:e(bV,{...R,name:"add_variable",ref:ee,type:I,className:T("ff-variable-input-container",{"ff-variable-input-container--show-icon":ae}),value:p,onChange:u,onPaste:()=>{X(!0)},variant:"primary",label:t,placeholder:c,onClick:oe,onKeyUp:le,onFocus:()=>W(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||W(!1)})(e),D?.(e)},autoComplete:x,helperText:E,error:A,required:C,helperTextWidth:L,...z})}),!hF(p)&&Z&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(cF,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!hF(p)&&!_&&e("div",{className:T("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":ae}),children:N&&e(pF,{title:"Cancel",style:{zIndex:99999},children:e(lF,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),ae&&e("div",{className:"ff-info-icon-container",children:e(pF,{title:ae&&!P?.isIconDisable?P?.iconToolTipTitle:"",children:e(lF,{name:P?.iconName||"",hoverEffect:!1,height:16,width:16,color:P?.iconColor||"var(--text-area-default-color)",onClick:e=>{P?.onIconClick&&P?.onIconClick(e)},disabled:P?.isIconDisable,cursorType:"pointer"})})})]}),se?.showDropdown&&V&&e(xee,{position:"absolute",zIndex:k,truncateTextValue:M,width:ne,height:hF(ue())?"auto":v,optionsList:ue(),onSelectVariable:ce}),B&&g&&V&&e(zee,{position:"relative",zIndex:k,truncateTextValue:M,width:ne,filteredOptions:J,onSelectVariable:ce})]})}),Oee=({isOpen:t,variableTypesList:r=[],onClose:a,onNameChange:i,onValueChange:o,variableName:c,variableValue:u,onVariableTypeChange:d,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:m,mode:v="create",disabled:g,dataFiles:y=[],truncateTextValue:_=34,isEnterKeySubmit:b=!1})=>{const[w,E]=s(!1),[A,x]=s(""),[C,k]=s(),[M,z]=s(!1),[S,O]=s(!1),[I,N]=s({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===v&&N({name:c,value:u,isChecked:h})},[]);const j=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":qF.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function T(e){const t=!!e,n=qF.test(e),r=ZU.test(e),a=e.length>=3&&e.length<=25;return t&&n&&r&&a}l(()=>{const e=j(c);E(!!e),x(e)},[c]),l(()=>{if("edit"!==v)return;const{name:e,value:t,isChecked:n}=I;O(c!==e||u!==t||h!==n)},[v,c,u,h,I]);const D=()=>{!M&&T(c)&&(z(!0),m())};l(()=>{if(!b)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(c)||M||"edit"===v&&!S||D()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[b,c,u,h,M,v,S,f]);return e(vF,{zIndex:1350,onClose:a,isOpen:t,title:"create"===v?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(sF,{onClick:a,label:"Cancel",variant:"tertiary"}),e(sF,{variant:"primary",label:"create"===v?"Create":"Update",type:"submit",onClick:D,disabled:!T(c)||M||"edit"===v&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(bV,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:c||"",onChange:e=>{z(!1),i(e.target.value)},error:w,helperText:A,onBlur:e=>{const t=e.target.value,n=j(t);E(!!n),x(n)}})}),e(AW,{label:"Variable Type",required:!0,onChange:e=>{d(e),z(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===v}),e(See,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:_,dataFiles:y,dropdownWidth:"100%",setHashInputValue:k,hashInputValue:C||{},value:u||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;o(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(bF,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(pF,{title:"Once the value is hidden, it cannot be undone",children:e(lF,{name:"info",width:12,height:12})})]})]})})},Iee=({highlightText:t="",tableMeta:r=[],tableData:a=[],accordionType:i="row",noDataContent:o,height:l="100%",withFixedHeader:c=!1,headerType:u,TableAccordionStateIconWidth:d=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=s(-1),m=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},v=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===i&&0===r?"":e(cF,{children:m(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:T("ff-accordion-table-container",{"ff-accordion-fixed-header-table":c}),children:[e("table",{cellSpacing:0,className:T("ff-accordion-table",{"ff-accordion-fixed-header":c}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:T("ff-table-header",u&&`ff-accordion-table--${u}-bg`),children:e("div",{children:e(cF,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===i&&a.map((n,r)=>e(yF,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:v(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:d,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===i&&a.map((a,i)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(pF,{title:a.disable?a?.disableInfoMessage:"string"==typeof a.title&&xF(a.title,r[0]?.width,"pixel")?a.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${a.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(cF,{children:e(gF,{text:AF(a.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!a.disable&&(e=>{p(e===h?-1:e)})(i)},children:e(lF,{name:h===i?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:d,height:f,hoverEffect:!1})})]})})}),h===i&&e("div",{children:v(a.data)})]},`column-accordion-${i}`)),a.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:o})]})},Nee=({progressPercentage:t,totalMemory:r,usedMemory:a,color:i="var(--brand-color)",trackColor:o="#f0f0f0",height:l=10,label:c,labelFontSize:s=12,labelTextColor:u="var(--ff-card-status-text-color)",showPercentage:d=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const m=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),a=n[2];return"gb"===a?1024*r:"kb"===a?r/1024:r};let v=0,g=c;if(void 0!==r&&void 0!==a){const e=m(a),t=m(r);t>0?(v=e/t*100,g=c||a):(v=0,g="0MB")}else v=t||0;const y=Math.max(0,Math.min(v,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:o,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${y}%`,backgroundColor:i,height:`${l}px`},children:d&&e(cF,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(y)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(cF,{fontSize:s,color:u,children:e(pF,{title:xF(g,10,"count")?g:"",children:AF(g,10,"count")})})})]})},jee=({variant:t="primary",size:n="small",onClick:r,label:a="Choose File",disabled:i=!1,type:l="button",className:c="",style:u={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:m="auto",selectedFile:v={},handleCloseIcon:g,isMandatory:y=!1})=>{const _=o(null),[b,w]=s(0);d(()=>{_.current&&w(_.current.getBoundingClientRect().width-10)},[p]);const E=v?.name||a,A=b?AF(E,b,"pixel"):E,x=!!b&&xF(E,b,"pixel");return e("div",{ref:_,style:{width:p},children:e(pF,{title:x?E:"",children:e(sF,{variant:t,label:A,type:l,onClick:r,buttonWidth:p,buttonHeight:m,isChooseFile:h,size:n,disabled:i,className:c,iconName:f,style:u,iconPosition:"right",selectedFile:v,handleCloseIcon:g,isMandatory:y})})})},Tee=({selected:t="text",handleClick:r,tabList:a})=>{const i=a?.includes("Automation"),o=a?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(pF,{title:i?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(i?"Automation":"Add Automation"),children:e(lF,{name:i?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(pF,{title:o?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(o?"Manual":"Add Manual"),children:e(lF,{name:o?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},Dee=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(pF,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(lF,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),Lee=({onModalClose:t,MediaSrc:r,fileName:i,onDeleteClick:o,mediaType:c,fileId:u,thumbnailMediaSrc:d,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:m=!1,previewOnly:v=!1,iconName:g="video_preview",isDisabled:y=!1})=>{const[_,b]=s(!1),w=a.useRef(null),E=()=>{b(!0),h&&h(u)},A=()=>{t?.(),b(!1)},x=()=>{p&&p(u)};return l(()=>{v&&b(!0)},[v]),n("div",{children:[!v&&(m?e(lF,{name:g,hoverEffect:!0,onClick:E,disabled:y}):e(H6,{mediaSrc:r,mediaType:c,onDownloadClick:x,onDeleteClick:()=>o?.(r),onExpandClick:E,fileName:i,fileId:u,thumbnailMediaSrc:d,isDelete:f})),_&&e(hJ,{isOpen:_,onClose:A,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(pF,{title:"Download File",children:e(lF,{name:"download_file_icon",onClick:x,color:"var(--icons-default-color)",className:"header-icons"})}),e(pF,{title:"Expand",children:e(lF,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(pF,{title:"close",children:e(lF,{name:"close",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===c&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===c&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:w,onCanPlay:()=>{if(w.current){const e=w.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},Pee=({children:t,orientation:r="",navBarIcons:i=[],mobileHeight:o=448,mobileWidth:l=220,UtilityBar:c,tooltip:s={},background:u,navBarPosition:d="bottom"})=>{const f="portrait"===r,h=f?o:l,p=f?l:o,m=c&&"top"===d,v=c&&"bottom"===d,g=c&&"left"===d;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",m?"navbar-top":"",v?"navbar-bottom":""].filter(Boolean).join(" "),children:[m&&e("div",{className:"ff-nav-bar top-nav-bar",children:i.map(({title:t,name:n,className:r,...a},o)=>{const l=s?.[n]??o;return e(pF,{title:s?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${o===i.length-1?"last-icon":""} ${m?"navbar-top":""}`,children:e(lF,{name:n,...a})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:u||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:a.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*o+"px"}})})})}),c&&v&&e("div",{className:"ff-nav-bar",children:i?.map((t,n)=>{const{title:r,...a}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===i.length-1?"last-icon":""}`,children:e(pF,{title:r,children:e(lF,{...a})})},n)})}),c&&g&&e("div",{className:"ff-side-nav-bar",children:i?.map((t,n)=>{const{title:r,...a}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===i.length-1?"last-icon":""}`,children:e(pF,{title:r,placement:"bottom",children:e(lF,{...a})})},n)})})]})},Ree=i(({width:t=300,height:r=40,iconHeight:a=16,iconWidth:i=16,placeholder:l="Enter text",iconName:c="right_arrow_filled_icon",iconPosition:s="left",borderRadius:u=4,autoFocus:d=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:m,onPromptChange:v,onBlur:g,onFocus:y,disableInput:_,isAdditionalIcon:b=!1,additionalIconName:w,additionIconToolTip:E,onAdditionalIconClick:A},x)=>{const C=o(null);zF([{key:"Enter",action:()=>k()}],C);const k=e=>{f&&m?.(f.trim())};return n("div",{className:T("ff-prompt-container",{"icon-left":"left"===s,"icon-right":"left"!==s}),style:{width:`${t}px`,height:`${r}px`,borderRadius:u},ref:C,children:[e(pF,{placement:"top",title:p,children:e(lF,{name:c,className:"ff-prompt-icon",height:a,width:i,onClick:m,color:h,disabled:hF(f)})}),e("input",{ref:x,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:d,onChange:v,onFocus:y,onBlur:g,value:f,readOnly:_}),b&&w&&e(pF,{placement:"top",title:E,children:e(lF,{name:w,className:"ff-prompt-icon additional-icon",height:a,width:i,onClick:A})})]})}),Hee=({content:t,isVisible:n,maxWidth:r=300,onClick:a,isClickable:i=!0,arrowPosition:o="left"})=>e("div",{onClick:a,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:T("ff-chat-msg-box",{visible:n,hidden:!n,pointer:i,default:!i,"chat-arrow-left":"left"===o,"chat-arrow-right":"left"!==o}),children:e("div",{className:T("content",`arrow-${o}`),children:e(cF,{children:t})})}),Bee=({iconName:r,iconPosition:{top:a,left:i,bottom:o,right:l},hoverIconPosition:{top:c,left:u,bottom:d,right:f},modalPosition:{top:h,left:p,bottom:m,right:v},modalWidth:g,modalHeight:y,headerContent:_="Header Content",footerContent:b="Footer Content",iconWidth:w,iconHeight:E,modalHeading:A="Ask Fia",children:C,onClearChat:k})=>{const[M,z]=s(!1),[S,O]=s(!1);return n(t,{children:[n("div",{style:{top:void 0!==a?`${a}px`:void 0,left:void 0!==i?`${i}px`:void 0,bottom:void 0!==o?`${o}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(lF,{className:"ff-dynamic-icon",name:r,onClick:()=>{O(e=>!e),setTimeout(()=>z(e=>!e),10)},height:E,width:w}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==u?`${u}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(lF,{name:"ask_fia_icon",height:32,width:82})})]}),S&&x(e("div",{className:T("ff-dynamic-modal",{open:M}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==m?`${m}px`:void 0,right:void 0!==v?`${v}px`:void 0,position:"fixed",height:y,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[_&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(lF,{height:16,width:16,name:"fia_icon"}),e(cF,{fontWeight:"medium",children:A})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(pF,{title:"Clear chat",placement:"bottom",children:e(lF,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:k})})}),e("span",{className:"action",children:e(pF,{title:"Close",placement:"bottom",children:e(lF,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(z(!1),void setTimeout(()=>O(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:C}),b&&e("div",{className:"ff-dynamic-modal-footer",children:b})]})}),document.body)]})},qee=i(({iconName:r,hoverTitle:a,iconPosition:{top:i,left:c,bottom:u,right:d},hoverIconPosition:{top:f,left:h,bottom:p,right:m},modalPosition:{top:v,left:g,bottom:_,right:b},modalWidth:w,modalHeight:E,headerContent:A="Header Content",footerContent:C="Footer Content",iconWidth:k,iconHeight:M,children:z,onVisibilityChange:S},O)=>{const[I,N]=s(!1),[j,D]=s(!1),L=o(null),P=()=>{L.current&&clearTimeout(L.current),N(!1),L.current=setTimeout(()=>{D(!1),S?.(!1)},300)};return y(O,()=>({closeModal:P})),l(()=>()=>{L.current&&clearTimeout(L.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==c?`${c}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==d?`${d}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(lF,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{L.current&&clearTimeout(L.current),D(e=>!e),S?.(!j),L.current=setTimeout(()=>N(e=>!e),10)},height:M,width:k}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(cF,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:a})})})]}),j&&x(e("div",{className:T("ff-ai-dynamic-modal",{open:I}),style:{top:void 0!==v?`${v}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==_?`${_}px`:void 0,right:void 0!==b?`${b}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[A&&e("div",{className:"ff-ai-dynamic-modal-header",children:A}),e("div",{className:"ff-ai-dynamic-modal-body",children:z}),C&&e("div",{className:"ff-ai-dynamic-modal-footer",children:C})]})}),document.body)]})}),Fee=({variant:t,title:r,tabTitle:a,comment:i,profileShortName:o})=>n("div",{className:"ff-history-card",children:[e("div",{className:T("header",`header--${t}`),children:e(cF,{fontWeight:"semi-bold",children:a})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(cF,{className:T("avatar",`avatar--${t}`),children:o}),e(cF,{children:r})]})}),n("div",{className:"comment-container",children:[e(cF,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(cF,{color:"var(--details-page-value-color)",className:"comment",children:i})]})]})]}),Uee=({onChange:t,disabled:r,checked:a=!1,id:i="toggle",path:o})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${i}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:a}),e("label",{className:T("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${i}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(cF,{className:T("ff--ai-switch-typography",{left:a,right:!a}),as:"div",fontWeight:"bold",fontSize:18,color:a?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:o,alt:"AI image"})]})})})]}),Vee=i(({name:t,height:n=30,width:r=30,path:a="",onClick:i,color:c="var(--brand-color)",hoverEffect:s=!1,className:u="",disabled:d=!1,variant:f="light",isSelected:h=!1,x:p,y:m,tabIndex:v=-1,...g},y)=>{if(!oF[t])return null;const _=o(null);l(()=>{_.current&&(void 0!==p&&_.current.setAttribute("x",String(p)),void 0!==m&&_.current.setAttribute("y",String(m)))},[p,m]);const b={ref:y,onClick:d?void 0:i,style:{height:`${n}px`,width:`${r}px`,cursor:d?"not-allowed":"pointer",opacity:d?.3:1},tabIndex:v,...g};return e("span",{...b,children:e("img",{height:n,width:r,src:a,alt:""})})}),Wee=({id:r=0,serialNumber:a,activeId:i,setActiveId:c,children:u,onIconClick:d,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:m,disabled:v,isEditAccess:g,versionsLength:y,count:_,hiddenActions:b=[]})=>{const[w,E]=s(!1),[A,x]=s(!1),C=o(null),k=Array.isArray(b)?b:b?[b]:[],M=(e,t)=>{e.stopPropagation(),t()};l(()=>{C.current&&(()=>{if(C.current){const e=getComputedStyle(C.current),t=1.2*parseFloat(e.fontSize)*6;C.current.scrollHeight>t&&x(!0)}})()},[]);const z=e=>{e.stopPropagation(),E(!w)};return n("div",{className:`ff-prompt-container-Block ${i===r?"active":"inactive"} `,onClick:()=>{c(r),h()},children:[e(cF,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${a}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(w?"expanded":""),ref:C,children:[u,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:z,className:"read-less-btn",children:e(cF,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),A&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:z,className:"read-more-btn",children:e(cF,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!k.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(y??0)>=3||v;return e(pF,{title:t.title,placement:"bottom",children:e(lF,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),d(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(lF,{disabled:1===_,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>M(e,m)}),f,e(lF,{disabled:_===y,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>M(e,p)})]})]})]})},Qee=i(({type:t="text",variant:r="primary",name:a="",label:i,disabled:o=!1,disableLinkIcon:l=!1,required:c=!1,placeholder:s="Attach Link",value:u,error:d,helperText:f,noBorder:h,className:p="",onChange:m,onBlur:v,onFocus:g,autoComplete:y="off",autoFocus:_=!1,minValue:b=-1/0,maxValue:w=1/0,transparentBackground:E=!1,size:A="small",isLabelRequired:x=!0,onClick:C,onKeyUp:k,isViewMode:M=!1,...z},S)=>{const O=!hF(u);return n("fieldset",{className:T("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":o}),children:[n("div",{className:T("ff-link-input-container",{"ff-link-input-container--float":O,"ff-link-input-container--disabled":!!o}),children:[x&&n("label",{className:T(`ff-link-input-label-container ff-link-input-label-container--${A}`,{"ff-link-input-label-container--danger":!!d}),htmlFor:a,children:[c&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:T(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!u,"ff-link-input-label--disabled":!!o,"ff-link-input-label--danger":!!d}),children:i})]}),e("input",{ref:S,name:a,value:u,type:t,spellCheck:!1,id:a,className:T(`ff-link-input ff-link-input-${r} default-input ff-link-input--${A}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!u,"ff-link-input--disabled":!!o,"ff-link-input--danger":!!d,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!x},`${p}`),placeholder:s,disabled:M||o,onChange:m,onFocus:g,onBlur:v,autoComplete:y,autoFocus:_,min:b,max:w,onClick:C,onKeyUp:k,...z}),e("div",{className:"input-link-icon",children:l||d||!O?e(lF,{name:"link",disabled:!0}):e(pF,{title:"Click here to navigate",children:e("span",{children:e(lF,{name:"link",disabled:!1,onClick:()=>{u&&!d&&window.open(u,"_blank")}})})})})]}),f&&d&&e("span",{className:T("ff-link-input-message",{"ff-link-input-message--danger":!!d}),children:f})]})}),Gee=({labelsList:r=[],height:a=""})=>{const i=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(cF,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!hF(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(pF,{title:r[0],children:e(cF,{as:"div",children:AF(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:a?{height:a}:void 0})}),r.length>1&&e(pF,{title:e(cF,{as:"div",children:i}),children:e(cF,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class Yee extends w{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Kee=({iconName:t="",onButtonClick:r,buttonLabel:a="Label",buttonText:i="To Add Group",disableButton:o=!1,stepCount:l=1,iconWidth:c=120,iconHeight:s=120,addContentLabel:u="step"})=>n("div",{className:"add-content-button "+(o?"disabled":""),children:[!hF(t)&&e("div",{className:"icon-container",children:e(lF,{name:t,width:c,height:s})}),n("div",{className:"typography-label-button",children:[n(cF,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[u+l," :"]}),e(cF,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(fJ,{label:a,onClick:r,iconName:"plus_user_icon",isDisable:o}),e(cF,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:i})]})]}),Zee=({variant:t="default",tabsData:r,activeTabId:a,onTabClick:i,noBorder:o=!1,noPadding:l=!1,titleSize:c="12px"})=>{const[u,d]=s(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:T(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":o,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(lF,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(u?"arrow_left_accordian":""),onClick:()=>{u>0&&d(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*u}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&i(r.id),disabled:r.disabled,className:T(`ff-tab-button--${t}`,{disabled:r.disabled,active:a===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(pF,{title:r.label.length>9?r.label:"",children:e(cF,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:c,lineHeight:"18px",fontWeight:a===r.id?"semi-bold":"regular",color:a===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:T("ff-tab-label",{"ff-tab-label--active":a===r.id})})}),"default"===t&&r.count&&e("span",{className:T("tab-count",{"tab-count--active":a===r.id}),children:r.count})]}),e("div",{className:T("ff-tab-bar",{"ff-tab-bar--active":a===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(lF,{className:"ff-tab-icon ff-tab-icon--next",name:""+(u<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{u<Math.ceil(r.length/4)-1&&d(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===a)?.component})]})},Xee=i(({label:t="Status",iconName:r="update_icon",onClick:a,isDisable:i=!1,variant:o="default",backgroundColor:l=!1,border:c=!1},s)=>{const u={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:i,onClick:a,className:`\n ff-status-indicator\n ff-status-indicator--${o}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${o}-bg`:""}\n ${c?`ff-status-indicator--with-border ff-status-indicator--${o}-border`:""}\n `,ref:s,children:n("div",{className:"ff-status-indicator__content",children:[e(lF,{name:"danger"===o?"close":r,color:u[o]||u.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${o}`}),e(cF,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${o}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),Jee=({rootLabel:t,childrenLabels:r,align:a="center",direction:i="horizontal"})=>{const o=r.length;return n("div","vertical"===i?{className:"ff-os-tree-vertical",style:{"--child-count":o},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${a}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${a}`,style:{"--child-count":o},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},$ee=({handleClose:t,handleResend:r,handleOtp:a,resendTimeout:i=30})=>{const[c,u]=s(Array(6).fill("")),[d,f]=s(i),[h,p]=s(!0),m=o(Array(6).fill(null));l(()=>{h||m.current[0]?.focus()},[h]),l(()=>{let e;return d>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===d&&p(!1),()=>clearInterval(e)},[d]);const v=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),u(n);const r=Math.min(t.length,5);m.current[r]?.focus()};return e(hJ,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(cF,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(lF,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:c.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===c.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...c];r[t]=n,u(r),t<5&&m.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...c];n[t]="",u(n),t>0&&m.current[t-1]?.focus()}})(e,n),onPaste:v,ref:e=>m.current[n]=e,readOnly:!0},n))}),e(sF,{variant:"primary",label:"Submit",onClick:()=>a(c.join("")),disabled:c.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(i),p(!0),u(Array(6).fill("")),r()},children:["Re-send OTP",d>0?` (${d}s)`:""]})]})})},ete=({isOpen:t,onClose:r,isPlaying:a,onTogglePlay:i,mediaType:c,src:u,headerTitle:d,onDownload:f,onExpand:h,showHeader:m=!0,showDownload:v=!0,showExpand:g=!0,width:y="800px",height:_="432px",showControls:b=!0,customStyle:w,overlay:E=!0,children:A,showControlDownload:x=!1,showControlExpand:C=!1})=>{const k=o(null),M=o(null),[z,S]=s(0),[O,I]=s(0),[N]=s(!1),[j,T]=s(!1),[D,L]=s(0);l(()=>{"video"===c&&k.current&&!A&&(a?k.current.play():k.current.pause())},[a,c,A]);const P=p(()=>{if(k.current&&!j){const e=k.current.currentTime/k.current.duration*100;L(e||0),S(k.current.currentTime)}},[j]),R=p(()=>{k.current&&I(k.current.duration)},[]),H=p(()=>{S(0),L(0),i?.()},[i]),B=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),q=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,L(e),S(t)}},[]),F=p(e=>{if(j||!M.current)return;const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[q,j]),U=p(e=>{if(!M.current)return;T(!0);const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[q]),V=p(e=>{if(!j||!M.current||!k.current)return;const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[j,q]),W=p(()=>{T(!1)},[]);return l(()=>{if(j)return document.addEventListener("mousemove",V),document.addEventListener("mouseup",W),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",W)}},[j,V,W]),t?e(qG,{isOpen:t,onClose:r,isMaximized:!1,showHeader:m,overlay:E,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(lF,{width:23,height:23,name:"automatic_locator"}),e(cF,{children:e("span",{className:"ff-header-title",children:d})})]}),icons:e(pF,{title:"Close",children:e(lF,{name:"close",onClick:r})}),width:y,height:_,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[A||("video"===c?e("video",{ref:k,src:u,className:"ff-media-video",onTimeUpdate:P,onLoadedMetadata:R,onEnded:H}):e("img",{src:u,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[v&&e(pF,{title:"Download",children:e(lF,{name:"download_file",color:"white",onClick:f})}),g&&e(pF,{title:N?"Minimize":"Maximize",children:e(lF,{name:N?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===c&&b&&!A&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:i,className:"ff-play-pause-btn",children:e(lF,a?{width:35,height:35,name:"pause_button",color:"white"}:{width:35,height:35,name:"play_button",color:"white"})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:B(z)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:D,onChange:e=>q(parseFloat(e.target.value)),onClick:F,onMouseDown:U,ref:M}),e("span",{className:"ff-total-time",children:B(O)})]}),n("div",{className:"ff-control-icons",children:[x&&e(pF,{title:"Download",children:e(lF,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),C&&e(pF,{title:N?"Minimize":"Maximize",children:e(lF,{name:N?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},tte=({header:r,secondaryHeader:a,primaryCount:i,secondaryCount:o,primaryItems:l,secondaryItems:c,width:s,activeTab:u="primary",activeTabId:d,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:m,tabsData:v,notchPosition:g="top-left"})=>{const y=a&&"secondary"===u?c:l,_=o&&parseInt(o)>0,b=i&&parseInt(i)>0,w=a&&(b||_),{tooltip:E="Download",iconName:A="download_file",disabled:x=!1,onClick:C}=m?.download||{},{tooltip:k="Delete",iconName:M="delete_icon",disabled:z=!1,onClick:S}=m?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[m?.download&&e(pF,{title:E,children:e(lF,{name:A||"",className:"ff-dropdown-icon ff-download-icon",onClick:C,width:18,height:20,disabled:x,hoverEffect:!0})}),m?.delete&&e(pF,{title:k,children:e(lF,{name:M||"",className:"ff-dropdown-icon ff-delete-icon",onClick:S,width:25,height:25,disabled:z,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:s?{minWidth:s}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:a&&v&&d?n(t,{children:[e(tY,{tabsData:v,activeTabId:d,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),w&&O()]}):a&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===u?"active":""),onClick:f,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),i&&e("span",{className:"ff-dropdown-count",children:i})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===u?"active":""),onClick:h,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:a}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),O()]}):a?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===u?"active":""),onClick:f,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),i&&e("span",{className:"ff-dropdown-count",children:i})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===u?"active":""),onClick:h,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:a}),o&&e("span",{className:"ff-dropdown-count",children:o})]})]}):e(cF,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:y?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},nte=(e,t)=>"string"==typeof e?AF(e,t):a.isValidElement(e)?a.cloneElement(e,{},nte(e.props.children,t)):Array.isArray(e)?e.map(e=>nte(e,t)):e,rte=a.memo(({node:t,columnsData:r,gridTemplate:a,select:i,selected:o,onToggleExpand:l,onRowClick:c,onCheckBoxChange:s,isEven:u,isExpanding:d,hideOnDisable:f,scriptLengthTruncate:h=25,onAddConfirm:p,onAddCancel:m,handleEditFieldError:v,addModuleInputWidth:g,addModuleSelectWidth:y,disableEditLabelConfirmIcon:_,selectedNode:b,stickyOffsets:w=[],freezeColumns:E=0})=>{const A=e=>{s?.(e,t)},x=e=>{e.stopPropagation(),d||l()},C=`virtual-row ${u?"even":"odd"} ${o.includes(t.key)||b===t.key?"hover-selected":""}`;return e("div",{className:C,style:{display:"grid",gridTemplateColumns:a,height:"32px"},onClick:e=>c?.(e,t),children:r.map((r,a)=>{const l=a<E,c=l?w[a]:void 0;return e("div",{className:"virtual-cell "+(l?"sticky-col":""),style:l?{left:c,position:"sticky",zIndex:10,backgroundColor:"inherit"}:{},children:r.isTree?n("div",{className:"tree-cell-wrapper",children:[e("div",{className:"indentation-container",children:t.lines.map((n,r)=>e("span",{className:`indent-line ${n?"solid":"empty"} ${t.isLastChild&&r===t.lines.length-1?"last-node":""}`},r))}),e("div",{className:"expander-container",children:t.hasChildren?e("span",{onClick:x,className:"expander-btn",children:d?e(KG,{className:"spinner"}):e(Qe,{className:"expander-arrow "+(t.expanded?"expanded":"collapsed")})}):e("span",{className:"no-expander"})}),"checkbox"===i&&!t.isNewNode&&e("div",{className:"selection-container",children:e(bF,{checked:"completely"===t.selectedStatus,partial:"partially"===t.selectedStatus,onChange:A,disabled:t.isDisabled||f&&t.unselectable})}),"radio"===i&&!t.isNewNode&&e("div",{className:"selection-container",children:e(YW,{name:t.key,checked:o.includes(t.key),value:t.key,onChange:A,disabled:t.isDisabled})}),e("span",{className:"cell-content",children:t.isNewNode?e(QG,{onConfirm:p,onCancel:m,value:t.value,label:t.label,optionsList:t.options,selectedOption:t.selectedOption,withDropdown:"inputWithDropdown"===t.type,handleCustomError:v,inputFieldWidth:g,selectFieldWidth:y,confirmIconTooltip:t.confirmIconTooltip,cancelIconTooltip:t.cancelIconTooltip,isOnBlurTrue:!0,isDisable:{confirm:_}}):e("span",{className:"node-name "+(t.container?"folder":""),children:nte(t[r.accessor]||t.name,h)})}),r.actions&&!t.isNewNode&&e("div",{className:"row-actions",children:r.actions(t)})]}):e("span",{className:"cell-content",children:r.cell?r.cell(t):t[r.accessor]})},`${t.key}-${a}`)})})});function ate(e,t,n){var r=function(e){return atob(e)}(e),a=r.indexOf("\n",10)+1,i=r.substring(a)+"",o=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(o)}function ite(e,t,n){var r;return function(t){return r=r||ate(e),new Worker(r,t)}}rte.displayName="VirtualRow";var ote=ite("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8vIEludGVybmFsIFN0YXRlCiAgICBsZXQgbm9kZU1hcCA9IG5ldyBNYXAoKTsKICAgIGxldCByb290SWRzID0gW107CiAgICAvLyAxLiBJbml0aWFsaXplIERhdGEgU3RydWN0dXJlIChPKE4pKQogICAgY29uc3QgaW5pdGlhbGl6ZURhdGEgPSAocmF3Tm9kZXMpID0+IHsKICAgICAgICBub2RlTWFwLmNsZWFyKCk7CiAgICAgICAgcm9vdElkcyA9IFtdOwogICAgICAgIGNvbnN0IGNoaWxkcmVuTWFwID0gbmV3IE1hcCgpOwogICAgICAgIC8vIFBhc3MgMTogQnVpbGQgTWFwICYgQWRqYWNlbmN5IExpc3QKICAgICAgICByYXdOb2Rlcy5mb3JFYWNoKG5vZGUgPT4gewogICAgICAgICAgICBjb25zdCB2Tm9kZSA9IHsKICAgICAgICAgICAgICAgIC4uLm5vZGUsCiAgICAgICAgICAgICAgICBsaW5lczogW10sCiAgICAgICAgICAgICAgICBkZXB0aDogMCwKICAgICAgICAgICAgICAgIGhhc0NoaWxkcmVuOiBmYWxzZSwKICAgICAgICAgICAgICAgIGlzTGFzdENoaWxkOiBmYWxzZSwKICAgICAgICAgICAgICAgIGV4cGFuZGVkOiBub2RlLmV4cGFuZGVkID8/IGZhbHNlLAogICAgICAgICAgICAgICAgY2hpbGRyZW5JZHM6IFtdCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIG5vZGVNYXAuc2V0KG5vZGUua2V5LCB2Tm9kZSk7CiAgICAgICAgICAgIGlmIChub2RlLnBhcmVudElkKSB7CiAgICAgICAgICAgICAgICBpZiAoIWNoaWxkcmVuTWFwLmhhcyhub2RlLnBhcmVudElkKSkKICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbk1hcC5zZXQobm9kZS5wYXJlbnRJZCwgW10pOwogICAgICAgICAgICAgICAgY2hpbGRyZW5NYXAuZ2V0KG5vZGUucGFyZW50SWQpLnB1c2gobm9kZS5rZXkpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcm9vdElkcy5wdXNoKG5vZGUua2V5KTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIC8vIFBhc3MgMjogTGluayBDaGlsZHJlbgogICAgICAgIG5vZGVNYXAuZm9yRWFjaChub2RlID0+IHsKICAgICAgICAgICAgY29uc3QgY2hpbGRyZW4gPSBjaGlsZHJlbk1hcC5nZXQobm9kZS5rZXkpIHx8IFtdOwogICAgICAgICAgICBub2RlLmhhc0NoaWxkcmVuID0gY2hpbGRyZW4ubGVuZ3RoID4gMDsKICAgICAgICAgICAgbm9kZS5jaGlsZHJlbklkcyA9IGNoaWxkcmVuOwogICAgICAgIH0pOwogICAgfTsKICAgIC8vIDIuIEl0ZXJhdGl2ZSBUcmVlIEZsYXR0ZW5pbmcgKFN0YWNrIERGUykKICAgIGNvbnN0IHJlYnVpbGRGbGF0TGlzdCA9ICgpID0+IHsKICAgICAgICBjb25zdCBmbGF0TGlzdCA9IFtdOwogICAgICAgIC8vIEluaXRpYWxpemUgc3RhY2sgd2l0aCByb290cyAocmV2ZXJzZWQgZm9yIGNvcnJlY3QgcG9wIG9yZGVyKQogICAgICAgIGNvbnN0IHN0YWNrID0gWy4uLnJvb3RJZHNdLnJldmVyc2UoKS5tYXAoKGlkLCBpbmRleCkgPT4gKHsKICAgICAgICAgICAgaWQsCiAgICAgICAgICAgIGRlcHRoOiAwLAogICAgICAgICAgICBsaW5lczogW10sCiAgICAgICAgICAgIGlzTGFzdENoaWxkOiBpbmRleCA9PT0gMCAvLyBJbiByZXZlcnNlLCAwIGlzIHRoZSB2aXN1YWwgbGFzdAogICAgICAgIH0pKTsKICAgICAgICAvLyBDb3JyZWN0aW9uOiBUaGUgc3RhY2sgbG9naWMgZm9yIHJvb3RzIGRlcGVuZHMgb24gYXJyYXkgb3JkZXIuCiAgICAgICAgLy8gSWYgcm9vdHMgYXJlIFtBLCBCLCBDXSwgc3RhY2sgaXMgW0MsIEIsIEFdLiBDIGlzIGxhc3QuCiAgICAgICAgLy8gU28gd2hlbiB3ZSBwdXNoIEMgKGlkeCAwKSwgaXNMYXN0Q2hpbGQgPSB0cnVlLgogICAgICAgIHdoaWxlIChzdGFjay5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIGNvbnN0IHsgaWQsIGRlcHRoLCBsaW5lcywgaXNMYXN0Q2hpbGQgfSA9IHN0YWNrLnBvcCgpOwogICAgICAgICAgICBjb25zdCBub2RlID0gbm9kZU1hcC5nZXQoaWQpOwogICAgICAgICAgICBpZiAoIW5vZGUpCiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgbm9kZS5kZXB0aCA9IGRlcHRoOwogICAgICAgICAgICBub2RlLmxpbmVzID0gbGluZXM7CiAgICAgICAgICAgIG5vZGUuaXNMYXN0Q2hpbGQgPSBpc0xhc3RDaGlsZDsKICAgICAgICAgICAgZmxhdExpc3QucHVzaChub2RlKTsKICAgICAgICAgICAgaWYgKG5vZGUuZXhwYW5kZWQgJiYgbm9kZS5jaGlsZHJlbklkcy5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgbGluZXMgZm9yIGNoaWxkcmVuLiAKICAgICAgICAgICAgICAgIC8vIElmIHBhcmVudCBpcyBOT1QgbGFzdCBjaGlsZCwgY2hpbGRyZW4gbmVlZCBhIHZlcnRpY2FsIGxpbmUuCiAgICAgICAgICAgICAgICBjb25zdCBuZXh0TGluZXMgPSBbLi4ubGluZXMsICFpc0xhc3RDaGlsZF07CiAgICAgICAgICAgICAgICAvLyBQdXNoIGNoaWxkcmVuIGluIHJldmVyc2Ugb3JkZXIKICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBub2RlLmNoaWxkcmVuSWRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hpbGRJZCA9IG5vZGUuY2hpbGRyZW5JZHNbaV07CiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkSWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2sucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogY2hpbGRJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoOiBkZXB0aCArIDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lczogbmV4dExpbmVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNMYXN0Q2hpbGQ6IGkgPT09IG5vZGUuY2hpbGRyZW5JZHMubGVuZ3RoIC0gMQogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZsYXRMaXN0OwogICAgfTsKICAgIC8vIDMuIFNlbGVjdGlvbiBDYXNjYWRlIExvZ2ljCiAgICBjb25zdCBwZXJmb3JtU2VsZWN0aW9uQ2FzY2FkZSA9IChub2RlSWQsIHN0YXR1cykgPT4gewogICAgICAgIGNvbnN0IG5vZGUgPSBub2RlTWFwLmdldChub2RlSWQpOwogICAgICAgIGlmICghbm9kZSkKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIG5vZGUuc2VsZWN0ZWRTdGF0dXMgPSBzdGF0dXM7CiAgICAgICAgLy8gQ2FzY2FkZSBEb3duCiAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2NvbXBsZXRlbHknIHx8IHN0YXR1cyA9PT0gJ25vbmUnKSB7CiAgICAgICAgICAgIGNvbnN0IGNhc2NhZGVDaGlsZHJlbiA9IChjdXJyZW50SWQpID0+IHsKICAgICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gbm9kZU1hcC5nZXQoY3VycmVudElkKTsKICAgICAgICAgICAgICAgIGlmICghY2hpbGQpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgY2hpbGQuc2VsZWN0ZWRTdGF0dXMgPSBzdGF0dXM7CiAgICAgICAgICAgICAgICBjaGlsZC5jaGlsZHJlbklkcy5mb3JFYWNoKGNhc2NhZGVDaGlsZHJlbik7CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIG5vZGUuY2hpbGRyZW5JZHMuZm9yRWFjaChjYXNjYWRlQ2hpbGRyZW4pOwogICAgICAgIH0KICAgICAgICAvLyBDYXNjYWRlIFVwCiAgICAgICAgY29uc3QgY2FzY2FkZVBhcmVudCA9IChwYXJlbnRJZCkgPT4gewogICAgICAgICAgICBpZiAoIXBhcmVudElkKQogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBjb25zdCBwYXJlbnQgPSBub2RlTWFwLmdldChwYXJlbnRJZCk7CiAgICAgICAgICAgIGlmICghcGFyZW50KQogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBsZXQgYWxsQ29tcGxldGUgPSB0cnVlOwogICAgICAgICAgICBsZXQgYWxsTm9uZSA9IHRydWU7CiAgICAgICAgICAgIHBhcmVudC5jaGlsZHJlbklkcy5mb3JFYWNoKGNpZCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBjaGlsZCA9IG5vZGVNYXAuZ2V0KGNpZCk7CiAgICAgICAgICAgICAgICBpZiAoY2hpbGQpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc2VsZWN0ZWRTdGF0dXMgIT09ICdjb21wbGV0ZWx5JykKICAgICAgICAgICAgICAgICAgICAgICAgYWxsQ29tcGxldGUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc2VsZWN0ZWRTdGF0dXMgIT09ICdub25lJykKICAgICAgICAgICAgICAgICAgICAgICAgYWxsTm9uZSA9IGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgaWYgKGFsbENvbXBsZXRlKQogICAgICAgICAgICAgICAgcGFyZW50LnNlbGVjdGVkU3RhdHVzID0gJ2NvbXBsZXRlbHknOwogICAgICAgICAgICBlbHNlIGlmIChhbGxOb25lKQogICAgICAgICAgICAgICAgcGFyZW50LnNlbGVjdGVkU3RhdHVzID0gJ25vbmUnOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBwYXJlbnQuc2VsZWN0ZWRTdGF0dXMgPSAncGFydGlhbGx5JzsKICAgICAgICAgICAgY2FzY2FkZVBhcmVudChwYXJlbnQucGFyZW50SWQpOwogICAgICAgIH07CiAgICAgICAgY2FzY2FkZVBhcmVudChub2RlLnBhcmVudElkKTsKICAgIH07CiAgICAvLyA0LiBBZGQgTm9kZSBMb2dpYwogICAgY29uc3QgYWRkTm9kZSA9IChuZXdOb2RlRGF0YSkgPT4gewogICAgICAgIC8vIERldGVybWluZSBwYXJlbnQgSUQgYmFzZWQgb24gYWN0aW9uIChzaW1wbGlmaWVkKQogICAgICAgIC8vIEluIHJlYWwgdXNhZ2UsIHlvdSBtaWdodCBwYXJzZSAnYWRkSW5zaWRlJyB2cyAnYWRkQmVsb3cnIGxvZ2ljIGhlcmUgCiAgICAgICAgLy8gc2ltaWxhciB0byB0aGUgb3JpZ2luYWwgYWRkTmV3Um93LnRzCiAgICAgICAgY29uc3QgcGFyZW50SWQgPSBuZXdOb2RlRGF0YS5hY3Rpb24gPT09ICdhZGRJbnNpZGUnID8gbmV3Tm9kZURhdGEuc291cmNlSWQgOgogICAgICAgICAgICAobm9kZU1hcC5nZXQobmV3Tm9kZURhdGEuc291cmNlSWQpPy5wYXJlbnRJZCk7CiAgICAgICAgY29uc3QgcGFyZW50ID0gcGFyZW50SWQgPyBub2RlTWFwLmdldChwYXJlbnRJZCkgOiB1bmRlZmluZWQ7CiAgICAgICAgY29uc3QgbmV3Tm9kZSA9IHsKICAgICAgICAgICAga2V5OiBgbmV3LSR7RGF0ZS5ub3coKX1gLAogICAgICAgICAgICBuYW1lOiBuZXdOb2RlRGF0YS52YWx1ZSB8fCAnJywKICAgICAgICAgICAgaGllcmFyY2h5OiBwYXJlbnQgPyAocGFyZW50LmhpZXJhcmNoeSB8fCAwKSArIDEgOiAwLAogICAgICAgICAgICBwYXJlbnRJZDogcGFyZW50SWQsCiAgICAgICAgICAgIGxpbmVzOiBbXSwKICAgICAgICAgICAgZGVwdGg6IHBhcmVudCA/IHBhcmVudC5kZXB0aCArIDEgOiAwLAogICAgICAgICAgICBoYXNDaGlsZHJlbjogZmFsc2UsCiAgICAgICAgICAgIGlzTGFzdENoaWxkOiB0cnVlLAogICAgICAgICAgICBjaGlsZHJlbklkczogW10sCiAgICAgICAgICAgIGV4cGFuZGVkOiBmYWxzZSwKICAgICAgICAgICAgc2VsZWN0ZWRTdGF0dXM6ICdub25lJywKICAgICAgICAgICAgaXNOZXdOb2RlOiB0cnVlLAogICAgICAgICAgICAuLi5uZXdOb2RlRGF0YQogICAgICAgIH07CiAgICAgICAgbm9kZU1hcC5zZXQobmV3Tm9kZS5rZXksIG5ld05vZGUpOwogICAgICAgIGlmIChwYXJlbnQpIHsKICAgICAgICAgICAgcGFyZW50LmNoaWxkcmVuSWRzLnB1c2gobmV3Tm9kZS5rZXkpOwogICAgICAgICAgICBwYXJlbnQuaGFzQ2hpbGRyZW4gPSB0cnVlOwogICAgICAgICAgICBwYXJlbnQuZXhwYW5kZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcm9vdElkcy5wdXNoKG5ld05vZGUua2V5KTsKICAgICAgICB9CiAgICB9OwogICAgLy8gTWVzc2FnZSBIYW5kbGVyCiAgICBzZWxmLm9ubWVzc2FnZSA9IChlKSA9PiB7CiAgICAgICAgY29uc3QgeyB0eXBlLCBwYXlsb2FkIH0gPSBlLmRhdGE7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7CiAgICAgICAgICAgICAgICBjYXNlICdJTklUX0RBVEEnOgogICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVEYXRhKHBheWxvYWQudHJlZURhdGEpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnVE9HR0xFX0VYUEFORCc6CiAgICAgICAgICAgICAgICAgICAgY29uc3QgbiA9IG5vZGVNYXAuZ2V0KHBheWxvYWQuaWQpOwogICAgICAgICAgICAgICAgICAgIGlmIChuKQogICAgICAgICAgICAgICAgICAgICAgICBuLmV4cGFuZGVkID0gIW4uZXhwYW5kZWQ7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdVUERBVEVfU0VMRUNUSU9OJzoKICAgICAgICAgICAgICAgICAgICBwZXJmb3JtU2VsZWN0aW9uQ2FzY2FkZShwYXlsb2FkLmlkLCBwYXlsb2FkLnN0YXR1cyk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdBRERfTk9ERSc6CiAgICAgICAgICAgICAgICAgICAgYWRkTm9kZShwYXlsb2FkLm5ld05vZGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIEFsd2F5cyByZXR1cm4gdXBkYXRlZCB2aWV3CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAgdHlwZTogJ1VQREFURV9WSUVXJywKICAgICAgICAgICAgICAgIHBheWxvYWQ6IHsgZmxhdFZpZXc6IHJlYnVpbGRGbGF0TGlzdCgpLCB0b3RhbENvdW50OiBub2RlTWFwLnNpemUgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0eXBlOiAnRVJST1InLCBwYXlsb2FkOiBTdHJpbmcoZXJyb3IpIH0pOwogICAgICAgIH0KICAgIH07Cgp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD10cmVlLndvcmtlci5qcy5tYXAKCg==");const lte=i(({treeData:r,columnsData:a,selected:i=[],select:c,onChange:u,onClick:d,onExpand:f,loadMore:m=()=>{},tableBorder:v,height:g="calc(100vh - 134px)",newNode:_,onAddConfirm:b=()=>{},onAddCancel:w=()=>{},handleEditFieldError:E,loading:A=!1,rootNode:x,pagination:C=!0,selectedNode:k,tableHeaderBgColor:M="var(--border-color)",hideOnDisable:z=!1,freezeColumns:S=0,scriptLengthTruncate:O=25,addModuleInputWidth:I=150,addModuleSelectWidth:N,onScroll:j,onScrollEnd:T,disableEditLabelConfirmIcon:D=!1,transparentHeader:L=!1,navigateTreeNode:P=null,handleRemoveNavigateTreeNode:R=()=>{},scrollThreshold:H=128,showHeader:B=!0},q)=>{const[F,U]=s([]),[V,W]=s(0),[Q,G]=s(600),Y=o(null),K=o(),Z=o(null);y(q,()=>Y.current),l(()=>(K.current=new ote,K.current.onmessage=e=>{"UPDATE_VIEW"===e.data.type&&U(e.data.payload.flatView)},()=>K.current?.terminate()),[]),l(()=>{K.current&&(K.current.postMessage({type:"INIT_DATA",payload:{treeData:r}}),_&&_.action&&K.current.postMessage({type:"ADD_NODE",payload:{newNode:_,rootNode:x}}))},[r,_,x]),l(()=>{const e=Y.current;if(!e)return;"string"==typeof g&&g.includes("px")&&!g.includes("calc")&&G(parseInt(g,10));const t=new ResizeObserver(e=>{for(const t of e)t.contentRect.height>0&&G(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[g]);const{visibleRange:X,totalContentHeight:J,offsetY:$,startIndex:ee}=(({totalItems:e,containerHeight:t,rowHeight:n,scrollTop:r,buffer:a=5})=>h(()=>{if(0===e||0===t)return{visibleRange:[0,0],totalContentHeight:0,offsetY:0,startIndex:0};const i=e*n,o=Math.floor(r/n),l=Math.ceil(t/n),c=Math.max(0,o-a);return{visibleRange:[c,Math.min(e,o+l+a)],totalContentHeight:i,offsetY:c*n,startIndex:o}},[e,t,n,r,a]))({totalItems:F.length,containerHeight:Q,rowHeight:32,scrollTop:V}),te=h(()=>F.slice(X[0],X[1]),[F,X]),ne=h(()=>{if(!S||S<=0)return[];const e=[];let t=0;for(let n=0;n<S;n++){e.push(t);const r=a[n]?.width||"100px";t+=parseInt(r.replace("px",""),10)||100}return e},[a,S]),re=p(e=>{const t=e.currentTarget;if(requestAnimationFrame(()=>W(t.scrollTop)),j?.(),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>T?.(),150),A||!C)return;const n=t.scrollHeight-(t.scrollTop+t.clientHeight)<H,r=t.scrollTop<H;n?HW(()=>m("below"),200)():r&&t.scrollTop>0&&HW(()=>m("above"),200)()},[A,C,H,m,j,T]),ae=p(e=>{K.current?.postMessage({type:"TOGGLE_EXPAND",payload:{id:e.key}}),f?.(e)},[f]);l(()=>{if(P&&F.length>0&&Y.current){const e=F.findIndex(e=>e.key===P);if(-1!==e){const t=Math.max(0,32*e-Q/2+16);Y.current.scrollTo({top:t,behavior:"smooth"}),R()}}},[P,F,Q,R]);const ie=h(()=>a.map(e=>e.width).join(" "),[a]);return n("div",{className:"tree-table-wrapper-container",children:[B&&n(t,{children:[x&&e("div",{className:"virtual-header-root",children:e("div",{className:"virtual-header-root-row",style:{display:"grid",gridTemplateColumns:ie,backgroundColor:L?"transparent":M},children:a.map((t,r)=>{const a=r<(S||0),o=a?ne[r]:void 0;return n("div",{className:"header-root-cell "+(a?"sticky-col":""),style:a?{left:o,position:"sticky",zIndex:11,backgroundColor:M}:{},children:[0===r&&n("div",{className:"root-selection-wrapper",children:["checkbox"===x.select&&e(bF,{checked:"completely"===x.node?.selectedStatus,partial:"partially"===x.node?.selectedStatus,onChange:e=>u?.(e,x.node),disabled:x.node.isDisabled||z&&x.node.isDisabled}),"radio"===x.select&&e(YW,{name:x.node.key,checked:i.includes(x.node.key),value:x.node.key,onChange:e=>u?.(e,x.node),disabled:x.node.isDisabled})]}),e("span",{className:"cell-content",children:x.node[t.accessor]}),x.cell&&0===r&&e("div",{className:"root-cell-actions",children:x.cell(x.node)})]},r)})})}),e("div",{className:"virtual-header",style:{display:"grid",gridTemplateColumns:ie,backgroundColor:L?"transparent":M},children:a.map((t,n)=>{const r=n<(S||0),a=r?ne[n]:void 0;return e("div",{className:"header-cell "+(r?"sticky-col":""),style:r?{left:a,position:"sticky",zIndex:11,backgroundColor:M}:{},children:t.name},t.accessor)})})]}),n("div",{className:"virtual-scroll-container",ref:Y,style:{height:g,border:v},onScroll:re,children:[e("div",{style:{height:J,width:"1px"}}),e("div",{className:"virtual-render-layer",style:{transform:`translate3d(0, ${$}px, 0)`},children:te.map((t,n)=>e(rte,{node:t,columnsData:a,gridTemplate:ie,select:c,selected:i,isEven:(ee+n)%2==0,onToggleExpand:()=>ae(t),onRowClick:d,onCheckBoxChange:u,onAddConfirm:b,onAddCancel:w,handleEditFieldError:E,addModuleInputWidth:I,addModuleSelectWidth:N,disableEditLabelConfirmIcon:D,hideOnDisable:z,scriptLengthTruncate:O,selectedNode:k,stickyOffsets:ne,freezeColumns:S},t.key))}),A&&e("div",{className:"virtual-loading-overlay",children:n("div",{className:"loading-spinner",children:[e(KG,{}),e("span",{children:"Loading..."})]})})]})]})});function cte(e,t,n,r,a,i="children"){return function e(o){for(let l=0;l<o.length;l++){const c=o[l];if(c&&c[t]===n){const e=[...o];return"replace"===a?e[l]=r:e.splice("above"===a?l:l+1,0,r),{updatedArray:e}}if(c&&c[i]&&Array.isArray(c[i])){const t=e(c[i]);if(t)return{updatedArray:o.map((e,n)=>n===l?{...e,[i]:t.updatedArray}:e)}}}return null}(e)}lte.displayName="TableTreeFnVirtual";const ste=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const a=n?e:Object.keys(e),i=r?t:Object.keys(t);if(a.length!==i.length)return!1;if(n)return a.every((e,t)=>ste(e,i[t]));{const n=new Set(i);return a.every(r=>n.has(r)&&ste(e[r],t[r]))}},ute=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return ste(e,r)}));async function dte(e,t){const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),a=(new TextEncoder).encode(e),i=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,a);return btoa(String.fromCharCode(...new Uint8Array(i)))}const fte=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},hte=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},pte=({data:r,isYaxisSticky:a=!1,barWidth:i,height:c,barGap:u=20,colors:d=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:m=20,yAxisDivisions:v=5,barBorderRadius:g=0,legend:y=!0,showXAxisLabels:_=!0,icons:b=[],iconSize:w,legendPosition:E="bottom",legendGap:A=5,extendBarChartRightWidth:x=0,isYAxisValuePercentage:C=!1,selectedBar:k,setSelectedBar:M,onSelectedBar:z=e=>{},totalLabel:S="Total Execution",customToolTip:O=!1,isOnclick:I=!1,isDashboardVersions:N,type:j="",isMemory:T,tooltipWidth:D="fit-content"})=>{const L=o(null),[P,R]=s(null),[H,B]=s(!1);l(()=>{const e=()=>{const e=L.current;e&&H&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[H]);const q=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),F=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===j)t=hte(e.value);else if(T)switch(q){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=hte(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let U=0;"memory"===j&&(U=r.reduce((e,t)=>"string"==typeof t.value?e+fte(t.value):e+1024*Number(t.value)*1024*1024,0));const V=U/1048576,W=V<1024?`${Math.round(V)} mb`:`${(V/1024).toFixed(1)} gb`;let Q=Math.max(...F.map(e=>e.normalizedValue));Q="memory"===j?Math.max(Q,1):Math.max(Q,v);const G=40,Y=40,K=F.length*i+(F.length-1)*u+(a?Y:90)+x,Z=Date.now(),X=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${Z}-${j}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,a)=>e("stop",{offset:a/(t.length-1)*100+"%",stopColor:r},`${n}-${a}`))})},n)),J=e=>{if(!d.length)return"grey";const t=d[e%d.length];return 1===t?.length?t[0]:`url(#gradient-${Z}-${j}-${e%d.length})`},$=(e,t,n,r,a)=>{B(!0);const i=L.current;if(i)if(i.style.display="block",O)i.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${S} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(N){const e=a?a.join(", "):"";i.innerHTML=`\n <div>\n <div><Typography>${S} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else i.innerHTML="memory"===j?`<strong>${e}</strong>: ${t} / ${W}`:`<strong>${e}</strong>: ${t} ${C?"%":""}`},ee=(e,t=!1)=>{const n=L.current;if(n){const r=n.parentElement?.getBoundingClientRect(),a=window.scrollX,i=window.scrollY,o=1===F?.length||!t?e.clientX-(r?.left||0)+a+10:e.clientX-(r?.left||0)+a-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+i-20;n.style.left=`${o}px`,n.style.top=`${l}px`}},te=()=>{B(!1);const e=L.current;e&&(e.style.display="none")},ne=e=>{M&&(M(e),I&&z(e))},re=e=>{if(h){if(AF(e,10).endsWith("...")){const t=L.current;t&&(t.style.display="block",t.innerHTML=e)}}},ae=(e,t,n)=>{if(h){AF(t,10).endsWith("...")&&ee(e,n===F.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:L,className:"ff-bar-chart-tooltip",style:{width:D}}),y&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${A}px`},children:F.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>R(r),onMouseLeave:()=>R(null),children:[b[r]&&"string"==typeof b[r]?e(lF,{name:String(b[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:d[r%d.length]?.[0]||"grey"}}),e(cF,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),a?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:c+G+(f?20:0),children:n(t,{children:[Array.from({length:v+1}).map((t,n)=>{const r=c-n/v*c+G+4,a=n*Q/v,i="memory"===j?a.toFixed(1):C?`${a.toFixed(0).padStart(2,"0")}%`:a.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:i},n)}),p&&e("text",{x:-(c/2+35),y:a?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:K,height:c+G+5+(_?20:0)+(f?20:0),children:[Array.isArray(d)&&d.length>0&&X(d),F.map((t,r)=>{const a=t.normalizedValue/Q*c,o=t.normalizedValue<1?2:a,l=r*(i+u)+m,s=c-o+G,d=w||20,f=l+i/2-d/2,p=s-d,v=k===t.label,y=P===r;return n("g",{children:[b[r]&&"string"==typeof b[r]&&e("g",{onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,children:e(lF,{name:String(b[r]),x:String(f),y:String(p),width:d,height:d,chartIcon:!0})}),e("rect",{x:l,y:s,width:i,height:o,fill:J(r),rx:g,ry:g,style:{strokeWidth:v?3:0,opacity:null===P||y?1:.3,cursor:I?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>$(t.label,"memory"===j||T?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,onClick:()=>ne(t.label)}),v&&I&&e("rect",{x:l,y:s,width:i,height:o,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te}),_&&e("text",{onMouseEnter:()=>re(t.label),onMouseMove:e=>ae(e,t.label,r),onMouseLeave:te,x:0===r?l:r===F.length-1?l+i:l+i/2,y:c+G+15,className:"ff-bar-chart-labels",fill:v?"var(--brand-color)":"black",fontWeight:v?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?AF(t.label,10):t.label})]},r)}),e("line",{x1:a?0:m,y1:c+G,x2:K,y2:c+G,stroke:"#D9D9D9",strokeWidth:"1"}),!a&&f&&e("text",{x:K/2,y:c+G+(_?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:K,height:c+G+5+(_?20:0)+(f?20:0),children:[Array.isArray(d)&&d.length>0&&X(d),Array.from({length:v+1}).map((t,n)=>{const r=c-n/v*c+G+4,a=n*Q/v,i="memory"===j?a.toFixed(1):C?`${a.toFixed(0).padStart(2,"0")}%`:a.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:i},n)}),F.map((t,r)=>{const a=t.normalizedValue/Q*c,o=t.normalizedValue<1?2:a,l=r*(i+u)+Y+m,s=c-o+G,d=w||20,f=l+i/2-d/2,p=s-d,v=k===t.label,y=P===r;return n("g",{children:[b[r]&&"string"==typeof b[r]&&e("g",{onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,children:e(lF,{name:String(b[r]),x:String(f),y:String(p),width:d,height:d,chartIcon:!0})}),e("rect",{x:l,y:s,width:i,height:o,fill:J(r),rx:g,ry:g,style:{strokeWidth:v?3:0,opacity:null===P||y?1:.3,cursor:I?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>$(t.label,"memory"===j||T?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,onClick:()=>ne(t.label)}),v&&I&&e("rect",{x:l,y:s,width:i,height:o,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te}),_&&e("g",{children:e("text",{x:0===r?l:r===F.length-1?l+i:l+i/2,y:c+G+15,className:"ff-bar-chart-labels",fill:v?"var(--brand-color)":"black",fontWeight:v?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>re(t.label),onMouseMove:e=>ae(e,t.label,r),onMouseLeave:te,children:h?AF(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:c+G,x2:K,y2:c+G,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:K/2,y:c+G+(_?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(c/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),y&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${A}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>R(r),onMouseLeave:()=>R(null),children:[b[r]&&"string"==typeof b[r]?e(lF,{name:String(b[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:d[r%d.length]?.[0]||"grey"}}),e("div",{children:e(cF,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},mte=(e,t,n,r,a)=>{const i=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(a),c=t+n*Math.sin(a);return`M ${i} ${o} A ${n} ${n} 0 ${a-r>Math.PI?1:0} 1 ${l} ${c}`},vte=({radius:r,lineWidth:a,lineCap:i,barValues:o,labelHeading:l,legendType:c="numberLegend",isLegendDetails:u=!0,isPillValueVisible:d=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:m=8,gapBetweenArch:v=10,capsuleStyle:g={padding:"4px"}})=>{const[y,_]=s({visible:!1,x:0,y:0,content:"",isArc:!1}),[b,w]=s(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,A=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,x=o.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),C=x.reduce((e,t)=>e+t.normalizedValue,0),k=r,M=a+v,z=2*(k+M*(x.length-1)+a),S=[...x].reverse(),O=l.trim().split(" "),I=(e,t,n)=>{const{clientX:r,clientY:a}=e;_({visible:!0,x:r,y:a,content:t,isArc:n})},N=e=>{const{clientX:t,clientY:n}=e;_(e=>({...e,x:t,y:n}))},j=()=>{_({visible:!1,x:0,y:0,content:"",isArc:!1})};return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===c?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:z,height:z},children:n("svg",{width:z,height:z,viewBox:`0 0 ${z} ${z}`,className:"absolute top-0 left-0",children:[e("defs",{children:o.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${z/2+1}, ${z/2+1})`,children:[S.map((t,r)=>{const o=x.length-1-r,l=2*(t.normalizedValue/C)*Math.PI;let c=-Math.PI/2,s=c+l;t.normalizedValue===C&&(c=0,s=2*Math.PI);const u=k+M*o,d=mte(0,0,u,0,2*Math.PI),f={opacity:null!==b?t.barLabel===b?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=u*Math.cos(-Math.PI/2),i=u*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:d,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:a,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:i,r:a+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),onMouseEnter:e=>I(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:N,onMouseLeave:j,style:f})]},o)}const h=mte(0,0,u,c,s);return n("g",{children:[e("path",{d:d,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:a,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),strokeWidth:a,strokeLinecap:"square"===i?"butt":"round",onMouseEnter:e=>I(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:N,onMouseLeave:j,style:{pointerEvents:"stroke",...f}})]},o)}),e("text",{x:"0",y:`-${a+v+2}`,fill:(()=>{if(!y.visible)return"";const e=y.content.split(":")[0]?.trim();if(void 0===e)return"";const t=x.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return A(n)})(),textAnchor:"middle",dominantBaseline:"central",children:y.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(T=y.content.split(":")[1]?.trim()||"",D=9,T.length>D?T.slice(0,D)+"...":T)}),y.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${a+v+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:O.map((t,r)=>{if(0===r){const[a,...i]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:a}),e("tspan",{x:"0",dy:18,style:{fontSize:`${m}px`},className:"ff-center-text",children:i.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${m}px`},children:t},r)})})})]})]})}),y.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${y.y+10}px`,left:`${y.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:y.content}),u&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),I(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:N,onMouseLeave:()=>{w(null),j()},children:[e(cF,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:A(t),children:t.key.padStart(2,"0")}),e(cF,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),I(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:N,onMouseLeave:()=>{w(null),j()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:A(t)},children:e(cF,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:d&&t.value})}),e(cF,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(x.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),c)]});var T,D};function gte(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yte(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bte(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_te(Object(n),!0).forEach(function(t){yte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ete(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ate(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ete(Object(n),!0).forEach(function(t){wte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ete(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xte(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(a,r))}}}function Cte(e){return{}.toString.call(e).includes("Object")}function kte(e){return"function"==typeof e}var Mte=xte(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),zte={changes:function(e,t){return Cte(t)||Mte("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&Mte("changeField"),t},selector:function(e){kte(e)||Mte("selectorType")},handler:function(e){kte(e)||Cte(e)||Mte("handlerType"),Cte(e)&&Object.values(e).some(function(e){return!kte(e)})&&Mte("handlersType")},initial:function(e){var t;e||Mte("initialIsRequired"),Cte(e)||Mte("initialType"),t=e,Object.keys(t).length||Mte("initialContent")}};function Ste(e,t){return kte(t)?t(e.current):t}function Ote(e,t){return e.current=Ate(Ate({},e.current),t),t}function Ite(e,t,n){return kte(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var Nte={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zte.initial(e),zte.handler(t);var n={current:e},r=xte(Ite)(n,t),a=xte(Ote)(n),i=xte(zte.changes)(e),o=xte(Ste)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return zte.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,a,i,o)(e)}]}};var jte={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},Tte=function(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(a,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(jte),Dte={config:function(e){var t;return e||Tte("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||Tte("configType"),e.urls?(console.warn(jte.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function Lte(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Lte(e[n],t[n]))}),bte(bte({},e),t)}var Pte={type:"cancelation",msg:"operation is manually canceled"};function Rte(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(Pte):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var Hte,Bte,qte=["monaco"],Fte=Nte.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),Ute=(Bte=2,function(e){if(Array.isArray(e))return e}(Hte=Fte)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return l}}(Hte,Bte)||function(e,t){if(e){if("string"==typeof e)return gte(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gte(e,t):void 0}}(Hte,Bte)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),Vte=Ute[0],Wte=Ute[1];function Qte(e){return document.body.appendChild(e)}function Gte(e){var t=Vte(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Yte(){var e=Vte(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;Kte(n),e.resolve(n)},function(t){e.reject(t)})}function Kte(e){Vte().monaco||Wte({monaco:e})}var Zte=new Promise(function(e,t){return Wte({resolve:e,reject:t})}),Xte={config:function(e){var t=Dte.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,qte);Wte(function(e){return{config:Lte(e.config,r),monaco:n}})},init:function(){var e=Vte(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(Wte({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Rte(Zte);if(window.monaco&&window.monaco.editor)return Kte(window.monaco),e.resolve(window.monaco),Rte(Zte);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(Qte,Gte)(Yte)}return Rte(Zte)},__getMonacoInstance:function(){return Vte(function(e){return e.monaco})}},Jte={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$te={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var ene=function({children:e}){return a.createElement("div",{style:$te.container},e)},tne=ene;var nne=function({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:l}){return a.createElement("section",{style:{...Jte.wrapper,width:e,height:t},...l},!n&&a.createElement(tne,null,r),a.createElement("div",{ref:i,style:{...Jte.fullWidth,...!n&&Jte.hide},className:o}))},rne=g(nne);var ane=function(e){l(e,[])};var ine=function(e,t,n=!0){let r=o(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function one(){}function lne(e,t,n,r){return function(e,t){return e.editor.getModel(cne(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?cne(e,r):void 0)}(e,t,n,r)}function cne(e,t){return e.Uri.parse(t)}var sne=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:c,modifiedModelPath:u,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:m="Loading...",options:v={},height:g="100%",width:y="100%",className:_,wrapperProps:b={},beforeMount:w=one,onMount:E=one}){let[A,x]=s(!1),[C,k]=s(!0),M=o(null),z=o(null),S=o(null),O=o(E),I=o(w),N=o(!1);ane(()=>{let e=Xte.init();return e.then(e=>(z.current=e)&&k(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>M.current?function(){let e=M.current?.getModel();d||e?.original?.dispose(),f||e?.modified?.dispose(),M.current?.dispose()}():e.cancel()}),ine(()=>{if(M.current&&z.current){let t=M.current.getOriginalEditor(),a=lne(z.current,e||"",r||n||"text",c||"");a!==t.getModel()&&t.setModel(a)}},[c],A),ine(()=>{if(M.current&&z.current){let e=M.current.getModifiedEditor(),r=lne(z.current,t||"",i||n||"text",u||"");r!==e.getModel()&&e.setModel(r)}},[u],A),ine(()=>{let e=M.current.getModifiedEditor();e.getOption(z.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],A),ine(()=>{M.current?.getModel()?.original.setValue(e||"")},[e],A),ine(()=>{let{original:e,modified:t}=M.current.getModel();z.current.editor.setModelLanguage(e,r||n||"text"),z.current.editor.setModelLanguage(t,i||n||"text")},[n,r,i],A),ine(()=>{z.current?.editor.setTheme(h)},[h],A),ine(()=>{M.current?.updateOptions(v)},[v],A);let j=p(()=>{if(!z.current)return;I.current(z.current);let a=lne(z.current,e||"",r||n||"text",c||""),o=lne(z.current,t||"",i||n||"text",u||"");M.current?.setModel({original:a,modified:o})},[n,t,i,e,r,c,u]),T=p(()=>{!N.current&&S.current&&(M.current=z.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...v}),j(),z.current?.editor.setTheme(h),x(!0),N.current=!0)},[v,h,j]);return l(()=>{A&&O.current(M.current,z.current)},[A]),l(()=>{!C&&!A&&T()},[C,A,T]),a.createElement(rne,{width:y,height:g,isEditorReady:A,loading:m,_ref:S,className:_,wrapperProps:b})};g(sne);var une=function(e){let t=o();return l(()=>{t.current=e},[e]),t.current},dne=new Map;var fne,hne=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:c,theme:u="light",line:d,loading:f="Loading...",options:h={},overrideServices:m={},saveViewState:v=!0,keepCurrentModel:g=!1,width:y="100%",height:_="100%",className:b,wrapperProps:w={},beforeMount:E=one,onMount:A=one,onChange:x,onValidate:C=one}){let[k,M]=s(!1),[z,S]=s(!0),O=o(null),I=o(null),N=o(null),j=o(A),T=o(E),D=o(),L=o(r),P=une(c),R=o(!1),H=o(!1);ane(()=>{let e=Xte.init();return e.then(e=>(O.current=e)&&S(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>I.current?(D.current?.dispose(),g?v&&dne.set(c,I.current.saveViewState()):I.current.getModel()?.dispose(),void I.current.dispose()):e.cancel()}),ine(()=>{let a=lne(O.current,e||r||"",t||i||"",c||n||"");a!==I.current?.getModel()&&(v&&dne.set(P,I.current?.saveViewState()),I.current?.setModel(a),v&&I.current?.restoreViewState(dne.get(c)))},[c],k),ine(()=>{I.current?.updateOptions(h)},[h],k),ine(()=>{!I.current||void 0===r||(I.current.getOption(O.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(H.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),H.current=!1))},[r],k),ine(()=>{let e=I.current?.getModel();e&&i&&O.current?.editor.setModelLanguage(e,i)},[i],k),ine(()=>{void 0!==d&&I.current?.revealLine(d)},[d],k),ine(()=>{O.current?.editor.setTheme(u)},[u],k);let B=p(()=>{if(N.current&&O.current&&!R.current){T.current(O.current);let a=c||n,o=lne(O.current,r||e||"",t||i||"",a||"");I.current=O.current?.editor.create(N.current,{model:o,automaticLayout:!0,...h},m),v&&I.current.restoreViewState(dne.get(a)),O.current.editor.setTheme(u),void 0!==d&&I.current.revealLine(d),M(!0),R.current=!0}},[e,t,n,r,i,c,h,m,v,u,d]);return l(()=>{k&&j.current(I.current,O.current)},[k]),l(()=>{!z&&!k&&B()},[z,k,B]),L.current=r,l(()=>{k&&x&&(D.current?.dispose(),D.current=I.current?.onDidChangeModelContent(e=>{H.current||x(I.current.getValue(),e)}))},[k,x]),l(()=>{if(k){let e=O.current.editor.onDidChangeMarkers(e=>{let t=I.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=O.current.editor.getModelMarkers({resource:t});C?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,C]),a.createElement(rne,{width:y,height:_,isEditorReady:k,loading:f,_ref:N,className:b,wrapperProps:w})},pne=g(hne),mne={exports:{}},vne={},gne={exports:{}},yne={},_ne={};function bne(){if(fne)return _ne;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return fne=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(0!==a.item(0).indexOf(t)&&a.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},_ne.Output=n,_ne}var wne,Ene={};function Ane(){if(wne)return Ene;return wne=1,Ene.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},Ene}var xne,Cne={};function kne(){return xne||(xne=1,i="(?:"+(a="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",o="(?:"+a+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(e=Cne).identifier=new RegExp(i+o,"g"),e.identifierStart=new RegExp(i),e.identifierMatch=new RegExp("(?:"+a+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")),Cne;var e,t,n,r,a,i,o}var Mne,zne,Sne={},One={};function Ine(){if(Mne)return One;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,a={};for(r in e=n(e))r!==t&&(a[r]=e[r]);if(t&&e[t])for(r in e[t])a[r]=e[t][r];return a}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return Mne=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},One.Options=e,One.normalizeOpts=n,One.mergeOpts=t,One}function Nne(){if(zne)return Sne;zne=1;var e=Ine().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i<a.length;i++)"preserve-inline"===a[i]?this.brace_preserve_inline=!0:this.brace_style=a[i];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,Sne.Options=n,Sne}var jne,Tne={},Dne={};function Lne(){if(jne)return Dne;jne=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,a="";return e&&(r=this.match(e))&&(a+=r[0]),!t||!r&&e||(a+=this.readUntil(t,n)),a},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var a=e.exec(this.__input);return a?(r=a.index,t&&(r+=a[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,a="g";return n&&e&&(a="y"),"string"==typeof t&&""!==t?r=new RegExp(t,a):t&&(r=new RegExp(t.source,a)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},Dne.InputScanner=t,Dne}var Pne,Rne={},Hne={};var Bne,qne,Fne,Une={},Vne={};function Wne(){if(Bne)return Vne;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return Bne=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},Vne.Pattern=e,Vne}function Qne(){if(Fne)return Rne;Fne=1;var e=Lne().InputScanner,t=Ane().Token,n=function(){if(Pne)return Hne;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return Pne=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},Hne.TokenStream=e,Hne}().TokenStream,r=function(){if(qne)return Une;qne=1;var e=Wne().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],a=e.exec(t);a;)r.push(t.substring(n,a.index)),n=a.index+a[0].length,a=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},Une.WhitespacePattern=t,Une}().WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return i.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(a.START,""),i=null,o=[],l=new n;r.type!==a.EOF;){for(e=this._get_next_token(r,i);this._is_comment(e);)l.add(e),e=this._get_next_token(r,i);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=i,this._is_opening(e)?(o.push(i),i=e):i&&this._is_closing(e,i)&&(e.opened=i,i.closed=e,i=o.pop(),e.parent=i),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},i.prototype._is_comment=function(e){return!1},i.prototype._is_opening=function(e){return!1},i.prototype._is_closing=function(e,t){return!1},i.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Rne.Tokenizer=i,Rne.TOKEN=a,Rne}var Gne,Yne={};function Kne(){if(Gne)return Yne;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return Gne=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},Yne.Directives=e,Yne}var Zne,Xne,Jne,$ne,ere={};function tre(){if(Zne)return ere;Zne=1;var e=Wne().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var a=new e(n);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},ere.TemplatablePattern=n,ere}function nre(){if(Xne)return Tne;Xne=1;var e=Lne().InputScanner,t=Qne().Tokenizer,n=Qne().TOKEN,r=Kne().Directives,a=kne(),i=Wne().Pattern,o=tre().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},s=new r(/\/\*/,/\*\//),u=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,d=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var m,v=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),y=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+y.join("|")+")$"),b=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new i(this._input),l=new o(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(a.identifier).matching(a.identifierMatch),number:r.matching(u),punct:r.matching(v),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(a.lineBreak),shebang:r.starting_with(/#!/).until_after(a.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(b.prototype=new t)._is_comment=function(e){return e.type===c.COMMENT||e.type===c.BLOCK_COMMENT||e.type===c.UNKNOWN},b.prototype._is_opening=function(e){return e.type===c.START_BLOCK||e.type===c.START_EXPR},b.prototype._is_closing=function(e,t){return(e.type===c.END_BLOCK||e.type===c.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},b.prototype._reset=function(){m=!1},b.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(c.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(c.UNKNOWN,this._input.next())},b.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(a.allLineBreaks,"\n"),e.type!==c.DOT&&(e.type!==c.RESERVED||"set"!==e.text&&"get"!==e.text)&&_.test(t)?"in"!==t&&"of"!==t||e.type!==c.WORD&&e.type!==c.STRING?this._create_token(c.RESERVED,t):this._create_token(c.OPERATOR,t):this._create_token(c.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(c.WORD,t):void 0},b.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(c.START_EXPR,e):")"===e||"]"===e?t=this._create_token(c.END_EXPR,e):"{"===e?t=this._create_token(c.START_BLOCK,e):"}"===e?t=this._create_token(c.END_BLOCK,e):";"===e?t=this._create_token(c.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(c.DOT,e):","===e&&(t=this._create_token(c.COMMA,e)),t&&this._input.next(),t},b.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(c.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},b.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(c.EQUALS,e):"?."===e?this._create_token(c.DOT,e):this._create_token(c.OPERATOR,e)},b.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(c.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(c.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(d)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)t+=this._input.next();return m=!0,this._create_token(c.COMMENT,t)}}else if(m&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return m=!1,this._create_token(c.COMMENT,t);return null},b.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=s.get_directives(n);r&&"start"===r.ignore&&(n+=s.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),(t=this._create_token(c.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(c.COMMENT,n))}return t},b.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,a=new e(t),i=null;for(;a.hasNext();)if((i=a.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=i[0]),"\\"===a.peek()){if(a.next(),"x"===a.peek())i=a.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==a.peek()){n+="\\",a.hasNext()&&(n+=a.next());continue}(i=a.match(/u([0-9A-Fa-f]{4})/g))||(i=a.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!i)return t;if((r=parseInt(i[1],16))>126&&r<=255&&0===i[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+i[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}return null},b.prototype._allow_regexp_or_xml=function(e){return e.type===c.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===c.END_EXPR&&")"===e.text&&e.opened.previous.type===c.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},b.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==e)&&!this._input.testChar(a.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?i=!0:"]"===this._input.peek()&&(i=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(c.STRING,n)}return null},b.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===i.indexOf("{"),l=0;r;){var s=!!r[1],u=r[2];if(!(!!r[r.length-1]||"![CDATA["===u.slice(0,8))&&(u===i||o&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(s?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},b.prototype._read_string_recursive=function(e,t,n){var r,i;"'"===e?i=this.__patterns.single_quote:'"'===e?i=this.__patterns.double_quote:"`"===e?i=this.__patterns.template_text:"}"===e&&(i=this.__patterns.template_expression);for(var o=i.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&a.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=i.read()}return o},Tne.Tokenizer=b,Tne.TOKEN=c,Tne.positionable_operators=h.slice(),Tne.line_starters=g.slice(),Tne}function rre(){if(Jne)return yne;Jne=1;var e=bne().Output,t=Ane().Token,n=kne(),r=Nne().Options,a=nre().Tokenizer,i=nre().line_starters,o=nre().positionable_operators,l=nre().TOKEN;function c(e,t){return-1!==t.indexOf(e)}function s(e){return e.replace(/^\s+/g,"")}function u(e,t){return e&&e.type===l.RESERVED&&e.text===t}function d(e,t){return e&&e.type===l.RESERVED&&c(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),p=[h.before_newline,h.preserve_newline],m="BlockStatement",v="Statement",g="ObjectLiteral",y="ArrayLiteral",_="ForInitializer",b="Conditional",w="Expression";function E(e,t){t.multiline_frame||t.mode===_||t.mode===b||e.remove_indent(t.start_line_index)}function A(e){return e===y}function x(e){return c(e,[w,_,b])}function C(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}C.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},C.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var r=new a(t,this._options);return this._tokens=r.tokenize(),t},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},C.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},C.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&A(this._flags.mode);if(e.comments_before)for(var a=e.comments_before.next();a;)this.handle_whitespace_and_comments(a,t),this.handle_token(a,t),a=e.comments_before.next();if(r)for(var i=0;i<n;i+=1)this.print_newline(i>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var o=1;o<n;o+=1)this.print_newline(!0,t)}};var k=["async","break","continue","return","throw","yield"];return C.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(c(this._flags.last_token.text,o)||c(e.text,o)){var r=c(this._flags.last_token.text,o)&&c(this._options.operator_position,p)||c(e.text,o);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,k))return;this._output.set_wrap_point()}}},C.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&u(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},C.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},C.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},C.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===v&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===v&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},C.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||d(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||u(this._flags.last_token,"do"))||!(this._flags.parent.mode===g&&this._flags.mode===v)&&d(this._flags.last_token,k)&&!e.newlines)||u(this._flags.last_token,"else")&&!(u(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===_||this._previous_flags.mode===b))||this._flags.last_token.type===l.WORD&&this._flags.mode===m&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(v),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,d(e,["do","for","if","while"])),!0)},C.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=w;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=y,A(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=_):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=b):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,i)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},C.prototype.handle_end_expr=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===b&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},C.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(m),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m):n&&(c(n.text,[":",","])&&c(t.type,[l.STRING,l.WORD,l.RESERVED])||c(t.text,["get","set","..."])&&c(n.type,[l.WORD,l.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(m):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(m):c(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g):this.set_mode(m),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,a=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var i=0,o=null;this._flags.inline_frame=!0;do{if(i+=1,(o=this._tokens.peek(i-1)).newlines){this._flags.inline_frame=!1;break}}while(o.type!==l.EOF&&(o.type!==l.END_BLOCK||o.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(a||this._flags.last_token.type===l.EQUALS||d(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!A(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(c(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},C.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===v;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},C.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(c(e.text,["set","get"])&&this._flags.mode!==g)e.type=l.WORD;else if("import"===e.text&&c(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(c(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===g){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?d(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||x(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(u(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&u(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===v;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===g||this.allow_wrap_or_preserved_newline(e),u(e,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,k)||u(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!x(this._flags.mode)&&!A(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":d(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===m?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&x(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),d(e,i)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==m||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?d(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&d(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&d(e,["var","let","const"])||":"===this._flags.last_token.text||(u(e,"if")&&u(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(e,i)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&u(e,"from")&&(this._flags.import_block=!1))},C.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&u(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},C.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},C.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},C.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(x(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===g||this._flags.mode===v&&this._flags.parent.mode===g?(this._flags.mode===v&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},C.prototype.handle_operator=function(e){var t="*"===e.text&&(d(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=c(e.text,["-","+"])&&(c(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||c(this._flags.last_token.text,i)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(c(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&c(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var a=!0,s=!0,u=!1;if(":"===e.text?0===this._flags.ternary_depth?a=!1:(this._flags.ternary_depth-=1,u=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&c(e.text,o)){var g=":"===e.text,y=g&&u,_=g&&!u;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!_,this.print_token(e),g&&!y||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!g||y?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return _||this.allow_wrap_or_preserved_newline(e),a=!(this._output.just_added_newline()||_),this._output.space_before_token=a,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),a=!1;var b=this._tokens.peek();s=b&&c(b.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),a=this._flags.last_token.type===l.START_BLOCK,s=!1;else if(c(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),a=!1,s=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=d(this._flags.last_token,f)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&x(this._flags.mode)&&(a=!0),this._flags.last_token.type===l.RESERVED?a=!0:this._flags.last_token.type===l.END_EXPR?a=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(a=c(e.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(e.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==m||this._flags.inline_frame)&&this._flags.mode!==v||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||a,this.print_token(e),this._output.space_before_token=s}else this.print_token(e);else this.print_token(e)},C.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},C.prototype.print_block_commment=function(e,t){var r,a=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),i=!1,o=!1,l=e.whitespace_before,c=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(a[0]),this.print_newline(!1,t),a.length>1){for(i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(a=a.slice(1),"*"),o=function(e,t){for(var n,r=0,a=e.length;r<a;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(a,l),i&&(this._flags.alignment=1),r=0;r<a.length;r++)i?(this.print_token_line_indentation(e),this._output.add_token(s(a[r]))):o&&a[r]?(this.print_token_line_indentation(e),this._output.add_token(a[r].substring(c))):(this._output.current_line.set_indent(-1),this._output.add_token(a[r])),this.print_newline(!1,t);this._flags.alignment=0}},C.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},C.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},C.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},C.prototype.handle_eof=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e)},yne.Beautifier=C,yne}var are,ire,ore,lre={exports:{}},cre={},sre={};function ure(){if(are)return sre;are=1;var e=Ine().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<r.length;a++)"expand"!==r[a]?this.brace_style="collapse":this.brace_style=r[a]}return t.prototype=new e,sre.Options=t,sre}function dre(){if(ore)return lre.exports;ore=1;var e=function(){if(ire)return cre;ire=1;var e=ure().Options,t=bne().Output,n=Lne().InputScanner,r=new(0,Kne().Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=/\s/,l=/(?:\s|\n)+/g,c=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,s=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function u(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return u.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},u.prototype.eatWhitespace=function(e){for(var t=o.test(this._input.peek()),n=0;o.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},u.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},u.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},u.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},u.prototype.indent=function(){this._indentLevel++},u.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,u=this._options.eol;"auto"===u&&(u="\n",e&&a.test(e||"")&&(u=e.match(a)[0]));var d=(e=e.replace(i,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,d),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,p=0,m=!1,v=!1,g=!1,y=!1,_=!1,b=this._ch,w=!1;f=""!==this._input.read(l),h=b,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),b=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(c),A=r.get_directives(E);A&&"start"===A.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(s)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")&&(v=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var C=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);C.match(/[ :]$/)&&(C=this.eatString(": ").replace(/\s+$/,""),this.print_string(C),this._output.space_before_token=!0),0===p&&-1!==C.indexOf(":")?(v=!0,this.indent()):C in this.NESTED_AT_RULE?(this._nestedLevel+=1,C in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||v||(y=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)v&&(v=!1,this.outdent()),y=!1,g?(g=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),v&&(this.outdent(),v=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){w=!0;break}!m&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||y||0!==p?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),v||(v=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var M='"'===h||"'"===h;this.preserveSingleSpace(M||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===p?(v&&(this.outdent(),v=!1),y=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),p++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),p&&(p--,this.outdent()));else{var z=!1;this._input.lookBack("with")&&(z=!0),this.preserveSingleSpace(f||z),this.print_string(this._ch),v&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),_=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),_&&";"===this._input.peek()&&this._options.selector_separator_newline&&(_=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||v&&!_||0!==p||y?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||v||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),o.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var S='"'===h||"'"===h;this.preserveSingleSpace(S||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&o.test(this._ch)&&(this._ch=""));return this._output.get_code(u)},cre.Beautifier=u,cre}().Beautifier,t=ure().Options;return lre.exports=function(t,n){return new e(t,n).beautify()},lre.exports.defaultOptions=function(){return new t},lre.exports}var fre,hre={exports:{}},pre={},mre={};function vre(){if(fre)return mre;fre=1;var e=Ine().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,mre.Options=t,mre}var gre,yre,_re,bre,wre,Ere={};function Are(){if(gre)return Ere;gre=1;var e=Qne().Tokenizer,t=Qne().TOKEN,n=Kne().Directives,r=tre().TemplatablePattern,a=Wne().Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},o=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var i=new r(this._input).read_options(this._options),o=new a(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),word_control_flow_close_excluded:i.until(/[\n\r\t <}]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),angular_control_flow_start:o.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),handlebars_open:o.until(/[\n\r\t }]/),handlebars_raw_close:o.until(/}}/),comment:o.starting_with(/<!--/).until_after(/-->/),cdata:o.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:o.starting_with(/<!\[/).until_after(/]>/),processing:o.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=o.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===i.TAG_OPEN||e.type===i.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===i.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===i.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(i.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(i.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=o.get_directives(n))&&"start"===r.ignore&&(n+=o.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(i.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(i.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==i.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(i.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==i.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(i.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(i.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var a=n.endsWith("(")?1:0,o=0;!n.endsWith("{")||a!==o;){var l=this._input.next();if(null===l)break;"("===l?a++:")"===l&&o++,n+=l}r=this._create_token(i.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===i.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(i.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===i.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(i.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(i.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,a="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(i.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(i.VALUE,o)}else(a=this.__patterns.attribute.read())&&(r=t.type===i.EQUALS?this._create_token(i.VALUE,a):this._create_token(i.ATTRIBUTE,a));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===i.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var a=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(a)&&(r=this._input.readUntil(new RegExp("</"+a+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(i.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===i.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=i.TEXT,r;var a=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(a)return this._create_token(i.TEXT,a)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===i.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(i.TEXT,n):null},Ere.Tokenizer=l,Ere.TOKEN=i,Ere}function xre(){if(yre)return pre;yre=1;var e=vre().Options,t=bne().Output,n=Are().Tokenizer,r=Are().TOKEN,a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};o.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},o.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},o.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},o.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(e){this._output.add_new_line(e)},o.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},o.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,a=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?a="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?a="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?a="html":n.search(/test\/null/)>-1&&(a="null"),a):null};function c(e,t){return-1!==t.indexOf(e)}function s(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function u(e){this._printer=e,this._current_frame=null}function d(t,n,r,a){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=a,this._tag_stack=null;var i=new e(n,"html");this._options=i,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}u.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},u.prototype.record_tag=function(e){var t=new s(this._current_frame,e,this._printer.indent_level);this._current_frame=t},u.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},u.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},u.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},u.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.test(e)&&(t=e.match(a)[0]));var l=(e=e.replace(i,"\n")).match(/^[\t ]*/)[0],c={text:"",type:""},s=new f(this._options),d=new o(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new u(d);for(var p=null,m=h.next();m.type!==r.EOF;)m.type===r.TAG_OPEN||m.type===r.COMMENT?s=p=this._handle_tag_open(d,m,s,c,h):m.type===r.ATTRIBUTE||m.type===r.EQUALS||m.type===r.VALUE||m.type===r.TEXT&&!s.tag_complete?p=this._handle_inside_tag(d,m,s,c):m.type===r.TAG_CLOSE?p=this._handle_tag_close(d,m,s):m.type===r.TEXT?p=this._handle_text(d,m,s):m.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(d,m):m.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(d,m):d.add_raw_token(m),c=p,m=h.next();return d._output.get_code(t)},d.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},d.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},d.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},d.prototype._handle_inside_tag=function(e,t,n,a){var i=n.has_wrapped_attrs,o={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),i=i||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(a.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),i=!0)),e.print_token(t),i=i||e.previous_token_wrapped(),n.has_wrapped_attrs=i),o},d.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},d.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var a,i=t.text,o=1,l="",c="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?a=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?a=this._css_beautify:"html"===n.custom_beautifier_name&&(a=function(e,t){return new d(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-e.indent_level);var s=e.get_full_indent(o);if(i=i.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===i[0]&&i.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(i);if(!u)return void e.add_raw_token(t);l=s+u[1]+"\n",i=u[4],u[5]&&(c=s+u[5]),i=i.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(t.whitespace_before=u[0])}if(i)if(a){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,i=a(s+i,new f)}else{var h=t.whitespace_before;h&&(i=i.replace(new RegExp("\n("+h+")?","g"),"\n")),i=s+i.replace(/\n/g,"\n"+s)}l&&(i=i?l+i+"\n"+c:l+c),e.print_newline(!1),i&&(t.text=i,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},d.prototype._handle_tag_open=function(e,t,n,a,i){var o=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||o.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,o,n,a),o.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),o.is_start_tag&&this._is_wrap_attributes_force){var l,c=0;do{(l=i.peek(c)).type===r.ATTRIBUTE&&(o.attr_count+=1),c+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=t.text.length+1),o.tag_complete||o.is_unformatted||(e.alignment_size=o.alignment_size),o};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var a;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(a=n.text.match(/^<([^\s>]*)/),this.tag_check=a?a[1]:""):(a=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=a?a[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var i=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(i=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(i)))}else this.tag_complete=!0};d.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||c(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&c(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&c(t.tag_check,this._options.content_unformatted),t.is_inline_element=c(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},d.prototype._set_tag_position=function(e,t,n,a,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),c(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&i.type===r.TAG_CLOSE&&a.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var o=!1;o=(o=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(a.is_inline_element||a.is_unformatted)&&!(i.type===r.TAG_CLOSE&&n.start_tag_token===a)&&"TK_CONTENT"!==i.type,(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===i.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},d.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];return d.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==p.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},pre.Beautifier=d,pre}function Cre(){if(bre)return vne;bre=1;var e=function(){if($ne)return gne.exports;$ne=1;var e=rre().Beautifier,t=Nne().Options;return gne.exports=function(t,n){return new e(t,n).beautify()},gne.exports.defaultOptions=function(){return new t},gne.exports}(),t=dre(),n=function(){if(_re)return hre.exports;_re=1;var e=xre().Beautifier,t=vre().Options;return hre.exports=function(t,n,r,a){return new e(t,n,r,a).beautify()},hre.exports.defaultOptions=function(){return new t},hre.exports}();function r(r,a,i,o){return n(r,a,i=i||e,o=o||t)}return r.defaultOptions=n.defaultOptions,vne.js=e,vne.css=t,vne.html=r,vne}var kre=(wre||(wre=1,function(e){var t,n,r,a,i=Cre();i.js_beautify=i.js,i.css_beautify=i.css,i.html_beautify=i.html,e.exports=(t=i,n=i,r=i,a=function(e,n){return t.js_beautify(e,n)},a.js=t.js_beautify,a.css=n.css_beautify,a.html=r.html_beautify,a.js_beautify=t.js_beautify,a.css_beautify=n.css_beautify,a.html_beautify=r.html_beautify,a)}(mne)),mne.exports);const Mre=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:a}=e,i=t.getBoundingClientRect();let o=r,l=a;return o-=o+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,a>.6*i.width?l-=n+50:a<.5*i.width+n&&(l-=42),{top:o,left:l}},zre=i(({width:t="100%",height:r="100%",VariableDropdownHeight:a="160px",readOnly:i=!1,value:c="",handleChange:u,setValue:d,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:m="light",isRequisiteType:v=!1,onPaste:g,showVariableDropdown:_=!0,defaultValue:b,customOptions:w={},editorVariableZindex:E=99999,showMinimap:A=!0,isFocus:x=!1},C)=>{const k=o(null),M=o([]),z=o(null),S=o(null),[O,I]=s(0),[N,j]=s(!1),[T,D]=s(!1),[L,P]=s({top:0,left:0}),[R,H]=s([]),B=o(f);l(()=>{B.current=f},[f]);l(()=>{const e=k.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{D(!1),z.current=null,S.current=null,M.current=[],I(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[T]),l(()=>{const e=k.current;if(!e||!O)return;const t=[],n=[];N?n.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),M.current=e.deltaDecorations(M.current,[...t,...n])},[O,N]);const q=(e,t)=>{switch(t){case"json":case"javascript":return kre.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return kre.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return y(C,()=>({getEditorInstance:()=>k.current,focus:()=>{k.current?.focus()},beautify:()=>{if(k.current){const e=k.current.getValue(),t=k.current.getModel()?.getLanguageId(),n=q(e,t||"json");k.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(pne,{defaultValue:b,height:r,width:t,language:p,value:c,options:{minimap:{enabled:A},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:i,guides:{indentation:!1},...w},onMount:(e,t)=>{k.current=e,x&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{I(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const a=r.getLineContent(n.lineNumber),i=n.column-1;if(0===i)return void D(!1);const o=a.lastIndexOf("$",i-1),l=a.lastIndexOf("${",i-1),c=-1!==l?a.indexOf("}",l+2):-1,s=-1!==l&&-1!==c&&i-1>l&&i-1<c,u=!/\}/.test(a.slice(o+1,i));if(-1!==o&&i>o&&!/\s/.test(a.slice(o+1,i))&&!s&&u){z.current=o,S.current=a.slice(o+1,i);const r=(S.current??"").toLowerCase(),l=B.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));H(l);const c=e.getScrolledVisiblePosition(n),s=e.getDomNode();P(Mre(c,s,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&D(!0)}else D(!1),z.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=k.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),a=t.column-2;"$"===r[a]?(z.current=a,S.current=""):(z.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);j(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();d(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const a=r.getLineContent(n.lineNumber),i=n.column-2;if("$"===a[z.current??i]){null===z.current&&(z.current=i),S.current=a.slice(z.current+1,i);const t=B.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?H(t):(H([]),z?.current!==i&&" "===a[i]&&(z.current=null,S.current=null,D(!1)));const r=e.getScrolledVisiblePosition(n),o=e.getDomNode();P(Mre(r,o,150))}else z.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=q(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),a=e.getWordAtPosition(n),i=a?new t.Range(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),o=[];return r.endsWith("ff.")&&o.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:i},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:i},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:i}),{suggestions:o}}})},onChange:(e,t)=>u(e,t),theme:m}),T&&L&&_&&e(xee,{position:"absolute",width:"300px",height:a,optionsList:R,onSelectVariable:e=>{if(v&&k.current){const t=k.current,n=t.getPosition();if(n){const r=`'${e.name}'`,a=z?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:a+1,endLineNumber:n.lineNumber,endColumn:a+(n.column-a)},text:r,forceMoveMarkers:!0}]),S.current=null,z.current=null,D(!1)}}else((e,t)=>{if(k.current){const n=k.current,r=n.getPosition();if(r){const a=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,i=z?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:i+2,endLineNumber:r.lineNumber,endColumn:i+(r.column-i)},text:a,forceMoveMarkers:!1}]);const o=[];o.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!1}}),M.current=n.deltaDecorations(M.current,o),S.current=null,z.current=null,D(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:L,zIndex:E})]})}),Sre=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...a}=e;return{...a,...t,runCount:n+1}}));var Ore,Ire={exports:{}};var Nre=(Ore||(Ore=1,"undefined"!=typeof self&&self,Ire.exports=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var a=r(n(0));t.ArcherContainerContext=a.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var a=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(a).default}});var i=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(i).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&("get"in a?t.__esModule:!a.writable&&!a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),l=n(7),c=n(1),s=n(2),u=n(8),d=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,a=e.children,i=(0,o.useMemo)(function(){return(0,s.encodeId)(t)},[t]),f=(0,o.useContext)(c.ArcherContainerContext),h=(0,o.useRef)(),p=(0,o.useCallback)(function(e){var t=(0,d.generateSourceToTarget)(i,e);(0,d.assertContextExists)(f),f.registerTransitions(i,t)},[f,i]),m=(0,o.useCallback)(function(){(0,d.assertContextExists)(f),f.unregisterTransitions(i)},[f,i]),v=(0,o.useCallback)(function(e){e&&((0,d.assertContextExists)(f),f.registerChild(i,e))},[i,f]),g=(0,o.useCallback)(function(){(0,d.assertContextExists)(f),f.unregisterChild(i)},[f,i]);(0,l.useIsomorphicLayoutEffect)(function(){return v(h.current),function(){return g()}},[v,g]),(0,u.useDeepCompareEffect)(function(){return p(r),function(){return m()}},[p,r,m]),o.default.Children.only(a);var y=a;return o.default.cloneElement(y,Object.assign(Object.assign({},y.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var a=n(0),i=r(n(9));function o(e){var t=(0,a.useRef)();return(0,i.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,a.useEffect)(e,t.map(o))}},function(e,t,n){var r=Array.isArray,a=Object.keys,i=Object.prototype.hasOwnProperty,o="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,c,s,u=r(t),d=r(n);if(u&&d){if((c=t.length)!=n.length)return!1;for(l=c;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(u!=d)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var p=t instanceof RegExp,m=n instanceof RegExp;if(p!=m)return!1;if(p&&m)return t.toString()==n.toString();var v=a(t);if((c=v.length)!==a(n).length)return!1;for(l=c;0!=l--;)if(!i.call(n,v[l]))return!1;if(o&&t instanceof Element&&n instanceof Element)return t===n;for(l=c;0!=l--;)if(!("_owner"===(s=v[l])&&t.$$typeof||e(t[s],n[s])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,a=t.sourceAnchor,i=t.targetAnchor,o=t.label,l=t.className,c=t.style,s=t.order,u=void 0===s?0:s,d=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:a},target:{id:(0,r.encodeId)(n),anchor:i},className:l,label:o,style:c,order:u,domAttributes:d,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&("get"in a?t.__esModule:!a.writable&&!a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return l(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=c(n(0)),d=s(n(12)),f=n(1),h=n(14),p=n(4),m=n(19),v=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},y=u.default.forwardRef(function(e,t){var n=e.endShape,i=void 0===n?p.endShapeDefaultProp:n,o=e.strokeColor,l=void 0===o?"#f00":o,c=e.strokeWidth,s=void 0===c?2:c,y=e.svgContainerStyle,_=void 0===y?{}:y,b=e.noCurves,w=e.children,E=e.className,A=e.endMarker,x=e.lineStyle,C=e.offset,k=e.startMarker,M=e.strokeDasharray,z=e.style,S=a((0,u.useState)({}),2),O=S[0],I=S[1],N=a((0,u.useState)({}),2),j=N[0],T=N[1],D=(0,u.useRef)(new d.default(function(){B()})).current,L=(0,u.useRef)(null),P=a(u.default.useState(),2)[1],R=(0,u.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,u.useImperativeHandle)(t,function(){return{refreshScreen:B,arrowMarkerUniquePrefix:R}});var H,B=u.default.useCallback(function(){return P({})},[]),q=(0,u.useCallback)(function(e,t){T(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),F=(0,u.useCallback)(function(e){T(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),U=(0,u.useCallback)(function(e,t){I(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),V=(0,u.useCallback)(function(e){I(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),W=(0,u.useMemo)(function(){return Object.assign(Object.assign({},g),_)},[_]);H="function"==typeof w?w(f.ArcherContainerContext):w,(0,v.useResizeListener)(B),(0,v.useObserveElements)(O,D);var Q=(0,u.useMemo)(function(){return{registerTransitions:q,unregisterTransitions:F,registerChild:U,unregisterChild:V}},[q,F,U,V]);return u.default.createElement(f.ArcherContainerContextProvider,{value:Q},u.default.createElement("div",{style:Object.assign(Object.assign({},z),{position:"relative"}),className:E},u.default.createElement("svg",{style:W},u.default.createElement("defs",null,u.default.createElement(m.ArrowMarkers,{endShape:i,sourceToTargetsMap:j,strokeColor:l,uniqueId:R})),u.default.createElement(h.SvgArrows,{startMarker:k,endMarker:A,endShape:i,strokeColor:l,strokeWidth:s,strokeDasharray:M,noCurves:b,lineStyle:x,offset:C,parentCurrent:L.current,refs:O,uniqueId:R,sourceToTargetsMap:j})),u.default.createElement("div",{style:{height:"100%"},ref:L},H)))});t.default=y},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var a=r[n];e.call(t,a[1],a[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,a=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=2,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,s=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,a=0;function l(){n&&(n=!1,e()),r&&s()}function c(){i(l)}function s(){var e=Date.now();if(n){if(e-a<o)return;r=!0}else n=!0,r=!1,setTimeout(c,t);a=e}return s}(this.refresh.bind(this),20)};s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},s.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null;var u=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},d=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||a},f=y(0,0,0,0);function h(e){return parseFloat(e)||0}function p(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function m(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=d(e).getComputedStyle(e),a=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var a=r[n],i=e["padding-"+a];t[a]=h(i)}return t}(r),i=a.left+a.right,o=a.top+a.bottom,l=h(r.width),c=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+i)!==t&&(l-=p(r,"left","right")+i),Math.round(c+o)!==n&&(c-=p(r,"top","bottom")+o)),!function(e){return e===d(e).document.documentElement}(e)){var s=Math.round(l+i)-t,u=Math.round(c+o)-n;1!==Math.abs(s)&&(l-=s),1!==Math.abs(u)&&(c-=u)}return y(a.left,a.top,l,c)}var v="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof d(e).SVGGraphicsElement}:function(e){return e instanceof d(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return r?v(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):m(e):f}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e};_.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},_.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var b=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,a=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(i.prototype);return u(o,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),o}(t);u(this,{target:e,contentRect:n})},w=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};w.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _(e)),this.controller_.addObserver(this),this.controller_.refresh())}},w.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},w.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},w.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},w.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new b(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},w.prototype.clearActive=function(){this.activeObservations_.splice(0)},w.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,A=function(e){if(!(this instanceof A))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=s.getInstance(),n=new w(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){A.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var x=void 0!==a.ResizeObserver?a.ResizeObserver:A;t.default=x}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var a=r(n(0)),i=n(15),o=r(n(17)),l=n(3),c=function(e){var t,n,r=e.style||{},c=r.startMarker||e.startMarker,s=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,u=(0,l.createShapeObj)(r,e.endShape),d=e.domAttributes,f=e.cursor,h=e.hitSlop,p=r.strokeColor||e.strokeColor,m=r.strokeWidth||e.strokeWidth,v=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),y=r.lineStyle||e.lineStyle||(g?"angle":"curve"),_=e.offset||0,b=e.source.anchor,w=(0,i.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,A=(0,i.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return w?A?a.default.createElement(o.default,{className:e.className,startingPoint:w,startingAnchorOrientation:b,endingPoint:A,endingAnchorOrientation:E,strokeColor:p,strokeWidth:m,strokeDasharray:v,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:y,offset:_,enableStartMarker:!!c,disableEndMarker:!s,endShape:u,domAttributes:d,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,i.getPointFromElement)(e.parentCurrent);return t?a.default.createElement(a.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return a.default.createElement(c,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var a=r(n(16));function i(e){return new a.default(e.left,e.top)}var o=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=o(e);return t?i(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=o(r[t]);if(!l)return null;var c=function(e,t){switch(e){case"top":return i(t).add(new a.default(t.width/2,0));case"bottom":return i(t).add(new a.default(t.width/2,t.height));case"left":return i(t).add(new a.default(0,t.height/2));case"right":return i(t).add(new a.default(t.width,t.height/2));case"middle":return i(t).add(new a.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return c?c.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=a},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var a=r(n(0)),i=n(18);function o(e,t,n,r,a,o,l,c){var s=(0,i.computeArrowDirectionVector)(a),u=s.arrowX,d=s.arrowY;if("straight"===o&&void 0!==l&&void 0!==c){var f=Math.atan2(c-t,l-e);u=Math.cos(f),d=Math.sin(f)}return{xPoint:e+u*n*r/2,yPoint:t+d*n*r/2}}function l(e,t,n,r,a){return"top"===a||"bottom"===a?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===a||"right"===a?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function c(e,t,n,r,a){return"top"===a||"bottom"===a?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===a||"right"===a?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function s(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=o,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=c,t.computeLabelDimensions=s,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,i=e.endingPoint,u=e.endingAnchorOrientation,d=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,m=e.arrowMarkerId,v=e.lineStyle,g=e.offset,y=e.enableStartMarker,_=e.disableEndMarker,b=e.endShape,w=e.domAttributes,E=e.hitSlop,A=void 0===E?10:E,x=e.cursor,C=void 0===x?"pointer":x,k=b.circle?2*b.circle.radius:2*b.arrow.arrowLength,M=o(n.x,n.y,y?k:0,f,r,v,i.x,i.y),z=M.xPoint,S=M.yPoint,O=o(i.x,i.y,_?0:k,f,u,v,n.x,n.y),I=O.xPoint,N=O.yPoint,j=l(z,S,I,N,r),T=j.xAnchor1,D=j.yAnchor1,L=c(z,S,I,N,u),P=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,a=e.yAnchor1,i=e.xAnchor2,o=e.yAnchor2,l=e.xEnd,c=e.yEnd,s=e.lineStyle,u=e.offset;if(u&&0!==u){var d="straight"===s?Math.atan2(c-n,l-t):Math.atan2(a-n,r-t),f=u*Math.cos(d),h=u*Math.sin(d);"straight"!==s&&(t+=f,n+=h),l-=f,c-=h}var p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(s)&&(p+="".concat("curve"===s?"C":"").concat(r,",").concat(a," ").concat(i,",").concat(o," ")),p+"".concat(l,",").concat(c)}({xStart:z,yStart:S,xAnchor1:T,yAnchor1:D,xAnchor2:L.xAnchor2,yAnchor2:L.yAnchor2,xEnd:I,yEnd:N,lineStyle:v,offset:g}),R=s(z,S,I,N),H=R.xLabel,B=R.yLabel,q=R.labelWidth,F=R.labelHeight,U="url(#".concat(m,")");return a.default.createElement("g",{className:t},a.default.createElement("path",{d:P,style:{fill:"none",stroke:d,strokeWidth:f,strokeDasharray:h},markerStart:y?U:void 0,markerEnd:_?void 0:U}),w&&a.default.createElement("path",Object.assign({d:P,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:A,cursor:w?C:"initial",pointerEvents:"all"}},w)),p&&a.default.createElement("foreignObject",{x:H,y:B,width:q,height:F,style:{overflow:"visible",pointerEvents:"none"}},a.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},a.default.createElement("div",null,p))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var a=r(n(0)),i=n(4),o=n(3),l=function(e,t){return function(){var n,r,o,l,c,s,u,d,f,h,p,m,v=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(o=t.circle)||void 0===o?void 0:o.radius)||i.endShapeDefaultProp.circle.radius,g=(null===(c=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===c?void 0:c.strokeWidth)||(null===(s=t.circle)||void 0===s?void 0:s.strokeWidth)||i.endShapeDefaultProp.circle.strokeWidth,y=(null===(d=null===(u=e.endShape)||void 0===u?void 0:u.circle)||void 0===d?void 0:d.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||i.endShapeDefaultProp.circle.strokeColor,_=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(m=t.circle)||void 0===m?void 0:m.fillColor)||i.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*v,markerHeight:4*v,refX:2*v+g,refY:2*v,path:a.default.createElement("circle",{cx:2*v,cy:2*v,r:v,fill:_,stroke:y,strokeWidth:g})}}},c=function(e,t,n){return function(){var r,o,l,c,s,u,d,f,h=e.strokeColor||n,p=null!==(s=null!==(l=null===(o=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===o?void 0:o.arrowLength)&&void 0!==l?l:null===(c=null==t?void 0:t.arrow)||void 0===c?void 0:c.arrowLength)&&void 0!==s?s:i.endShapeDefaultProp.arrow.arrowLength,m=(null===(d=null===(u=e.endShape)||void 0===u?void 0:u.arrow)||void 0===d?void 0:d.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||i.endShapeDefaultProp.arrow.arrowThickness,v="M0,0 L0,".concat(m," L").concat(p,",").concat(m/2," z");return{markerWidth:p,markerHeight:m,refX:0,refY:m/2,path:a.default.createElement("path",{d:v,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,i=e.uniqueId;return a.default.createElement(a.default.Fragment,null,(0,o.getSourceToTargets)(t).map(function(e){var t=e.source,s=e.target,u=e.style,d=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,a=(0,o.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:c(t,r,n)}[a]()}({style:void 0===u?{}:u,endShape:n,strokeColor:r}),f=d.markerHeight,h=d.markerWidth,p=d.path,m=d.refX,v=d.refY;return a.default.createElement("marker",{id:(0,o.getMarkerId)(i,t,s),key:(0,o.getMarkerId)(i,t,s),markerWidth:h,markerHeight:f,refX:m,refY:v,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}])}(a)),Ire.exports);const jre=({getChildNodeComponent:r,parentNodeIndex:a,parentNodeData:i,verticalLineHeight:o,datasetHeight:l,curveHeights:c,itemRefs:s,datasetRef:u,isReadOnlyMode:d})=>e(t,{children:0===i?.machineInstances?.length?e(t,{children:!d&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:i,parentNodeIndex:a})})]})}):i?.machineInstances?.map((f,h)=>{const p=0===h;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${o}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((o,d)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===d?u:null,children:n("div",{className:"ff-execution-item",ref:e=>s.current[d]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${d}`,style:{height:`${c[d]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${d}`}),Number(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(cF,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:o,runLevelExecutionDataSetIndex:d,parentNodeData:i,parentNodeIndex:a})})]})},o?.runLevelExecutionDataSetId))}),h===i?.machineInstances.length-1&&e(t,{children:!d&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:i,parentNodeIndex:a,childNodeIndex:h+1})})]})})]},h)})}),Tre=({data:t,noOfScripts:r,getChildNodeComponent:i,getParentNodeComponent:c,getParentNodeComponentActionItems:u,childNodeCurveHeight:d=1.28,isReadOnlyMode:f=!1})=>{const h=o(null),[p,m]=s(0),[v,g]=s([]),y=o([]);l(()=>{h.current&&m(h.current.offsetHeight)},[t]);l(()=>{(()=>{const e=y.current.map((e,t)=>0===t?0:p*d);g(e)})()},[p,t]);const _=e=>1+(e.machineInstances?.length+1||0);let b=1;const w=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||hF(e.machineInstances)?1:e.machineInstances.length)(t):e+_(t),0),E=Math.round(w/2);let A=1===E&&f&&2===w||1===E&&!f&&2===w;return e("div",{className:"connecting-branch-container",children:e(Nre.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(Nre.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:A?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(cF,{children:r}),e(cF,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const o=b,l=_(t);b+=l;const s=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(a.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${o} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(Nre.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:c({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),u({parentNodeData:t,parentNodeIndex:r})]})}),e(jre,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:s,datasetHeight:p,curveHeights:v,itemRefs:y,datasetRef:h,getChildNodeComponent:i,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${b}`},children:e(Nre.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:c({isMultiSelect:!0})})})})]})})})},Dre=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},Lre=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:a,mentionUserRef:i})=>{const[c,u]=s(0),d=o([]);if(!t)return null;const f=n.filter(e=>!a||e.name.toLowerCase().startsWith(a.toLowerCase()));l(()=>{u(0)},[a]);const h=p(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),u(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),u(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[c];t&&r(t.name,t.emailId)}},[f,c,t,r]);return l(()=>{d.current[c]&&d.current[c]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:i,children:f.length?f.map((t,n)=>e("div",{ref:e=>d.current[n]=e,className:"mention-option "+(n===c?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(cF,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(cF,{children:"No user name found"})})})})},Pre=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],Rre=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},Hre=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:a,comment:i,depth:c=0,isDisable:u,userDetails:d,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:m=83,isVewMode:v=!1,deleteEnable:g=!0})=>{const[y,_]=s(""),[b,w]=s(!1),[E,A]=s(!1),[x,C]=s(!0),[k,M]=s([]),[z,S]=s(!1),[O,I]=s([]),[N,j]=s({top:0,left:0}),[T,D]=s(""),L=o(null),P=o(null),R=o(null);l(()=>{b&&i?.description&&_(i?.description)},[b,i.description]),l(()=>{const e=Pre(d);M(e)},[d]),l(()=>{const e=(y.match(QU)||[]).map(e=>Rre(e,k)).filter(Boolean);I(e)},[y]),l(()=>{const e=e=>{const t=P.current&&!P.current.contains(e.target)&&L.current&&!L.current.contains(e.target),n=R.current&&!R.current.contains(e.target)&&L.current&&!L.current.contains(e.target);(t||n)&&(S(!1),_(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return z&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[z]);const{modifiedByUname:H,createdByUname:B,modifiedOn:q,createdOn:F}=i||{},U=q??F??(new Date).toLocaleString(),V=H??B??"Anonymous",W=c>2,Q=V?V.charAt(0).toUpperCase():"A";l(()=>{b&&i.description&&_(i.description)},[b,i.description]);const G=()=>{0!==y.trim().length&&(b?(r(i.id,y,O),A(!1),_("")):(C(!0),t(i.id,y,O),A(!1),_("")),b&&w(!1))};l(()=>{(()=>{if(!L.current)return;const e=L?.current,t=b?P?.current:R?.current,n=L.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const a=e.value.slice(0,t);n.textContent=a||".";const i=document.createElement("span");i.textContent=".",n.appendChild(i);const o=i.getBoundingClientRect();return document.body.removeChild(n),{top:o.top-20,left:o.left}})(e,n),a=t?.getBoundingClientRect().height??0,i=e?.getBoundingClientRect();if(!i)return;const o=window.innerHeight-i.bottom,l=i.top;j({top:o<a&&l>a?n-a-16:n+32,left:r.left+10})})()},[y]);const Y=e=>{const t=e.target.value;_(t);const n=(t.match(/@\S+/g)||[]).map(e=>Rre(e,k)).filter(e=>null!==e);I(n);const r=e.target.selectionStart,a=t.slice(0,r),i=a.match($U);D(i?.[1]||"");const o=JU.test(a);S(!!o)},K=e=>{if("@"===e.key)S(!0);else if("Backspace"===e.key&&L.current){const t=L.current.selectionStart,n=y.slice(0,t);n.endsWith("@")&&S(!1);const r=n.match(KU);if(r){e.preventDefault();const a=r[1],i=n.lastIndexOf(a||""),o=y.slice(0,i)+y.slice(t);_(o),S(!1),I(()=>(o.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Rre(e,k)).filter(Boolean)),setTimeout(()=>{L.current?.setSelectionRange(i,i)},0)}}},Z=e=>{if(!L.current)return;const t=L.current.selectionStart,n=y.slice(0,t),r=n.match(GU);if(r){const a=n.lastIndexOf(r[1]||""),i=y.slice(t),o=`@${e.replace(/\s+/g,"")} `,l=y.slice(0,a)+o+i;_(l),S(!1),setTimeout(()=>{L.current?.focus(),L.current?.setSelectionRange(a+o.length+1,a+o.length+1)},0),I(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Rre(e,k)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:i?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${i?.profileImage}`}):Q}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:V}),e("div",{className:"ff-message-time",children:U})]}),n("div",{className:"ff-editable-container",children:[!b&&e(cF,{className:"typography-text",children:i?.description?.split(eV).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),b&&n("div",{className:"inputContainer",children:[e("textarea",{rows:y.length<m?1:3,className:"inputContainer_input first_input",value:y,autoFocus:!0,placeholder:"Edit comment",ref:L,onChange:e=>Y(e),onKeyDown:K}),z&&e("div",{id:"mention-user",style:{position:"absolute",top:`${N.top}px`,left:`${N.left}px`},children:e(Lre,{hasAtSymbol:z,usersObj:k,optionClicked:Z,charsAfterAt:T,mentionUserRef:P})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(pF,{title:b?"Update":"Add",children:e(lF,{name:"comment_reply",hoverEffect:!0,disabled:b&&y.trim()===(i?.description?.trim()??"")||0===y.trim().length,onClick:()=>{G(),w(!1),A(!1)}})})}),e("div",{className:"reply",onClick:()=>{w(!1),A(!1),_("")},children:e(pF,{title:b?"Cancel":"Close",children:e(lF,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!W&&c<2&&i.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>C(e=>!e),children:e(pF,{title:""+(x?"collapse":"expand"),children:e(lF,{name:x?"collapse-arrow":"expand-arrow",disabled:b||E,hoverEffect:!0})})}),!W&&c<2&&0===i.comments?.length&&e("div",{className:"action-icon",children:e(lF,{name:"expand-arrow",disabled:!0})}),!v&&n("div",{className:"ff-comment-action-item",children:[c<2&&e("div",{className:"action-icon",children:e(pF,{title:"Reply",children:e(lF,{name:"comment_icon",disabled:b||u,hoverEffect:!0,onClick:()=>{A(!0)}})})}),h&&e("div",{className:"action-icon",children:e(pF,{title:"Edit",children:e(lF,{name:"edit",disabled:E||u,hoverEffect:!0,onClick:()=>w(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(pF,{title:"Delete",children:e(lF,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||a(i.id)},disabled:b||E||u,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:y.length<m?1:3,className:"inputContainer_input first_input",value:y,autoFocus:!0,placeholder:"Add reply comments",ref:L,onChange:e=>Y(e),onKeyDown:K}),z&&e("div",{id:"mention-user",style:{position:"absolute",top:`${N.top}px`,left:`${N.left}px`},children:e(Lre,{hasAtSymbol:z,usersObj:k,optionClicked:Z,charsAfterAt:T,mentionUserRef:R})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{G(),w(!1),A(!1)},children:e(pF,{title:"Reply",children:e(lF,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!y.length)})})}),e("div",{className:"reply",onClick:()=>{w(!1),A(!1),_("")},children:e(pF,{title:"Cancel",children:e(lF,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),x&&i.comments?.length>0&&e("div",{className:`child-comments ${0===c?"first-level-child":""} ${1===c?"second-level-child":""}`,children:i.comments.map(n=>e("div",{className:`child-comments child-comments-${c+1}`,children:e(Hre,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:a,comment:n,depth:c+1,isDisable:u,userDetails:d,isEditDeleteActionAllowed:i.createdBy===p,createdByID:p,isVewMode:v})},n.id))})]})})},Bre=({commentsData:t,handleAddComment:r,handleEditComment:a,handleDeleteComment:i,onCommentsDataChange:c,currentUser:u,isDisable:d=!1,userDetails:f,createdByID:h,rowBreakCharCount:m=83,isVewMode:v=!1,deleteEnable:g=!0,showTextarea:y=!1,autoFocus:_=!1})=>{const[b,w]=s(""),[E,A]=s([]),[x,C]=s(!1),[k,M]=s([]),[z,S]=s({top:0,left:0}),[O,I]=s(""),N=o(null),j=o(null),[T,D]=s(!1);l(()=>{const e=Pre(f);M(e)},[f]);const L=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=L(n.comments,t);if(e)return e}return null};l(()=>{t&&A(t)},[t]),l(()=>{const e=e=>{j.current&&!j.current.contains(e.target)&&(C(!1),w(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:P,editNode:R,deleteNode:H}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:T2(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),B=(e,t,n)=>{if(!t.trim())return;const a={id:T2(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:u?.createdBy,modifiedBy:u?.modifiedBy,createdByUname:u?.createdByUname,modifiedByUname:u?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};A(t=>P(t,e,a)),r&&r(a,L(E,e))},q=p((e,t,n)=>{const r=R(E,e,t);A(r);const i=L(r,e);a&&a(e,t,i,n)},[E,R,a]),F=p(async e=>{try{if(i){const t=await i(e);if(t?.success){const t=H(E,e);A(t)}}}catch(e){console.error("Error deleting comment:",e)}},[H,i]);l(()=>{c&&c(E)},[E,c]);l(()=>{(()=>{if(!N.current)return;const e=N?.current,t=j?.current,n=N.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const a=e.value.slice(0,t);n.textContent=a||".";const i=document.createElement("span");i.textContent=".",n.appendChild(i);const o=i.getBoundingClientRect();return document.body.removeChild(n),{top:o.top,left:o.left}})(e,n),a=t?.getBoundingClientRect().height??0,i=e?.getBoundingClientRect();if(!i)return;const o=window.innerHeight-i.bottom,l=i.top;S({top:o<a&&l>a?n-a-16:n+32,left:r.left+10})})()},[b]);l(()=>{b.includes("\n")||D(!1)},[b]);return n("div",{className:"ff-comments-container-box",children:[!v&&n("div",{className:"ff-first-comment "+(y?"no-border":""),children:[e(cF,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!y&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:T?3:b.length<m?1:3,autoFocus:_,value:b,onChange:e=>(e=>{const t=e.target.value;w(t);const n=e.target.selectionStart,r=t.slice(0,n),a=r.match($U);I(a?.[1]||"");const i=JU.test(r);C(!!i),t||D(!1)})(e),placeholder:"Add a comment",disabled:d,ref:N,onKeyDown:e=>{if("@"===e.key)C(!0);else if("Backspace"===e.key&&N.current){const t=N.current.selectionStart;if(b.slice(0,t).endsWith("@")&&C(!1),x){e.preventDefault();const n=b.slice(0,t-1)+b.slice(t);w(n);const r=t-1,a=n.slice(0,r).match($U);I(a?.[1]||""),C(!!a),setTimeout(()=>{N.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&D(!0)}}),x&&e("div",{id:"mention-user",style:{position:"absolute",top:`${z.top}px`,left:`${z.left}px`},children:e(Lre,{hasAtSymbol:x,usersObj:k,optionClicked:e=>{if(!N.current)return;const t=N.current.selectionStart,n=b.slice(0,t),r=n.match(YU);if(r){const a=n.lastIndexOf(r[1]??""),i=b.slice(t),o=`@${e} `,l=b.slice(0,a)+o+i;w(l),C(!1),setTimeout(()=>{N.current?.focus();const e=a+o.length+1;N.current?.setSelectionRange(e,e)},0)}},charsAfterAt:O,mentionUserRef:j})}),e("span",{className:"reply-comment",children:e(pF,{title:"Add",children:e(lF,{name:"comment_reply",onClick:()=>{if(!b.trim())return;const e=k.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(b)).map(e=>e.emailId),t={id:T2(),description:b,comments:[],createdBy:u?.createdBy,modifiedBy:u?.modifiedBy,createdByUname:u?.createdByUname,modifiedByUname:u?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),A(e=>[...e,t]),w("")},hoverEffect:!0,disabled:Boolean(!b.length)})})})]})]}),E.length>0&&E.map(t=>e(Hre,{handleInsertNode:B,handleEditNode:q,handleDeleteNode:F,comment:t,depth:0,isDisable:d,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:v,deleteEnable:g},t.id))]})},qre=()=>{const e=o(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},Fre=({isOpen:t,onClose:r,onContinue:a,titleMessage:i="Warning!",subTitleMessage:o="Unsaved Changes.",iconName:l,modalMessage:c="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:s="Cancel",secondButtonLabel:u="Continue",buttonVariant:d="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:p="226",colorForTitleMessage:m="var(--status-button-bg-warning)",footerContent:v,firstButtonDisabled:g=!1,secondButtonDisabled:y=!1,zIndex:_=1100,iconSize:b=94})=>e(hJ,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:_,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(lF,{name:l,className:"warning_modal_icon",width:b,height:b}),n("div",{className:"warning_modal_message",children:[n(cF,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(cF,{color:`${m}`,fontSize:20,fontWeight:"semi-bold",children:[" ",i," "]})," ",o]}),n("div",{className:"warning_modal_message_wrapper",children:[e(cF,{fontSize:16,children:c}),e(cF,{as:"div",children:v})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(sF,{buttonHeight:"24px",variant:"secondary",label:s,onClick:r,disabled:g}),u&&e(sF,{buttonHeight:"24px",variant:d||"warning",label:u,onClick:a,disabled:y})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function Ure(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(DU,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function Vre(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):Ure(e,t)}const Wre=({onSelectVariable:t,dropdownPosition:r,filteredOptions:a=[],position:i="relative",width:o="300px",zIndex:l=1e3,height:c="160px",truncateTextValue:s=34,isTruncateText:u=!1})=>n("div",{className:T("ff-variable-dropdown",i),style:r?{top:r.top+30,left:r.left-30,width:o,zIndex:l}:{width:o,zIndex:l,height:c},children:[a?.map(n=>{const r=u?AF(n?.name,s,"pixel"):n?.name,a=!!u&&xF(n?.name,s,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:u?e(pF,{title:a?n?.name:"",children:e(cF,{children:r})}):e(cF,{children:r})},n?.id)}),0===a?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(cF,{as:"span",fontSize:14,children:"No Option"})})]}),Qre=i(({label:t="",hashInputValue:r="",setHashInputValue:a,variableList:i=[],addForloopPrefix:c=!1,placeholder:u="Enter text",onChange:d,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:m=!1,dataFiles:v=[],showAddVariableIcon:g=!0,helperText:_="",error:b,autoComplete:w="off",showHidePasswordIcon:E=!0,required:A=!1,formProps:x={},onlyDropdown:C=!1,type:k,onFocus:M,onBlur:z,readOnly:S=!1,height:O="160px",truncateTextValue:I=34,isTruncateText:N=!1,...j},T)=>{const[D,L]=s(!1),[P,R]=s(!1),[H,B]=s(!1),[q,F]=s(null),[U,V]=s(0),[W,Q]=s(!1),[G,Y]=s(!1),[K,Z]=s([]),X=o(null);y(T,()=>X.current),l(()=>{null!==q&&X.current&&(X.current.setSelectionRange(q,q),X.current.focus())},[q]),l(()=>{if(m?L(h.startsWith("#")):Y(!h?.includes("$")),h.startsWith("#")&&m){const e=h.slice(1).toLowerCase(),t=v.filter(t=>t.name.toLowerCase().includes(e));Z(t),L(!0)}},[h]),l(()=>{if(!W&&C){const e=v.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));Z(e),L(e.length>0)}Q(!1)},[h]);const J=()=>{X.current&&V(X.current.selectionStart||0)},$=J,ee=J;l(()=>{X.current&&V(X.current.selectionStart||0)},[h]);const te=e=>{if(X.current){const{selectionStart:t,selectionEnd:n}=X.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`;let i;if(i=m&&"#"===h[0]||C?e.name+h.slice(n||1):h.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(h,U)||0)+"$"+r+h.slice(n||0),d){d({target:{value:i}},e)}X.current.value=i,a?.(e),F((t||0)+r.length),L(!1),Q(!0),R(!0)}};const ne=function(e,t,n){let r=!1,a="";const i="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:a};const o=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==o&&(t===o+1?(r=!0,a=""):(a=e.slice(o+1,-1===l?void 0:l),t>o+1&&(a=e.slice(o+1,t)),r=!0),P&&i&&(r=!1),(/[{}]/.test(a)||0===t)&&(r=!1,a=""),a)){n.some(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(a.toLowerCase()))||(r=!1,a="")}return{showDropdown:r,searchString:a}}(h,U,i),[re,ae]=s(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(bV,{readOnly:S,...j,name:"add_variable",ref:X,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,re),value:h,onChange:d,variant:"primary",label:t,placeholder:u,onClick:$,onKeyUp:ee,onFocus:e=>{setTimeout(()=>{B(!0),M?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||B(!1)})(e),z?.(e)},autoComplete:w,helperText:_,error:b,required:A,...x}),"password"===k&&E&&e(pF,{title:re?"Hide":"Show",children:e(cF,{as:"span",className:"ff-password-icon",children:e(lF,{onClick:()=>{ae(e=>!e)},name:re?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!hF(h)&&!m&&G&&g&&e(pF,{title:"Add Variable",children:e(lF,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ne?.showDropdown&&H&&e(xee,{position:"absolute",width:p,optionsList:i.filter(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ne?.searchString.toLowerCase())),onSelectVariable:te,height:O}),D&&(m||C)&&e(Wre,{position:"relative",width:p,filteredOptions:K,zIndex:2e3,onSelectVariable:te,height:O,isTruncateText:N,truncateTextValue:I})]})}),Gre=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var Yre,Kre;var Zre=(Kre||(Kre=1,Yre=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=a},function(e,t,n){var r;
|
|
28
|
+
*/function Y5(){return W5||(W5=1,e=G5,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var i=r-1>>>1,o=e[i];if(!(a(o,t)>0))return;e[i]=t,e[r]=o,r=i}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,c=e[l],s=l+1,u=e[s];if(a(c,t)<0)s<i&&a(u,c)<0?(e[r]=u,e[s]=t,r=s):(e[r]=c,e[l]=t,r=l);else{if(!(s<i&&a(u,t)<0))return;e[r]=u,e[s]=t,r=s}}}(e,n,0)),t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],s=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,v="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(s);null!==a;){if(null===a.callback)r(s);else{if(!(a.startTime<=e))return;r(s),a.sortIndex=a.expirationTime,t(c,a)}a=n(s)}}function b(e){if(m=!1,_(e),!p)if(null!==n(c))p=!0,N(w);else{var t=n(s);null!==t&&j(b,t.startTime-e)}}function w(t,a){p=!1,m&&(m=!1,T()),h=!0;var i=f;try{return function(t,a){var i=a;for(_(i),d=n(c);null!==d&&(!(d.expirationTime>i)||t&&!M());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var l=o(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(c)&&r(c),_(i)}else r(c);d=n(c)}if(null!==d)return!0;var u=n(s);return null!==u&&j(b,u.startTime-i),!1}(t,a)}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,A=null,x=-1,C=5,k=-1;function M(){return!(e.unstable_now()-k<C)}var z,S=function(){if(null!==A){var t=e.unstable_now();k=t;var n=!0;try{n=A(!0,t)}finally{n?z():(E=!1,A=null)}}else E=!1};if("function"==typeof y)z=function(){y(S)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,I=O.port2;O.port1.onmessage=S,z=function(){I.postMessage(null)}}else z=function(){v(S,0)};function N(e){A=e,E||(E=!0,z())}function j(t,n){x=v(function(){t(e.unstable_now())},n)}function T(){g(x),x=-1}var D=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,N(w))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=D,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,a,i){var o,l,d=e.unstable_now();if("object"==typeof i&&null!==i){var f=i.delay;o="number"==typeof f&&f>0?d+f:d}else o=d;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var v=o+l,g={id:u++,callback:a,priorityLevel:r,startTime:o,expirationTime:v,sortIndex:-1};return o>d?(g.sortIndex=o,t(s,g),null===n(c)&&g===n(s)&&(m?T():m=!0,j(b,o-d))):(g.sortIndex=v,t(c,g),p||h||(p=!0,N(w))),g},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),G5;var e}var K5=(Q5||(Q5=1,"production"===process.env.NODE_ENV?U5.exports=(F5||(F5=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,c=e[l],s=l+1,u=e[s];if(0>a(c,n))s<i&&0>a(u,c)?(e[r]=u,e[s]=n,r=s):(e[r]=c,e[l]=n,r=l);else{if(!(s<i&&0>a(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],s=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,v="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(s);null!==a;){if(null===a.callback)r(s);else{if(!(a.startTime<=e))break;r(s),a.sortIndex=a.expirationTime,t(c,a)}a=n(s)}}function b(e){if(m=!1,_(e),!p)if(null!==n(c))p=!0,N(w);else{var t=n(s);null!==t&&j(b,t.startTime-e)}}function w(t,a){p=!1,m&&(m=!1,g(C),C=-1),h=!0;var i=f;try{for(_(a),d=n(c);null!==d&&(!(d.expirationTime>a)||t&&!z());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var l=o(d.expirationTime<=a);a=e.unstable_now(),"function"==typeof l?d.callback=l:d===n(c)&&r(c),_(a)}else r(c);d=n(c)}if(null!==d)var u=!0;else{var v=n(s);null!==v&&j(b,v.startTime-a),u=!1}return u}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,A=!1,x=null,C=-1,k=5,M=-1;function z(){return!(e.unstable_now()-M<k)}function S(){if(null!==x){var t=e.unstable_now();M=t;var n=!0;try{n=x(!0,t)}finally{n?E():(A=!1,x=null)}}else A=!1}if("function"==typeof y)E=function(){y(S)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,I=O.port2;O.port1.onmessage=S,E=function(){I.postMessage(null)}}else E=function(){v(S,0)};function N(e){x=e,A||(A=!0,E())}function j(t,n){C=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,N(w))},e.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"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,a,i){var o=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?o+i:o,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:u++,callback:a,priorityLevel:r,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>o?(r.sortIndex=i,t(s,r),null===n(c)&&r===n(s)&&(m?(g(C),C=-1):m=!0,j(b,i-o))):(r.sortIndex=l,t(c,r),p||h||(p=!0,N(w))),r},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(V5)),V5):U5.exports=Y5()),U5.exports);const Z5=Symbol(),X5=Symbol(),J5="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:d,$5=K5.unstable_runWithPriority?e=>{try{K5.unstable_runWithPriority(K5.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function e6(e,t){const n=u(e)[Z5];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:a},l:i}=n,o=t(r),[l,c]=_((e,n)=>{if(!n)return[r,o];if("p"in n)throw n.p;if(n.n===a)return Object.is(e[1],o)?e:[r,o];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,o]);return Object.is(l[1],o)||c(),J5(()=>(i.add(c),()=>{i.delete(c)}),[i]),l[1]}const t6=function(e){const t=c({[Z5]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[X5]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=o(e),a=o(0),[i,l]=s(null);i&&(i(e),l(null));const c=o();if(!c.current){const e=new Set,t=(t,n)=>{a.current+=1;const r={n:a.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};c.current={[Z5]:{v:r,n:a,l:e,u:t}}}return J5(()=>{r.current=e,a.current+=1,$5(()=>{c.current[Z5].l.forEach(t=>{t({n:a.current,v:e})})})},[e]),m(n,{value:c.current},t)}),delete t.Consumer,t}([B5,()=>{}]),n6=({children:t,useTableRef:n,totalWidth:r})=>{const a=o(null);return l(()=>{n&&a.current&&n(a)},[n]),e("table",{className:"ff-spreadsheet-table",ref:a,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},r6=t=>e("tr",{...t}),a6=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function i6(){return e6(t6,([,e])=>e)}function o6(e){return e6(t6,([t])=>e(t))}const l6=({selected:t,onSelect:n})=>{const a=r.useCallback(()=>{n()},[n]);return e("th",{className:"ff-spreadsheet-corner-header",onClick:a,tabIndex:0,children:e("div",{className:T("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(lF,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},c6=t=>function(n){const a=i6(),i=r.useCallback(()=>a({type:$2}),[a]),o=o6(e=>e.selected instanceof D4);return e(t,{...n,selected:o,onSelect:i})},s6=t=>function(n){const a=i6(),i=r.useCallback((e,t)=>a(function(e,t){return{type:J2,payload:{column:e,extend:t}}}(e,t)),[a]),o=o6(e=>e.selected.hasEntireColumn(n.column)),l=o6(e=>e.selectedColumn??void 0),c=o6(e=>e.active?g4(e.active,e.model.data):void 0);return e(t,{...n,cell:c,selected:o,selectedColumn:l,onSelect:i,scrollToColumn:n.scrollToColumn})},u6=s6(({column:t,label:a,selected:i,onSelect:o,setContextMenu:l,deleteColumn:c,addColumnLeft:s,addColumnRight:u,columnContextEnable:d,cell:f,selectedColumn:p,minimumColumnWidth:m,maxColLimit:v,disableDeleteOption:g,contextMenu:y,onAddColumn:_,onDeleteColumn:b,setVisibleRange:w,scrollToColumn:E})=>{const A=i6(),x=o6(e=>e.model.data),C=o6(e=>e.active),k=m,M=o6(e=>e.columnDimensions[t]?.width||k),z=o6(e=>e.model.data),{columnCount:S}=u5(z),O=r.useRef(x),I=r.useCallback(()=>{if(C){O.current?.[C.row]?.[C.column]!==o5&&O.current?.[0]?.length===x?.[0]?.length||(O.current=x);const e=O.current?.[C.row]?.[C.column]?.value,t=x?.[C.row]?.[C.column]?.value;return e===t}return!1},[C,x,O,o5]),N=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},j=h(()=>{const e=f?.contextDisable?.["Delete Column"]&&I();return[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{N("increment"),s(k),_?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:S>=v},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{N("increment"),u(k),_?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:S>=v},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{N("decrement"),c(),b?.(p??t)},disableTooltip:"",visible:!!e,disable:!1}]]},[p,f,s,u,c,k,S,v,g,_,b,t,I]),D=r.useCallback((e,n)=>{const r=n?t-1:t,a=Math.max(r,0);o(a,e.shiftKey);const i=e.clientX,l=M,c=e=>{const t=Math.max(k,l+(e.clientX-i));A(B3(a,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),A(h4())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),A(f4())},[t,M]),L=r.useCallback(e=>A(l4(e)),[A]),P=r.useCallback(e=>{o(t,e.shiftKey)},[o,t]),R=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:d,contextType:"column",options:j})},[t,p,d,j]);return r.useEffect(()=>{void 0!==p&&"column"===y?.contextType&&l(e=>({open:e.open,contextType:"column",options:j}))},[t,p,d,j,"column"===y?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":i}),style:{minWidth:`${M}px`},onClick:P,onContextMenu:R,tabIndex:0,children:[e(cF,{fontWeight:"medium",children:a??d6(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>D(e,!1),onDoubleClick:()=>A(B3(t,k)),onClick:()=>L({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>D(e,!0),onDoubleClick:()=>A(B3(t,k)),onClick:()=>L({row:-1,column:t})})]},t)});function d6(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const f6=({row:t,label:a,selected:i,onSelect:o,setContextMenu:l,addRowTop:c,addRowBottom:s,deleteRow:u,rowContextEnable:d,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:m,contextMenu:v,setVisibleRange:g,scrollToRow:y})=>{const _=i6(),b=o6(e=>e.rowDimensions[t]?.height||32),w=o6(e=>e.model.data),{rowCount:E}=u5(w),A=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&y(f),n})},x=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{A("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{A("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...m?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{A("decrement"),u()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),C=r.useCallback((e,n)=>{const r=n?t:t-1,a=Math.max(r,0);o(a,e.shiftKey);const i=e.clientY,l=b,c=e=>{const t=Math.max(32,l+(e.clientY-i));_(H3(a,t))},s=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s),_(h4())};document.addEventListener("mousemove",c),document.addEventListener("mouseup",s),_(h4())},[b,t]),k=r.useCallback(e=>_(l4(e)),[_]),M=r.useCallback(e=>{o(t,e.shiftKey)},[t]),z=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:d,contextType:"row",options:x})},[t,d,x,f]);return r.useEffect(()=>{void 0!==f&&"row"===v?.contextType&&l(e=>({open:e.open,contextType:"row",options:x}))},[t,d,x,f,"row"===v?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":i}),style:{height:`${b}px`,minWidth:"60px"},onClick:M,onContextMenu:z,tabIndex:0,children:[e(cF,{fontWeight:"medium",children:void 0!==a?a:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>C(e,!0),onDoubleClick:()=>_(H3(t,32)),onClick:()=>k({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>C(e,!1),onDoubleClick:()=>_(H3(t,32)),onClick:()=>k({row:t,column:-1})})]})},h6=t=>function(n){const a=i6(),i=o6(e=>e.selected.hasEntireRow(n.row)),o=o6(e=>e.active?g4(e.active,e.model.data):void 0),l=o6(e=>e.selectedRow??void 0),c=r.useCallback((e,t)=>a(function(e,t){return{type:X2,payload:{row:e,extend:t}}}(e,t)),[a]);return e(t,{...n,selected:i,cell:o,selectedRow:l,onSelect:c,scrollToRow:n.scrollToRow})},p6=({row:t,column:n,DataViewer:a,active:i,dragging:o,mode:l,data:c,evaluatedData:s,select:u,activate:d,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),m=r.useMemo(()=>({row:t,column:n}),[t,n]),v=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(m,W4(e.currentTarget)),e.shiftKey?u(m):d(m))},[l,f,m,u,d]),g=r.useCallback(e=>{o&&(f(m,W4(e.currentTarget)),u(m))},[f,u,o,m]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(m,W4(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,m]),c&&c.DataViewer&&(a=c.DataViewer),e("td",{ref:p,style:{...c?.style,..."dropDown"===c?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===c?.style?.textDecoration?c?.style?.textDecoration:"none"},className:T("ff-spreadsheet-cell",c?.className,{"ff-spreadsheet-active-cell":i||o}),onMouseEnter:g,onMouseDown:v,tabIndex:0,children:e(a,{row:t,column:n,cell:c,active:i,evaluatedCell:s,setCellData:h,inputValue:()=>null})})},m6=t=>function(n){const{row:a,column:i}=n,o=i6(),l=r.useMemo(()=>({row:a,column:i}),[a,i]),c=r.useCallback(e=>o(c4(l,e)),[o,l]),s=r.useCallback(e=>o(function(e){return{type:t3,payload:{point:e}}}(e)),[o]),u=r.useCallback(e=>o(l4(e)),[o]),d=r.useCallback((e,t)=>o(s4(e,t)),[o]),f=o6(e=>V4(e.active,l)),h=o6(e=>f?e.mode:"view"),p=o6(e=>g4(l,e.model.data)),m=o6(e=>g4(l,e.model.evaluatedData)),v=o6(e=>e.dragging),g=o6(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:v,mode:h,evaluatedData:m,data:p,select:s,activate:u,setCellDimensions:d,setCellData:c})},v6=({cell:r,evaluatedCell:a,active:i})=>{const o=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,a);return e("span","boolean"==typeof o?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:g6(o)}:{className:T("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":r5(o)}),children:i||"dropDown"!==r?.inputType?.type?i||"file"!==r?.inputType?.type?!i&&o:e(t,{children:hF(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(lF,{name:"attachment_icon"})," Attachment"]}):(n=>{if(hF(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(CV,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(o)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[o,e(lF,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function g6(e){return e?"TRUE":"FALSE"}const y6=a.forwardRef(({initialValue:t="",onChange:n,className:r="",style:i={}},c)=>{const s=o(null);a.useImperativeHandle(c,()=>s.current),l(()=>{s.current&&t!==s.current.innerText&&(s.current.innerText=t)},[t]);const u=()=>{if(s.current){const e=s.current.innerText;n?.(e)}};return e("div",{style:i,children:e("div",{ref:s,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void u();s.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:u,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const a=document.createTextNode(t);r.insertNode(a),r.setStartAfter(a),r.collapse(!0),n.removeAllRanges(),n.addRange(r),u()},spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{outline:"none",transition:"border 0.2s",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"inherit",fontSize:"inherit",lineHeight:"normal",minHeight:"24px",verticalAlign:"middle",caretColor:"black",height:"inherit",maxHeight:"inherit",display:"block",position:"relative",paddingBottom:"2px"}})})}),_6=({onChange:t,cell:n})=>{const a=r.useRef(null),i=r.useCallback(e=>{t({...n,value:e,style:n?.style,inputType:n?.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{a.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(a.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(y6,{ref:a,initialValue:n?.value??"",onChange:i,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},b6=t=>{const a=r.useRef(null),i=r.useRef(null),o=i6(),l=r.useCallback((e,t)=>o(c4(e,t)),[o]),c=r.useCallback(e=>o(l4(e)),[o]),s=r.useCallback(()=>o({type:c3}),[o]),u=r.useCallback(e=>o({type:T3,payload:{autofill:e}}),[o]),d=r.useCallback(e=>o(function(e){return{type:m3,payload:{changes:e}}}(e)),[o]),f=r.useCallback(()=>{o({type:s3})},[o]),h=o6(e=>e.rowDimensions),p=o6(e=>e.active),m=o6(e=>e.mode),v=o6(e=>e.active?g4(e.active,e.model.data):void 0),g=o6(e=>e.selected),y=o6(e=>g&&$4(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),_=o6(e=>{let t=p?X4(p,e.rowDimensions,e.columnDimensions):void 0;return t={top:t?.top?t?.top:0,height:t?.height?t?.height:0,left:t?.left?t?.left:0,width:t?.width?t?.width:0},t}),b=r.useMemo(()=>!p||!_||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,_,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),E=r.useRef(null),A=r.useRef(void 0),x=r.useCallback(e=>{p&&l(p,e)},[l,p]),[C,k]=r.useState({value:"",name:""}),[M,z]=r.useState(!1),[S,O]=r.useState(),[I,N]=r.useState([]);r.useEffect(()=>{v&&p&&t.getActiveCell({value:v.value,active:p});const n=a.current;if(!b&&n){if(n.focus({preventScroll:!0}),"file"===v?.inputType?.type&&v?.value)try{const e=JSON.parse(v.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));N(e)}catch(e){console.error("Error parsing cell value for files:",e),N([])}else N([]);if("dropDown"===v?.inputType?.type){k({value:v?.value,name:v?.value}),z(e=>!e);const t=v?.inputType?.options?.map(t=>({disable:t.disable,label:e("span",{style:{color:t.color},children:t.label}),value:t.value}));O(t)}}},[a,b,p]),r.useEffect(()=>{const e=E.current,t=A.current;if(E.current=p,A.current=v,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==m){const e=w.current;t!==e?d([{prevCell:e||null,nextCell:t}]):n||v===t||d([{prevCell:t,nextCell:v||null}]),w.current=v}});const j=v&&v.DataEditor||t.DataEditor,D=v&&v.readOnly,L=r.useCallback(e=>{p&&(e.preventDefault(),u(!0))},[c,u,p]),P=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),R=y?.height!==_?.height||y?.width!==_?.width,H=r.useCallback(e=>{p&&R&&(s4(p,W4(e.currentTarget)),c(p))},[p,R]),B=t.isAtRight?t.maxWidth-(_?.left-t.scrollPos.left)+100:t.maxWidth,q=t.isAtBottom?t.maxHeight-(_?.top-t.scrollPos.top)+64:t.maxHeight,F=["file","dropDown"].includes(v?.inputType?.type||"");return n("div",{ref:a,className:T("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${m}`,{"ff-spreadsheet-active-cell--hidden":b,"ff-spreadsheet-active-cell--dragging":R&&"text"!==v?.inputType?.type}),onMouseDown:H,style:{..._,backgroundColor:v?.style?.backgroundColor,...F?{display:"flex",alignItems:v?.style?.alignContent,justifyContent:v?.style?.textAlign}:{},..."edit"===m&&p?{minWidth:Math.min(_?.width,t.maxWidth),minHeight:Math.min(_?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${q}px`,overflow:"auto",..."dropDown"===v?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:P,onClick:"view"!==m||D?void 0:s,tabIndex:0,children:[e("div",{className:F?"":"active-cell-main",children:"dropDown"===v?.inputType?.type?e(AW,{...v?.inputType?.inputProps,dropDownRef:i,showOptions:{open:!("edit"!==m||!p),toggle:M},selectedOption:C,optionsList:S||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{k({value:e.value,name:e.label}),x({...v,value:e.value,style:v?.style,inputType:v?.inputType})}}):"file"===v?.inputType?.type?e(q2,{...v?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&v?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(v.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],a=Array.from(r).indexOf(n);if(-1===a||!e[a])return void console.error("File index not found or invalid");const i=e[a];t.attachmentAction.viewAttachment(i.id,i.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:I,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===v?.inputType?.type){let n=[];try{v?.value&&(n=JSON.parse(v.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const a=e.filter((e,t,a)=>{const i=e.name.split("*")[0],o=a.findIndex(e=>e.name.split("*")[0]===i)!==t,l=n.some(e=>e.name.split("*")[0]===i);return!o&&!l||(r++,!1)});if(n.length+a.length>5)return void iY.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&a.length>0)try{let e=0,r=0,i=0;const l=I?.length+a?.length,c=l>0?25*l:1,s=[...n],u=a?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(u)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:a}=t.value;"success"===n&&a?.id&&a?.name?(s.push(a),e++):"existing"===n&&a?.name?s.push(a):"memory_full"===n?i++:r++}else r++}),e>0||s.length>n.length){const e=s.length>0?JSON.stringify(s):"";x({...v,value:e,style:v?.style,inputType:v?.inputType}),o(H3(p?.row||0,Math.max(c,h?.[p.row]?.height||c))),N(s.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}i>0&&iY.info("No memory available to add the file"),e>0&&iY.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&iY.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),iY.error("Operation failed")}}else if("DELETE"===r&&"file"===v?.inputType?.type)try{let e=[...v&&JSON.parse(v.value)],r=0;for(const a of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===a.name.split("*")[0]),i=e[n]?.id;if(-1!==n&&i&&t.attachmentAction?.deleteAttachment)try{const o=await t.attachmentAction.deleteAttachment(i);"SUCCESS"===o||"object"==typeof o&&null!==o&&("status"in o&&"SUCCESS"===o.status||"responseCode"in o&&200===o.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${a.name}: Invalid response`,o)}catch(e){console.error(`Delete error for ${a.name}:`,e),iY.error("Error deleting file")}else console.error(`Cannot delete ${a.name}: Invalid fileId or no match`,{index:n,fileId:i,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),iY.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";x({...v,value:t,style:v?.style,inputType:v?.inputType}),N(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),iY.success(`${r} file${r>1?"s":""} deleted successfully`)}else if(n?.length){const t=e?.filter(e=>e.id&&e.name);if(t.length<e.length){const e=t.length>0?JSON.stringify(t):"";x({...v,value:e,style:v?.style,inputType:v?.inputType}),N(t.map(e=>new File([new Blob],e.name.split("*")[0]))),iY.error("Failed to delete file(s). Invalid file data detected.")}else iY.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),iY.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),iY.error("Operation failed")}},disabled:!t.editable,maxFiles:5,buttonLabel:"+ Attachments",buttonVariant:"tertiary",deleteButton:t.editable,selectedFileMessage:"Duplicate attachments not allowed within the same row",addAttachmentButton:t.editable,isInfoIconRequired:!1,truncateMaxLimit:(_?.width??0)-60}):"edit"===m&&p&&t.editable?e(j,{row:p.row,column:p.column,cell:v,onChange:x,exitEditMode:f}):e(y6,{initialValue:v?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...v?.style,textDecoration:"underline"===v?.style?.textDecoration?"underline":"none",backgroundColor:R?"#1e161f00":v?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(v?.inputType?.type??"")&&("edit"===m||p&&e("div",{onMouseDown:L,className:"select_dot"}))]})},w6=({dimensions:t,dragging:n,hidden:r,variant:a})=>{const i=o6(e=>e.active),o=o6(e=>e.autoFill),l=o6(e=>i?X4(i,e.rowDimensions,e.columnDimensions):void 0),{width:c,height:s,top:u,left:d}=t||{};let f=l?.height??0,h=l?.width??0,p=c,m=s;return o.open&&c&&s&&l&&(c-h>s-f?(p=c,m=l.height):(m=s,p=l.width)),e("div",{className:T("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${a}`]:a,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(m??0)+1,top:u,left:d}})},E6=({scrollPos:t={top:0,left:0}})=>{const n=o6(e=>e.selected),a=o6(e=>e.dragging),i=o6(e=>e.selected.size(e.model.data)<2),o=o6(e=>n&&$4(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(o)return{...o,top:o.top,left:o.left,height:o.height-1,width:o.width-1}},[o,t]);return e(w6,{variant:"selected",dimensions:l,dragging:a,hidden:i||!o})},A6=({scrollPos:t={top:0,left:0}})=>{const n=o6(e=>e.copied),a=null===n,i=o6(e=>n&&J4(e.rowDimensions,e.columnDimensions,n)),o=r.useMemo(()=>{if(i)return{...i,top:i.top,left:i.left,height:i.height-1,width:i.width-1}},[i,t]);return e(w6,{variant:"copied",dimensions:o,hidden:a||!i,dragging:!1})},x6=({getColorValue:t,disabled:n,initialColor:r})=>{const a=o(null),[i,l]=s(r);return e("div",{className:T("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:i},onClick:()=>{a.current&&!n&&a.current.click()},children:e("input",{type:"color",disabled:n,className:T("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:a,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},C6=e=>{switch(e.toUpperCase()){case"LEFT":default:return"left";case"RIGHT":return"right";case"CENTER":return"center";case"JUSTIFY":return"justify";case"BOTTOM":return"end";case"TOP":return"start"}},k6=e=>{switch(e){case"left":return"LEFT";case"right":return"RIGHT";case"center":return"CENTER";case"justify":return"JUSTIFY";case"end":default:return"BOTTOM";case"start":return"TOP"}},M6=e=>c5.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function z6(e){const{border:t}=e;let n="",r="",a="",i="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(a="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(i="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:a5(M6(String(e.size))),fontFamily:(o=e.name,l5.some(e=>e.label===o)?o:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:a,borderLeft:i,textAlign:C6(e.alignment.horizontal),alignContent:C6(e.alignment.vertical)};var o}const S6=e=>{if(!e||"none"===e)return"THIN";if(e.includes("solid")||e.includes("dashed")||e.includes("dotted")){if(e.includes("2px")||e.includes("medium"))return"MEDIUM";if(e.includes("3px")||e.includes("medium"))return"THICK"}return"THIN"},O6=e=>({name:e.fontFamily||"Arial",size:i5(e.fontSize?.toString()||"12"),bold:"bold"===e.fontWeight,italic:"italic"===e.fontStyle,underline:"underline"===e.textDecoration,color:e.color?.replace("#","")||"000000",backgroundColor:e.backgroundColor?.replace("#","")||"FFFFFF",borderColor:"F2F2F2",border:{top:S6(e.borderTop?e.borderTop.toString():void 0),right:S6(e.borderRight?e.borderRight.toString():void 0),bottom:S6(e.borderBottom?e.borderBottom.toString():void 0),left:S6(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:k6(e.textAlign),vertical:k6(e.alignContent),wrapText:!1}}),I6=({toolbar:t="show",editable:r,onBold:a,onItalic:i,setUnderlineType:c,setColor:u,setFontSize:d,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:m,setFormatePainter:v})=>{const g=o6(e=>e.selected instanceof D4),[y,_]=s("disable"===t||!r),b=o6(e=>e.active?g4(e.active,e.model.data):null),w=o6(e=>e.model.data),E=o6(e=>e.formattedStyle.open),A={...o5.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[x,C]=s(b?.style||A),k=o(null);l(()=>{b?.style&&JSON.stringify(b.style)!==JSON.stringify(x)&&C(b?.style||A),g?_(!r):b&&"boolean"==typeof b.readOnly&&_(b.readOnly||"disable"===t||!r||"dropDown"===b?.inputType?.type)},[b,r]);const M=O6(x),[z,S]=s("border-none"),[O,I]=s({label:"",value:""}),[N,j]=s({label:"",value:""}),[T,D]=s({color:A.color,backgroundColor:A.backgroundColor,borderColor:A.borderColor}),L=[{value:"border-all-sides",label:"All Border",icon:"all_borders"},{value:"border-bottom",label:"Border Bottom",icon:"border_bottom"},{value:"border-left",label:"Border Left",icon:"border_left"},{value:"border-right",label:"Border Right",icon:"border_right"},{value:"border-top",label:"Border Top",icon:"border_top"},{value:"border-none",label:"No Border",icon:"no_border"}],P=c5.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{u(w,T.color)},0);return()=>{clearTimeout(e)}},[T.color]),l(()=>{let e=setTimeout(()=>{p(w,T.backgroundColor)},0);return()=>{clearTimeout(e)}},[T.backgroundColor]);return l(()=>{const e=x.fontFamily,t=`${i5(x.fontSize)}`;I({label:e??"Times New Roman",value:e??"Times New Roman"}),j({label:t??"11",value:t??"11"})},[x]),n("div",{className:"ff-excel-toolbar",children:[n("div",{className:"ff-excel-toolbar-font ",children:[e("div",{className:"ff-excel-toolbar-font-family",children:e(AW,{disabled:y,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{I({label:e.label,value:e.label}),f(w,e.value)},required:!1,optionsList:l5,selectedOption:O})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(AW,{disabled:y,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{j({label:e.label,value:e.value}),d(w,e.value)},optionsList:P,selectedOption:N})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(pF,{placement:"top",title:"Text Left",children:e(lF,{disabled:y,variant:"left"===x.textAlign?"dark":"light",hoverEffect:"left"!==x.textAlign,onClick:()=>h(w,"left"),name:"text_align_left"})}),e(pF,{placement:"top",title:"Text Center",children:e(lF,{disabled:y,variant:"center"===x.textAlign?"dark":"light",hoverEffect:"center"!==x.textAlign,onClick:()=>h(w,"center"),name:"text_align_center"})}),e(pF,{placement:"top",title:"Text Right",children:e(lF,{disabled:y,variant:"right"===x.textAlign?"dark":"light",hoverEffect:"right"!==x.textAlign,onClick:()=>h(w,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(pF,{placement:"top",title:"Bold",children:e(lF,{disabled:y,variant:M.bold?"dark":"light",hoverEffect:!M.bold,onClick:()=>a(w),name:"bold"})}),e(pF,{placement:"top",title:"Italic",children:e(lF,{disabled:y,variant:M.italic?"dark":"light",hoverEffect:!M.italic,onClick:()=>i(w),name:"italic"})}),e(pF,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(lF,{disabled:y,variant:"underline"===x.textDecoration?"dark":"light",hoverEffect:"underline"!==x.textDecoration,onClick:()=>c(w),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(pF,{placement:"top",title:"Format Painter",children:e(lF,{disabled:y,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{v(w)},name:"formate_painter"})}),e(pF,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(lF,{disabled:y,hoverEffect:!0,width:12,height:12,onClick:()=>{u(w,T.color)},name:"text_color"}),e(x6,{disabled:y,getColorValue:e=>{D(t=>({...t,color:e}))},initialColor:T.color})]})}),e(pF,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(lF,{disabled:y,hoverEffect:!0,width:12,height:12,onClick:()=>p(w,T.backgroundColor),name:"fill_color"}),e(x6,{disabled:y,getColorValue:e=>{D(t=>({...t,backgroundColor:e}))},initialColor:T.backgroundColor})]})})]}),e("div",{className:"ff-excel-toolbar-divider"}),e("div",{className:"ff-excel-toolbar-menu",children:n("div",{className:"ff-excel-toolbar-menu-option",children:[e(pF,{placement:"top",title:"Border Type",children:e(lF,{hoverEffect:!0,disabled:y,onClick:()=>m(w,z,"var(--input-hover-border-color)"),name:(()=>{const e=L.find(e=>e.value===z);return e?e.icon:""})()})}),e("span",{ref:k,children:e(SW,{disabled:y,iconName:"arrow_down",targetRef:k,iconSize:12,zIndex:2e3,options:L,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;m(w,t,"var(--input-hover-border-color)"),S(t)}})})]})})]})},N6=(e,t)=>{let n,r=null;const a=function(...a){const i=this;null===r||Date.now()-r>=t?(e.apply(i,a),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(i,a),r=Date.now()},t-(Date.now()-r)))};return a.cancel=()=>{n&&clearTimeout(n),n=null,r=null},a},j6=r.forwardRef(function(t,a){const{className:i,columnLabels:o=[],rowLabels:l=[],toolbar:c,editable:s,onKeyDown:u,Table:d=n6,Row:f=r6,sheetHeight:h,HeaderRow:p=a6,DataEditor:m=_6,DataViewer:v=v6,onSelect:g=()=>{},onActivate:y=()=>{},onEvaluatedDataChange:_=()=>{},contextOption:b,attachmentAction:w,workRef:E,minimumColumnWidth:A,setContextMenu:x,maxRowLimit:C,maxColLimit:k,disableDeleteOption:M,contextMenu:z,getActiveCell:S,onAddColumn:O,onDeleteColumn:I}=t,N=t.minimumColumnWidth||100,j=r.useRef(!1),D=o6(e=>e.model.data),[L,P]=r.useState(!1),[R,H]=r.useState(0),[B,q]=r.useState(0),[F,U]=r.useState({top:0,left:0}),[V,W]=r.useState(!1),[Q,G]=r.useState(!1),Y=r.useMemo(()=>{const e=t.createFormulaParser||f5,n=new g5(e,t.data);return P(e=>!e),{...B5,model:n,selected:t.selected||B5.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(q5,Y),[Z,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:a}=C4(e);return{rows:t?Math.max(a,t.length):a,columns:n?Math.max(r,n.length):r}}(Z.model.data,l,o),[Z.model.data,l,o]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Z.rowDimensions[n]?.height||32;return t},[Z.rowDimensions,32]),ae=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Z.columnDimensions[n]?.width||N;return t},[Z.columnDimensions,N]),ie=re(J.rows),oe=ae(J.columns),le=re($.start),ce=ie-re($.end),se=ae(te.start),ue=oe-ae(te.end),de=Z.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(R3),me=he(m4),ve=he(p4),ge=he(v4),ye=he(u4),_e=he(d4),be=he(r4),we=he(f4),Ee=he(h4),Ae=he(a4),xe=he(i4),Ce=he(o4),ke=he(q3),Me=he(F3),ze=he(V3),Se=he(G3),Oe=he(W3),Ie=he(Q3),Ne=he(U3),je=he(Y3),Te=he(K3),De=he(Z3),Le=he(P3),Pe=he(X3),Re=he(J3),He=he($3),Be=he(e4),qe=he(t4),Fe=he(n4);r.useImperativeHandle(a,()=>({removeSelect:ge}));const Ue=r.useRef(Z.active);r.useEffect(()=>{if(Z.active!==Ue.current)if(Z.active)y(Z.active);else{const e=E.current;e&&n5(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=Z.active},[y,Z.active]);const Ve=r.useRef(Z.model.evaluatedData);r.useEffect(()=>{Z?.model?.evaluatedData!==Ve?.current&&_(Z?.model?.evaluatedData),Ve.current=Z.model.evaluatedData},[Z?.model?.evaluatedData,_]);const We=r.useRef(Z.selected);r.useEffect(()=>{Z.selected.equals(We.current)||t.selected&&Z.selected.equals(t.selected)||g(Z.selected),We.current=Z.selected},[Z.selected,g,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&Ce(t.selected),Qe.current=t.selected},[t.selected,Ce]);let Ge=r.useRef(t.data);r.useEffect(()=>{pe(s),t.data!==Ge.current&&Ae(t.data),Ge.current=t.data},[t.data,Ae,s]);const Ye=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ye.current&&t.createFormulaParser&&xe(t.createFormulaParser),Ye.current=t.createFormulaParser},[t.createFormulaParser,xe]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Z,{data:r}=t,a=n.toRange(r);if(a){!function(e,t){e.clipboardData?.setData(F4,t)}(e,e5(function(e,t,n){const r=[],a=t.column-e.column;for(let i=e.row;i<=t.row;i++){const o=i-e.row;r[o]=r[o]||Array(a);for(let a=e.column;a<=t.column;a++)r[o][a-e.column]=g4({row:i,column:a},n)}return r}(a.start,a.end,r)))}},[Z]),Ze=r.useCallback(e=>{t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[de,Ke,me]),Xe=r.useCallback(e=>{t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),Ke(e),ve())},[de,Ke,ve]),Je=r.useCallback(e=>{if(t5(fe.current,de)&&(e.preventDefault(),e.stopPropagation(),e.clipboardData)){const t=function(e){return window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?e.clipboardData.getData(F4):""}(e);ye(t)}},[de,ye]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),ke(D)):t&&"i"===n?(e.preventDefault(),Me(D)):t&&"u"===n&&(e.preventDefault(),ze(D)),u&&u(e),e.defaultPrevented||(function(e,t){return void 0!==P5(e,t)}(Z,e)&&e.nativeEvent.preventDefault(),_e(e))},[Z,u,_e]),et=r.useCallback(()=>{Z.formattedStyle.open&&Z.active&&Le(Z.active)},[Z]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Z.dragging||1!==e.buttons||"view"!==de||(we(),document.addEventListener("mouseup",tt))},[Z,we,tt,de]),rt=r.useMemo(()=>m6(t.Cell||p6),[t.Cell,L,s]),at=r.useMemo(()=>c6(t.CornerIndicator||l6),[t.CornerIndicator,L]),it=r.useMemo(()=>h6(t.RowIndicator||f6),[t.RowIndicator,L]),ot=r.useMemo(()=>s6(t.ColumnIndicator||u6),[t.ColumnIndicator,L]);r.useEffect(()=>(document.addEventListener("cut",Ze),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ze),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ze,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;q(Math.min(fe.current.clientHeight,n)),H(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},ct=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:a,clientWidth:i}=t;U({top:n,left:a});let o=0;for(;o<J.rows&&re(o)<n;)o++;let l=o;for(;l<J.rows&&re(l)<n+r;)l++;o=Math.max(0,o-10),l=Math.min(J.rows,l+10),ee({start:o,end:l});const c=l===J.rows;W(c);let s=0;for(;s<J.columns&&ae(s)<a;)s++;let u=s;for(;u<J.columns&&ae(u)<a+i;)u++;s=Math.max(0,s-10),u=Math.min(J.columns,u+10),ne({start:s,end:u});const d=u===J.columns;G(d),z.open&&x({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ae]),st=r.useMemo(()=>N6(ct,16),[ct]),ut=e=>{j.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Z.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},dt=e=>{j.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Z.columnDimensions?.[n]?.width||N;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{j.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,j.current]);const ft=U4($.end,$.start),ht=U4(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${se}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Z.columnDimensions[t]?.width||N}px`}},t)),e("col",{style:{width:`${ue}px`}},"right-spacer")," "]}),mt=r.useMemo(()=>n(d,{useTableRef:lt,totalWidth:oe,children:[pt,n("tbody",{children:[n(p,{children:[e(at,{}),e("div",{className:"spacer left"}),ht.map(n=>e(ot,{column:n,minimumColumnWidth:A,setContextMenu:t.setContextMenu,label:n in o?o[n]:void 0,deleteColumn:Fe,addColumnLeft:He,addColumnRight:Be,columnContextEnable:t.columnContextEnable,maxColLimit:k,disableDeleteOption:M,contextMenu:z,onAddColumn:O,onDeleteColumn:I,setVisibleRange:ne,scrollToColumn:dt},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(it,{label:r in l?l?.[r]:void 0,row:r,addRowTop:Pe,addRowBottom:Re,deleteRow:qe,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:C,disableDeleteOption:M,contextMenu:z,setVisibleRange:ee,scrollToRow:ut},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:v},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${ce}px`}})]})]}),[d,J.rows,J.columns,f,p,at,o,ot,l,it,rt,v,$,te,le,ce,se,ue,Z.rowDimensions,Z.columnDimensions]),vt=r.useMemo(()=>e(b6,{attachmentAction:w,contextOption:b,getActiveCell:S,setContextMenu:t.setContextMenu,DataEditor:m,visibleRowRange:$,visibleColRange:te,maxHeight:B-64,maxWidth:R-A,totalHeight:ie,totalWidth:oe,isAtBottom:V,isAtRight:Q,scrollPos:F,editable:s}),[m,$,te,Z.active,B,R,ie,oe,V,Q,s]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${R}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),e("div",{style:{height:`${B}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(c||""),"ff-excel-header-hider":"hide"===c})}),"hide"!==c&&e("div",{className:"ff-excel-toolbar-container",children:e(I6,{editable:s,toolbar:c,onBold:ke,onItalic:Me,setUnderlineType:ze,setColor:je,setBorderType:Ne,setFontSize:Oe,setFontFamily:Ie,setTextAlign:Se,setBackgroundColor:Te,setFormatePainter:De})}),n("div",{ref:fe,style:{height:h},className:T("ff-excel-spreadsheet",i),onKeyPress:be,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>st(e),children:[mt,vt,e(E6,{scrollPos:F}),e(A6,{scrollPos:F})]})]}),[i,be,$e,nt,mt,vt,R]);return e(t6.Provider,{value:K,children:gt})}),T6=({contextMenu:t,position:r,editable:a})=>{if(!t.open)return null;return a&&e("div",{onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},className:"ff-excel-menu",style:{left:r.x,top:r.y,position:"absolute",zIndex:9999999999},children:t.options.map(t=>{if(!t.visible){const a=t.disable;return e(pF,{title:a?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(a?"disabled":""),onClick:()=>{a||t.action()},children:[t.iconName&&e(lF,{name:t.iconName,height:16,width:16,color:(r=t.label,r.includes("Delete")?"var(--label-edit-error-text)":"var(--brand-color)"),disabled:a}),e(cF,{as:"label",children:t.label})]})},t.label)}var r;return null})})},D6=({excelData:r,contextOption:i,toolbar:c="show",sheetBar:u="show",rowCount:d=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:m=0,contextWidthPositioning:v=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:y,attachmentAction:_={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:b=3e3,scroller:w=!1,columnContextEnable:E=!0,rowContextEnable:A=!0,sheetBarContextEnable:x=!0,minimumColumnWidth:C=100,disableDeleteOption:k=!1,maxRowLimit:M=1/0,maxColLimit:z=1/0,maxSheetLimit:S=1/0,getActiveCell:O=()=>{}})=>{const I=o(null),[N,j]=s([]),[D,L]=s(""),[P,R]=a.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[H,B]=s({name:"defaultSheet",index:0}),[q,F]=s({defaultSheet:[[o5]]}),[U,V]=s([[o5]]),[W,Q]=s((g.length,{})),[G,Y]=s({x:0,y:0}),K=o(""),Z=o(null),X=o(null),J=o(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);j(t),hF(t.length)||(K.current=t[0]||"",B({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,a=e.data,i=Math.max(d,a.length),o=Math.max(f,Math.max(...a.map(e=>e.length)));let l=Array.from({length:i},()=>Array(o).fill({value:"",style:o5.style,readOnly:!1,inputType:void 0}));a.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<i&&n<o&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:hF(e?.style)?o5.style:z6(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const c=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const a=c.has(`r${n+1}`)||c.has(`c${r+1}`)||c.has(`${n+1},${r+1}`),i=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||o5);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:a,inputType:i,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=a[0]||[];r[t]=Array.from({length:o},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),F(n),g.length>1&&Q(r);const a=Object.keys(n)[0];a&&void 0!==n[a]&&V(n[a])}},[r]),l(()=>{y&&y(D),"File saved"===D&&setTimeout(()=>{L("")},2e3)},[D]),l(()=>{L("Saving..."),$(te())},[q,K.current]);const $=a.useCallback(HW(e=>{if(g.length>1){const t={...W};N.forEach((n,r)=>{const a=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:a[t]||""}))}),Q(t);const n=N.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);L("File saved")},b),[g,W,N]),ee=a.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),$(te()))},[g]);a.useEffect(()=>(document.addEventListener("keydown",ee),()=>{document.removeEventListener("keydown",ee)}),[ee]);const te=()=>N.map(e=>{const t=q[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:O6(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:hF(n.length)?[[]]:n}}),[ne,re]=s(null),ae=()=>N.length>=S,ie=()=>{if(ae())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,a=2;for(;n.includes(r.toLowerCase());)r=`${e}${a}`,a++;return r})("Sheet",N),t=Array.from({length:d},()=>Array.from({length:f},()=>o5));j(t=>[...t,e]),B({index:N?.length,name:e}),F({...q,[e]:t}),V(t),g.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),K.current=e},oe=(e=[[o5]])=>{V(e)},le=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void re(null);const a=(r.textContent||"").trim();if(!a)return iY.warning("Sheet name cannot be empty."),r.textContent=H.name,void re(null);if(a.length>50)return iY.warning("The sheet name cannot be greater than 50 characters"),r.textContent=H.name,void re(null);if(N.map(e=>e.toLowerCase()).includes(a.toLowerCase())&&n.trim()?.toLowerCase()!==a?.toLowerCase())return iY.warning("Sheet name already exists"),r.textContent=H.name,void re(null);let i=N;oe(q?.[n]),i.splice(t,1,a);const o=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...a}=e;return{...a,[n]:r??[]}}(q,n,a);K.current=a,B(e=>({...e,name:a})),F(o),g.length>1&&Q(e=>{const t={...e},r=t[n];return delete t[n],t[a]=r??[],t}),re(null)};const ce=(e,t)=>{e!==H.name&&t!==H.index&&(B({index:t,name:e}),j(n=>{const r=[...n];return r[t]=e,r}),oe(q[e]),K.current=e)},se=a.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&P.open&&(R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[P.open]);a.useEffect(()=>(document.addEventListener("contextmenu",se),document.addEventListener("click",e=>se(e,!0)),()=>{document.removeEventListener("contextmenu",se),document.removeEventListener("click",e=>se(e,!0))}),[se]);const ue=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ie(),disableTooltip:"Sheet limit reached",visible:!1,disable:ae()},...k?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(N.length>1){let n=N.slice();n.splice(t,1);const r={...q};delete r[e];const a=Math.min(t,n.length-1);j(n),F(r),g.length>1&&Q(t=>{const n={...t};return delete n[e],n});const i=n[a]?n[a]:"";B({index:a,name:i}),oe(r?.[i]),K.current=i}else iY.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];R(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{J.current?.removeSelect()},[H.name]);return e(t,{children:N.length>0&&n("div",{ref:Z,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=X.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let a=e.clientX-(t?.left||0)+n,i=e.clientY-(t?.top||0)+r;const o=300,l=window.innerWidth,c=window.innerHeight,s=l-e.clientX,u=e.clientX,d=c-e.clientY,f=e.clientY;s<o&&u>=o?a=e.clientX-(t?.left||0)+n-150:a+=2,d<200&&f>=200?i=e.clientY-(t?.top||0)+r-20:i+=2,e.target.classList.contains("ff-excel-tab-list")?Y({x:a,y:i-(k?32:65)}):(a+o>l&&(a=l-o-2),a<0&&(a=2),Y({x:a+v,y:i+m}))},onClick:e=>{e.stopPropagation(),P.open&&R({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},children:[e("div",{ref:X,className:"ff-excel-sheet",children:e(j6,{ref:J,editable:p,attachmentAction:_,toolbar:c,sheetHeight:h,setContextMenu:R,contextOption:i,data:U,columnContextEnable:E,rowContextEnable:A,minimumColumnWidth:C,onEvaluatedDataChange:e=>{F(t=>({...t,[K.current]:e}))},workRef:Z,scroller:w,maxRowLimit:M,maxColLimit:z,disableDeleteOption:k,contextMenu:P,getActiveCell:O,onAddColumn:(e,t)=>{g.length>1&&Q(n=>{const r=H.name,a=[...n[r]||[]],i=t?e:e+1;return a.splice(i,0,{newData:"",oldData:""}),{...n,[r]:a}})},onDeleteColumn:e=>{g.length>1&&Q(t=>{const n=H.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},H.name)}),"hide"!==u&&n("div",{className:"ff-excel-sheet-bar",children:["show"===u&&n("div",{className:"ff-excel-add-sheet-set",children:[e(pF,{title:ae()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(lF,{disabled:!p||ae(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ie,name:"plus_icon",height:20,width:20})}),e(SW,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[H?.name===t?e(lF,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(pF,{title:xF(t,20,"count")?t:"",children:e(cF,{children:AF(t,20,"count")})})]}),name:r,value:t})))(N),targetRef:I,onOptionClick:e=>{const{value:t,name:n=""}=e;ce(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:H.name})]}),e("div",{className:"ff-excel-tab-container",children:N.map((t,n)=>e(cF,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{ce(t,n),x&&ue(e,t,n)},className:T("ff-excel-tab-list",{active:t===H.name}),onClick:()=>{ce(t,n)},suppressContentEditableWarning:ne===n,onDoubleClick:e=>{"show"===u&&(re(n),null===ne&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&ne===n,onBlur:e=>{le(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),le(e,n,t))},children:t})},t))})]}),P.open&&e(T6,{contextMenu:P,position:G,editable:p}),e(aY,{})]})})},L6=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:a=!1})=>{const i=a?"filter":"module";return e("div",{className:T("ff-module-chip",{"ff-filter-chip":a,[`ff-${i}-chip--active`]:n,[`ff-${i}-chip--hover`]:!n}),onClick:r,children:e(cF,{lineHeight:"18px",className:"module-typography",children:t})})},P6=({x:e,y:t,radius:n,startAngle:r,endAngle:a})=>{const i=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(a),c=t+n*Math.sin(a),s=a-r>Math.PI?1:0;return a-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${i} ${o} A ${n} ${n} 0 ${s} 1 ${l} ${c}`},R6=({radius:t=15,lineWidth:r=5,label:a,percentageValue:i,icon:l,fontSize:c=10,labelColor:u="",arcColor:d="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[m,v]=s({x:0,y:0}),[g,y]=s(!1),_=o(null);let b=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:E,foregroundArcPath:A}=((e,t,n)=>{const r=t,a=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:P6({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:P6({x:0,y:0,radius:n,startAngle:r,endAngle:a})}})(i,b,t),x=()=>{y(!0)},C=()=>{v({x:0,y:0}),y(!1)},k=e=>{if(_.current){const t=_.current.getBoundingClientRect();v({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:_,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${c}px`},onClick:p,children:[e("svg",{width:w,height:w,viewBox:`0 0 ${w} ${w}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),e("path",{d:A,fill:"none",stroke:d,strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),h&&e("path",{d:A,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:x,onMouseLeave:C,onMouseMove:k}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(lF,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:u||d,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(i)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${m.x+15}px`,top:m.y-5+"px"},children:[e(cF,{children:`${a} : `}),n(cF,{children:[i,"%"]})]})]})},H6=({mediaSrc:t,fileId:r,onExpandClick:a,onDeleteClick:i,onDownloadClick:o,height:l="75px",width:c="79px",fileName:s,thumbnailMediaSrc:u,isDelete:d})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:c},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:c},children:[e("img",{src:u||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(pF,{title:"Download File",placement:"bottom",children:e(lF,{name:"download_file_icon",height:10,width:10,onClick:o,color:"var(--icons-default-color)"})})}),d&&e("div",{className:"ff-icon-container",children:e(pF,{title:"Delete",placement:"bottom",children:e(lF,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{i&&i(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(pF,{title:"Maximize",placement:"bottom",children:e(lF,{name:"expand_icon",height:16,width:16,onClick:a})})})]}),e(cF,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:s})]})}),B6=({icon:r,status:a,count:i,text:o,style:c={width:"196.4px"},resetToggle:u,onSelectedStatus:d=e=>{}})=>{const[f,h]=s(!1),p=["total defects","defect density","open defects","closed defects","quality score"],m=p.includes(a.toLowerCase()),v=p.includes(a.toLowerCase());l(()=>{h(!u)},[u]);return n("div",{className:`ff-card-container ${a.toLowerCase()} ${f?"toggled":""}`,style:c,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),d(e))})(a),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(lF,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(a.toLowerCase())&&e(cF,{fontWeight:"semi-bold",fontSize:"10px",textAlign:"center",lineHeight:"15px",className:"ff-status-text",as:"div",children:a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()})]}),e("div",{className:"ff-content "+(v?"red-background":""),children:n(t,m?{children:[e(cF,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:o}),e(cF,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===a.toLowerCase()?n(t,{children:[i.toString().padStart(2,"0"),e(cF,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===a.toLowerCase()?`${parseFloat(i.toString()).toFixed(2)}%`:i.toString().padStart(2,"0")})]}:{children:[e(cF,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:i.toString().padStart(2,"0")}),e(cF,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:o})]})})]})},q6=({option:t})=>{const r=o(null),[a,i]=s(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{i(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const c={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(pF,{title:a?u(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:u(t)})}),e(lF,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":c[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function F6(e){return()=>e}function U6(e){e()}function V6(e,t){return n=>e(t(n))}function W6(e,t){return()=>e(t)}function Q6(e){return void 0!==e}function G6(){}function Y6(e,t){return t(e),e}function K6(e,t){return t(e)}function Z6(...e){return e}function X6(e,t){return e(1,t)}function J6(e,t){e(0,t)}function $6(e){e(2)}function e7(e){return e(4)}function t7(e,t){return X6(e,function(e,t){return n=>e(t,n)}(t,0))}function n7(e,t){const n=e(1,e=>{n(),t(e)});return n}function r7(e){let t,n;return r=>a=>{t=a,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function a7(e,t){return e===t}function i7(e=a7){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function o7(e){return t=>n=>{e(n)&&t(n)}}function l7(e){return t=>V6(t,e)}function c7(e){return t=>()=>{t(e)}}function s7(e,...t){const n=function(...e){return t=>e.reduceRight(K6,t)}(...t);return(t,r)=>{switch(t){case 2:return void $6(e);case 1:return X6(e,n(r))}}}function u7(e,t){return n=>r=>{n(t=e(t,r))}}function d7(e){return t=>n=>{e>0?e--:t(n)}}function f7(e){let t,n=null;return r=>a=>{n=a,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function h7(...e){const t=new Array(e.length);let n=0,r=null;const a=Math.pow(2,e.length)-1;return e.forEach((e,i)=>{const o=Math.pow(2,i);X6(e,e=>{const l=n;n|=o,t[i]=e,l!==a&&n===a&&r&&(r(),r=null)})}),e=>i=>{const o=()=>{e([i].concat(t))};n===a?o():r=o}}function p7(e){let t=e;const n=v7();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function m7(e,t){return Y6(p7(t),t=>t7(e,t))}function v7(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(n)});case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function g7(e){return Y6(v7(),t=>t7(e,t))}function y7(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:_7(),singleton:n}}const _7=()=>Symbol();function b7(...e){const t=v7(),n=new Array(e.length);let r=0;const a=Math.pow(2,e.length)-1;return e.forEach((e,i)=>{const o=Math.pow(2,i);X6(e,e=>{n[i]=e,r|=o,r===a&&J6(t,n)})}),function(e,i){switch(e){case 2:return void $6(t);case 1:return r===a&&i(n),X6(t,i)}}}function w7(e,t=a7){return s7(e,i7(t))}function E7(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(U6)}}(...e.map(e=>X6(e,n)))}}}var A7=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(A7||{});const x7={0:"debug",3:"error",1:"log",2:"warn"},C7=y7(()=>{const e=p7(3);return{log:p7((t,n,r=1)=>{var a;r>=(null!=(a=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?a:e7(e))&&console[x7[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function k7(e,t,n){return M7(e,t,n).callbackRef}function M7(e,t,n){const r=a.useRef(null);let i=e=>{};const o=a.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(null==o||o.observe(e),r.current=e):(r.current&&(null==o||o.unobserve(r.current)),r.current=null)},{callbackRef:i,ref:r}}function z7(e,t,n,r,i,o,l,c,s){const u=a.useCallback(n=>{const a=function(e,t,n,r){const a=e.length;if(0===a)return null;const i=[];for(let o=0;o<a;o++){const a=e.item(o);if(void 0===a.dataset.index)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),s=t(a,n);if(0===s&&r("Zero-sized element, this should not happen",{child:a},A7.ERROR),s===c)continue;const u=i[i.length-1];0===i.length||u.size!==s||u.endIndex!==l-1?i.push({endIndex:l,size:s,startIndex:l}):i[i.length-1].endIndex++}return i}(n.children,t,c?"offsetWidth":"offsetHeight",i);let s=n.parentElement;for(;!s.dataset.virtuosoScroller;)s=s.parentElement;const u="window"===s.lastElementChild.dataset.viewportType;let d;u&&(d=s.ownerDocument.defaultView);const f=l?c?l.scrollLeft:l.scrollTop:u?c?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:c?s.scrollLeft:s.scrollTop,h=l?c?l.scrollWidth:l.scrollHeight:u?c?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:c?s.scrollWidth:s.scrollHeight,p=l?c?l.offsetWidth:l.offsetHeight:u?c?d.innerWidth:d.innerHeight:c?s.offsetWidth:s.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:p}),null==o||o(c?S7("column-gap",getComputedStyle(n).columnGap,i):S7("row-gap",getComputedStyle(n).rowGap,i)),null!==a&&e(a)},[e,t,i,o,l,r,c]);return M7(u,n,s)}function S7(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,A7.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function O7(e,t,n){const r=a.useRef(null),i=a.useCallback(n=>{if(null==n||!n.offsetParent)return;const a=n.getBoundingClientRect(),i=a.width;let o,c;if(t){const e=t.getBoundingClientRect(),n=a.top-e.top;c=e.height-Math.max(0,n),o=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,a.top),o=a.top+e.scrollY}r.current={offsetTop:o,visibleHeight:c,visibleWidth:i},e(r.current)},[e,t]),{callbackRef:o,ref:l}=M7(i,!0,n),c=a.useCallback(()=>{i(l.current)},[i,l]);return a.useEffect(()=>{var e;if(t){t.addEventListener("scroll",c);const e=new ResizeObserver(()=>{requestAnimationFrame(c)});return e.observe(t),()=>{t.removeEventListener("scroll",c),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",c),null==t||t.addEventListener("resize",c),()=>{null==t||t.removeEventListener("scroll",c),null==t||t.removeEventListener("resize",c)}}},[c,t,l]),o}const I7=y7(()=>{const e=v7(),t=v7(),n=p7(0),r=v7(),a=p7(0),i=v7(),o=v7(),l=p7(0),c=p7(0),s=p7(0),u=p7(0),d=v7(),f=v7(),h=p7(!1),p=p7(!1),m=p7(!1);return t7(s7(e,l7(({scrollTop:e})=>e)),t),t7(s7(e,l7(({scrollHeight:e})=>e)),o),t7(t,a),{deviation:n,fixedFooterHeight:s,fixedHeaderHeight:c,footerHeight:u,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:h,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:a,viewportHeight:i}},[],{singleton:!0}),N7={lvl:0};function j7(e,t){const n=e.length;if(0===n)return[];let{index:r,value:a}=t(e[0]);const i=[];for(let o=1;o<n;o++){const{index:n,value:l}=t(e[o]);i.push({end:n-1,start:r,value:a}),r=n,a=l}return i.push({end:1/0,start:r,value:a}),i}function T7(e){return e===N7}function D7(e,t){if(!T7(e))return t===e.k?e.v:t<e.k?D7(e.l,t):D7(e.r,t)}function L7(e,t,n="k"){if(T7(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=L7(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return L7(e.l,t,n)}function P7(e,t,n){return T7(e)?Y7(t,n,1):t===e.k?V7(e,{k:t,v:n}):t<e.k?K7(V7(e,{l:P7(e.l,t,n)})):K7(V7(e,{r:P7(e.r,t,n)}))}function R7(){return N7}function H7(e,t,n){if(T7(e))return[];return function(e){return j7(e,({k:e,v:t})=>({index:e,value:t}))}(F7(e,L7(e,t)[0],n))}function B7(e,t){if(T7(e))return N7;const{k:n,l:r,r:a}=e;if(t===n){if(T7(r))return a;if(T7(a))return r;{const[t,n]=G7(r);return U7(V7(e,{k:t,l:W7(r),v:n}))}}return U7(V7(e,t<n?{l:B7(r,t)}:{r:B7(a,t)}))}function q7(e){return T7(e)?[]:[...q7(e.l),{k:e.k,v:e.v},...q7(e.r)]}function F7(e,t,n){if(T7(e))return[];const{k:r,l:a,r:i,v:o}=e;let l=[];return r>t&&(l=l.concat(F7(a,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(F7(i,t,n))),l}function U7(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Q7(t))return Z7(V7(e,{lvl:n-1}));if(!T7(t)&&!T7(t.r))return V7(t.r,{l:V7(t,{r:t.r.l}),lvl:n,r:V7(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Q7(e))return X7(V7(e,{lvl:n-1}));if(T7(r)||T7(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,a=Q7(t)?r.lvl-1:r.lvl;return V7(t,{l:V7(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:X7(V7(r,{l:t.r,lvl:a}))})}}function V7(e,t){return Y7(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function W7(e){return T7(e.r)?e.l:U7(V7(e,{r:W7(e.r)}))}function Q7(e){return T7(e)||e.lvl>e.r.lvl}function G7(e){return T7(e.r)?[e.k,e.v]:G7(e.r)}function Y7(e,t,n,r=N7,a=N7){return{k:e,l:r,lvl:n,r:a,v:t}}function K7(e){return X7(Z7(e))}function Z7(e){const{l:t}=e;return T7(t)||t.lvl!==e.lvl?e:V7(t,{r:V7(e,{l:t.r})})}function X7(e){const{lvl:t,r:n}=e;return T7(n)||T7(n.r)||n.lvl!==t||n.r.lvl!==t?e:V7(n,{l:V7(e,{r:n.l}),lvl:t+1})}function J7(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function $7(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const e8=y7(()=>({recalcInProgress:p7(!1)}),[],{singleton:!0});function t8(e,t,n){return e[n8(e,t,n)]}function n8(e,t,n,r=0){let a=e.length-1;for(;r<=a;){const i=Math.floor((r+a)/2),o=n(e[i],t);if(0===o)return i;if(-1===o){if(a-r<2)return i-1;a=i-1}else{if(a===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function r8(e,t){return Math.round(e.getBoundingClientRect()[t])}function a8(e){return!T7(e.groupOffsetTree)}function i8({index:e},t){return t===e?0:t<e?-1:1}function o8({offset:e},t){return t===e?0:t<e?-1:1}function l8(e,t,n){if(0===t.length)return 0;const{index:r,offset:a,size:i}=t8(t,e,i8),o=e-r,l=i*o+(o-1)*n+a;return l>0?l+n:l}function c8(e,t){if(!a8(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function s8(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=c8("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function u8(e,t,n,r=0){return r>0&&(t=Math.max(t,t8(e,r,i8).offset)),j7(function(e,t,n,r){const a=n8(e,t,r),i=n8(e,n,r,a);return e.slice(a,i+1)}(e,t,n,o8),p8)}function d8(e,[t,n,r,a]){t.length>0&&r("received item sizes",t,A7.DEBUG);const i=e.sizeTree;let o=i,l=0;if(n.length>0&&T7(i)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>P7(P7(t,n,e),n+1,r),o)}else[o,l]=function(e,t){let n=T7(e)?0:1/0;for(const r of t){const{endIndex:t,size:a,startIndex:i}=r;if(n=Math.min(n,i),T7(e)){e=P7(e,0,a);continue}const o=H7(e,i-1,t+1);if(o.some(m8(r)))continue;let l=!1,c=!1;for(const{end:n,start:r,value:i}of o)l?(t>=r||a===i)&&(e=B7(e,r)):(c=i!==a,l=!0),n>t&&t>=r&&i!==a&&(e=P7(e,t+1,i));c&&(e=P7(e,i,a))}return[e,n]}(o,t);if(o===i)return e;const{lastIndex:c,lastOffset:s,lastSize:u,offsetTree:d}=h8(e.offsetTree,l,o,a);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>P7(e,t,l8(t,d,a)),R7()),lastIndex:c,lastOffset:s,lastSize:u,offsetTree:d,sizeTree:o}}function f8(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function h8(e,t,n,r){let a=e,i=0,o=0,l=0,c=0;if(0!==t){c=n8(a,t-1,i8),l=a[c].offset;const e=L7(n,t-1);i=e[0],o=e[1],a.length&&a[c].size===L7(n,t)[1]&&(c-=1),a=a.slice(0,c+1)}else a=[];for(const{start:e,value:c}of H7(n,t,1/0)){const t=e-i,n=t*o+l+t*r;a.push({index:e,offset:n,size:c}),i=e,l=n,o=c}return{lastIndex:i,lastOffset:l,lastSize:o,offsetTree:a}}function p8(e){return{index:e.index,value:e}}function m8(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const v8={offsetHeight:"height",offsetWidth:"width"},g8=y7(([{log:e},{recalcInProgress:t}])=>{const n=v7(),r=v7(),a=m7(r,0),i=v7(),o=v7(),l=p7(0),c=p7([]),s=p7(void 0),u=p7(void 0),d=p7(void 0),f=p7(void 0),h=p7((e,t)=>r8(e,v8[t])),p=p7(void 0),m=p7(0),v={groupIndices:[],groupOffsetTree:R7(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:R7()},g=m7(s7(n,h7(c,e,m),u7(d8,v),i7()),v),y=m7(s7(c,i7(),u7((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),l7(({prev:e})=>e)),[]);t7(s7(c,o7(e=>e.length>0),h7(g,m),l7(([e,t,n])=>{const r=e.reduce((e,r,a)=>P7(e,r,l8(r,t.offsetTree,n)||a),R7());return{...t,groupIndices:e,groupOffsetTree:r}})),g),t7(s7(r,h7(g),o7(([e,{lastIndex:t}])=>e<t),l7(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),t7(s,u);const _=m7(s7(s,l7(e=>void 0===e)),!0);t7(s7(u,o7(e=>void 0!==e&&T7(e7(g).sizeTree)),l7(e=>{const t=e7(d),n=e7(c).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),t7(s7(f,o7(e=>void 0!==e&&e.length>0&&T7(e7(g).sizeTree)),l7(e=>{const t=[];let n=e[0],r=0;for(let a=1;a<e.length;a++){const i=e[a];i!==n&&(t.push({endIndex:a-1,size:n,startIndex:r}),n=i,r=a)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),t7(s7(c,h7(d,u),o7(([,e,t])=>void 0!==e&&void 0!==t),l7(([e,t,n])=>{const r=[];for(let a=0;a<e.length;a++){const i=e[a],o=e[a+1];r.push({startIndex:i,endIndex:i,size:t}),void 0!==o&&r.push({startIndex:i+1,endIndex:o-1,size:n})}return r})),n);const b=g7(s7(n,h7(g),u7(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:v}),l7(e=>e.changed)));X6(s7(l,u7((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),l7(e=>e.diff)),e=>{const{groupIndices:n}=e7(g);if(e>0)J6(t,!0),J6(i,e+f8(e,n));else if(e<0){const t=e7(y);t.length>0&&(e-=f8(-e,t)),J6(o,e)}}),X6(s7(l,h7(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},A7.ERROR)});const w=g7(i);t7(s7(i,h7(g),l7(([e,t])=>{const n=t.groupIndices.length>0,r=[],a=t.lastSize;if(n){const n=D7(t.sizeTree,0);let i=0,o=0;for(;i<e;){const e=t.groupIndices[o],l=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:a,startIndex:e+1}),o++,i+=l+1}const l=q7(t.sizeTree);return i!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let a=t.ranges;return 0!==t.prevSize&&(a=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:a}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return q7(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:a,ranges:[]}).ranges})),n);const E=g7(s7(o,h7(g,m),l7(([e,{offsetTree:t},n])=>l8(-e,t,n))));return t7(s7(o,h7(g,m),l7(([e,t,n])=>{if(t.groupIndices.length>0){if(T7(t.sizeTree))return t;let r=R7();const a=e7(y);let i=0,o=0,l=0;for(;i<-e;){l=a[o];const e=a[o+1]-l-1;o++,i+=e+1}if(r=q7(t.sizeTree).reduce((t,{k:n,v:r})=>P7(t,Math.max(0,n+e),r),r),i!==-e){r=P7(r,0,D7(t.sizeTree,l));r=P7(r,1,L7(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...h8(t.offsetTree,0,r,n)}}{const r=q7(t.sizeTree).reduce((t,{k:n,v:r})=>P7(t,Math.max(0,n+e),r),R7());return{...t,sizeTree:r,...h8(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:w,data:p,defaultItemSize:u,firstItemIndex:l,fixedItemSize:s,fixedGroupSize:d,gap:m,groupIndices:c,heightEstimates:f,itemSize:h,listRefresh:b,shiftWith:o,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:a,totalCount:r,trackItemSizes:_,unshiftWith:i}},Z6(C7,e8),{singleton:!0});function y8(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const _8=y7(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:a}])=>{const i=v7(),o=v7(),l=g7(s7(i,l7(y8)));return t7(s7(l,l7(e=>e.totalCount)),n),t7(s7(l,l7(e=>e.groupIndices)),e),t7(s7(b7(a,t,r),o7(([e,t])=>a8(t)),l7(([e,t,n])=>L7(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),i7(),l7(e=>[e])),o),{groupCounts:i,topItemsIndexes:o}},Z6(g8,I7)),b8=y7(([{log:e}])=>{const t=p7(!1),n=g7(s7(t,o7(e=>e),i7()));return X6(t,t=>{t&&e7(e)("props updated",{},A7.DEBUG)}),{didMount:n,propsReady:t}},Z6(C7),{singleton:!0}),w8=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function E8(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!w8)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const A8=y7(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:a,fixedHeaderHeight:i,footerHeight:o,headerHeight:l,scrollingInProgress:c,scrollTo:s,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const h=v7(),p=v7(),m=p7(0);let v=null,g=null,y=null;function _(){v&&(v(),v=null),y&&(y(),y=null),g&&(clearTimeout(g),g=null),J6(c,!1)}return t7(s7(h,h7(n,d,r,m,l,o,f),h7(e,i,a),l7(([[e,n,r,a,i,o,l,s],d,f,m])=>{const b=E8(e),{align:w,behavior:E,offset:A}=b,x=a-1,C=s8(b,n,x);let k=l8(C,n.offsetTree,d)+o;"end"===w?(k+=f+L7(n.sizeTree,C)[1]-r+m,C===x&&(k+=l)):"center"===w?k+=(f+L7(n.sizeTree,C)[1]-r+m)/2:k-=i,A&&(k+=A);const M=t=>{_(),t?(s("retrying to scroll to",{location:e},A7.DEBUG),J6(h,e)):(J6(p,!0),s("list did not change, scroll successful",{},A7.DEBUG))};if(_(),"smooth"===E){let e=!1;y=X6(t,t=>{e=e||t}),v=n7(u,()=>{M(e)})}else v=n7(s7(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),M);return g=setTimeout(()=>{_()},1200),J6(c,!0),s("scrolling from index to",{behavior:E,index:C,top:k},A7.DEBUG),{behavior:E,top:k}})),s),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},Z6(g8,I7,C7),{singleton:!0});function x8(e,t){0==e?t():requestAnimationFrame(()=>{x8(e-1,t)})}function C8(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const k8=y7(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:a,scrollToIndex:i},{didMount:o}])=>{const l=p7(!0),c=p7(0),s=p7(!0);return t7(s7(o,h7(c),o7(([e,t])=>!!t),c7(!1)),l),t7(s7(o,h7(c),o7(([e,t])=>!!t),c7(!1)),s),X6(s7(b7(t,o),h7(l,n,e,s),o7(([[,e],t,{sizeTree:n},r,a])=>e&&(!T7(n)||Q6(r))&&!t&&!a),h7(c)),([,e])=>{n7(a,()=>{J6(s,!0)}),x8(4,()=>{n7(r,()=>{J6(l,!0)}),J6(i,e)})}),{initialItemFinalLocationReached:s,initialTopMostItemIndex:c,scrolledToInitialItem:l}},Z6(g8,I7,A8,b8),{singleton:!0});function M8(e,t){return Math.abs(e-t)<1.01}const z8="up",S8="down",O8={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},I8=y7(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:a,viewportHeight:i}])=>{const o=p7(!1),l=p7(!0),c=v7(),s=v7(),u=p7(4),d=p7(0),f=m7(s7(E7(s7(w7(a),d7(1),c7(!0)),s7(w7(a),d7(1),c7(!1),r7(100))),i7()),!1),h=m7(s7(E7(s7(n,c7(!0)),s7(n,c7(!1),r7(200))),i7()),!1);t7(s7(b7(w7(a),w7(d)),l7(([e,t])=>e<=t),i7()),l),t7(s7(l,f7(50)),s);const p=g7(s7(b7(r,w7(i),w7(t),w7(e),w7(u)),u7((e,[{scrollHeight:t,scrollTop:n},r,a,i,o])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-o){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let c;return c=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:c,state:l}},O8),i7((e,t)=>e&&e.atBottom===t.atBottom))),m=m7(s7(r,u7((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(M8(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const a=t-(n+r)<1;return e.scrollTop!==n&&a?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),o7(e=>e.changed),l7(e=>e.jump)),0);t7(s7(p,l7(e=>e.atBottom)),o),t7(s7(o,f7(50)),c);const v=p7(S8);t7(s7(r,l7(({scrollTop:e})=>e),i7(),u7((e,t)=>e7(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?z8:S8,prevScrollTop:t},{direction:S8,prevScrollTop:0}),l7(e=>e.direction)),v),t7(s7(r,f7(50),c7("none")),v);const g=p7(0);return t7(s7(f,o7(e=>!e),c7(0)),g),t7(s7(a,f7(100),h7(f),o7(([e,t])=>!!t),u7(([e,t],[n])=>[t,n],[0,0]),l7(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:s,atTopThreshold:d,isAtBottom:o,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:m,scrollDirection:v,scrollVelocity:g}},Z6(I7)),N8="top",j8="bottom",T8="none";function D8(e,t,n){return"number"==typeof e?n===z8&&t===N8||n===S8&&t===j8?e:0:n===z8?t===N8?e.main:e.reverse:t===j8?e.main:e.reverse}function L8(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const P8=y7(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:a}])=>{const i=v7(),o=p7(0),l=p7(0),c=p7(0),s=m7(s7(b7(w7(r),w7(a),w7(n),w7(i,$7),w7(c),w7(o),w7(t),w7(e),w7(l)),l7(([e,t,n,[r,a],i,o,l,c,s])=>{const u=e-c,d=o+l,f=Math.max(n-u,0);let h=T8;const p=L8(s,N8),m=L8(s,j8);return r-=c,a+=n+l,(r+=n+l)>e+d-p&&(h=z8),(a-=c)<e-f+t+m&&(h=S8),h!==T8?[Math.max(u-n-D8(i,N8,h)-p,0),u-f-l+t+D8(i,j8,h)+m]:null}),o7(e=>null!=e),i7($7)),[0,0]);return{increaseViewportBy:l,listBoundary:i,overscan:c,topListHeight:o,visibleRange:s}},Z6(I7),{singleton:!0});const R8={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function H8(e,t,n,r,a,i){const{lastIndex:o,lastOffset:l,lastSize:c}=a;let s=0,u=0;if(e.length>0){s=e[0].offset;const t=e[e.length-1];u=t.offset+t.size}const d=n-o,f=s,h=l+d*c+(d-1)*r-u;return{bottom:u,firstItemIndex:i,items:q8(e,a,i),offsetBottom:h,offsetTop:s,top:f,topItems:q8(t,a,i),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function B8(e,t,n,r,a,i){let o=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-o>=e)break;o++}const l=e+o,c=C8(t,l);return H8(Array.from({length:l}).map((e,t)=>({data:i[t+c],index:t+c,offset:0,size:0})),[],l,a,n,r)}function q8(e,t,n){if(0===e.length)return[];if(!a8(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,a=e[e.length-1].index,i=[],o=H7(t.groupOffsetTree,r,a);let l,c=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=o.shift(),c=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:c,type:"group"}:{groupIndex:c,index:r.index-(c+1)+n},i.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return i}function F8(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const U8=y7(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:a},i,{listBoundary:o,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:s,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:p}])=>{const m=p7([]),v=p7(0),g=v7(),y=p7(0);t7(i.topItemsIndexes,m);const _=m7(s7(b7(h,p,w7(c,$7),w7(a),w7(r),w7(s),u,w7(m),w7(t),w7(n),w7(y),e),o7(([e,t,,n,,,,,,,,r])=>{const a=r&&r.length!==n;return e&&!t&&!a}),l7(([,,[e,t],n,r,a,i,o,l,c,s,u])=>{var d,f,h,p;const m=r,{offsetTree:g,sizeTree:y}=m,_=e7(v);if(0===n)return{...R8,totalCount:n};if(0===e&&0===t)return 0===_?{...R8,totalCount:n}:B8(_,a,r,l,c,u||[]);if(T7(y))return _>0?null:H8(function(e,t,n){if(a8(t)){const r=c8(e,t);return[{index:L7(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(C8(a,n),m,u),[],n,c,m,l);const b=[];if(o.length>0){const e=o[0],t=o[o.length-1];let n=0;for(const r of H7(y,e,t)){const a=r.value,i=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=i;e<=o;e++)b.push({data:null==u?void 0:u[e],index:e,offset:n,size:a}),n+=a}}if(!i)return H8([],b,n,c,m,l);const w=o.length>0?o[o.length-1]+1:0,E=u8(g,e,t,w);if(0===E.length)return null;const A=n-1,x=Y6([],n=>{for(const r of E){const a=r.value;let i=a.offset,o=r.start;const l=a.size;if(a.offset<e){o+=Math.floor((e-a.offset+c)/(l+c));const t=o-r.start;i+=t*l+t*c}o<w&&(i+=(w-o)*l,o=w);const s=Math.min(r.end,A);for(let e=o;e<=s&&!(i>=t);e++)n.push({data:null==u?void 0:u[e],index:e,offset:i,size:l}),i+=l+c}}),C=F8(s,N8),k=F8(s,j8);if(x.length>0&&(C>0||k>0)){const e=x[0],t=x[x.length-1];if(C>0&&e.index>w){const t=Math.min(C,e.index-w),n=[];let r=e.offset;for(let a=e.index-1;a>=e.index-t;a--){const t=null!=(f=null==(d=H7(y,a,a)[0])?void 0:d.value)?f:e.size;r-=t+c,n.unshift({data:null==u?void 0:u[a],index:a,offset:r,size:t})}x.unshift(...n)}if(k>0&&t.index<A){const e=Math.min(k,A-t.index);let n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=H7(y,r,r)[0])?void 0:h.value)?p:t.size;x.push({data:null==u?void 0:u[r],index:r,offset:n,size:e}),n+=e+c}}}return H8(x,b,n,c,m,l)}),o7(e=>null!==e),i7()),R8);t7(s7(e,o7(Q6),l7(e=>null==e?void 0:e.length)),a),t7(s7(_,l7(e=>e.topListHeight)),d),t7(d,l),t7(s7(_,l7(e=>[e.top,e.bottom])),o),t7(s7(_,l7(e=>e.items)),g);const b=g7(s7(_,o7(({items:e})=>e.length>0),h7(a,e),o7(([{items:e},t])=>e[e.length-1].originalIndex===t-1),l7(([,e,t])=>[e-1,t]),i7($7),l7(([e])=>e))),w=g7(s7(_,f7(200),o7(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),l7(({items:e})=>e[0].index),i7())),E=g7(s7(_,o7(({items:e})=>e.length>0),l7(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),i7(J7)));return{endReached:b,initialItemCount:v,itemsRendered:g,listState:_,minOverscanItemCount:y,rangeChanged:E,startReached:w,topItemsIndexes:m,...f}},Z6(g8,_8,P8,k8,A8,I8,b8,e8),{singleton:!0}),V8=y7(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:a}])=>{const i=v7(),o=m7(s7(b7(n,e,r,t,a),l7(([e,t,n,r,a])=>e+t+n+r+a.offsetBottom+a.bottom)),0);return t7(w7(o),i),{totalListHeight:o,totalListHeightChanged:i}},Z6(I7,U8),{singleton:!0}),W8=y7(([{viewportHeight:e},{totalListHeight:t}])=>{const n=p7(!1);return{alignToBottom:n,paddingTopAddition:m7(s7(b7(n,e,t),o7(([e])=>e),l7(([,e,t])=>Math.max(0,e-t)),f7(0),i7()),0)}},Z6(I7,V8),{singleton:!0}),Q8=y7(()=>({context:p7(null)})),G8=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...a},viewportBottom:i,viewportTop:o})=>t<o?{...a,align:null!=n?n:"start",behavior:r}:e>i?{...a,align:null!=n?n:"end",behavior:r}:null,Y8=y7(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:a,headerHeight:i,scrollingInProgress:o,scrollTop:l,viewportHeight:c},{scrollToIndex:s}])=>{const u=v7();return t7(s7(u,h7(t,c,n,i,a,r,l),h7(e),l7(([[e,t,n,r,a,i,l,c],s])=>{const{align:u,behavior:d,calculateViewLocation:f=G8,done:h,...p}=e,m=s8(e,t,r-1),v=l8(m,t.offsetTree,s)+a+i,g=f({itemBottom:v+L7(t.sizeTree,m)[1],itemTop:v,locationParams:{align:u,behavior:d,...p},viewportBottom:c+n-l,viewportTop:c+i});return g?h&&n7(s7(o,o7(e=>!e),d7(e7(o)?1:2)),h):h&&h(),g}),o7(e=>null!==e)),s),{scrollIntoView:u}},Z6(g8,I7,A8,U8,C7),{singleton:!0});function K8(e){return!!e&&("smooth"===e?"smooth":"auto")}const Z8=y7(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:a,isAtBottom:i},{scrollToIndex:o},{scrolledToInitialItem:l},{didMount:c,propsReady:s},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:h}])=>{const p=p7(!1),m=v7();let v=null;function g(e){J6(o,{align:"end",behavior:e,index:"LAST"})}function y(e){const t=n7(a,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!v&&(e7(u)("scrolling to bottom due to increased size",{},A7.DEBUG),g("auto"))});setTimeout(t,100)}X6(s7(b7(s7(w7(t),d7(1)),c),h7(w7(p),i,l,d),l7(([[e,t],n,r,a,i])=>{let o=t&&a,l="auto";return o&&(l=((e,t)=>"function"==typeof e?K8(e(t)):t&&K8(e))(n,r||i),o=o&&!!l),{followOutputBehavior:l,shouldFollow:o,totalCount:e}}),o7(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{v&&(v(),v=null),e7(n)?requestAnimationFrame(()=>{e7(u)("following output to ",{totalCount:r},A7.DEBUG),g(t)}):v=n7(e,()=>{e7(u)("following output to ",{totalCount:r},A7.DEBUG),g(t),v=null})}),X6(s7(b7(w7(p),t,s),o7(([e,,t])=>e&&t),u7(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),o7(({refreshed:e})=>e),h7(p,t)),([,e])=>{e7(l)&&y(!1!==e)}),X6(m,()=>{y(!1!==e7(p))}),X6(b7(w7(p),a),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const _=p7(null),b=v7();return t7(E7(s7(w7(r),l7(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),s7(w7(t))),b),X6(s7(b7(s7(b,d7(1)),c),h7(w7(_),l,d,f),l7(([[e,t],n,r,a,i])=>t&&r&&(null==n?void 0:n({context:i,totalCount:e,scrollingInProgress:a}))),o7(e=>!!e),f7(0)),t=>{v&&(v(),v=null),e7(n)?requestAnimationFrame(()=>{e7(u)("scrolling into view",{}),J6(h,t)}):v=n7(e,()=>{e7(u)("scrolling into view",{}),J6(h,t),v=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:_}},Z6(g8,I8,A8,k8,b8,C7,I7,Q8,Y8)),X8=y7(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:a},{initialItemCount:i,listState:o},{didMount:l}])=>(t7(s7(l,h7(i),o7(([,e])=>0!==e),h7(a,r,t,n,e),l7(([[,e],t,n,r,a,i=[]])=>B8(e,t,n,r,a,i))),o),{}),Z6(g8,k8,U8,b8),{singleton:!0}),J8=y7(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=p7(0);return X6(s7(e,h7(r),o7(([,e])=>0!==e),l7(([,e])=>({top:e}))),e=>{n7(s7(n,d7(1),o7(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{J6(t,e)})})}),{initialScrollTop:r}},Z6(b8,I7,U8),{singleton:!0}),$8=y7(([{scrollVelocity:e}])=>{const t=p7(!1),n=v7(),r=p7(!1);return t7(s7(e,h7(r,t,n),o7(([e,t])=>!!t),l7(([e,t,n,r])=>{const{enter:a,exit:i}=t;if(n){if(i(e,r))return!1}else if(a(e,r))return!0;return n}),i7()),t),X6(s7(b7(t,e,n),h7(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Z6(I8),{singleton:!0}),e9=y7(([{scrollContainerState:e,scrollTo:t}])=>{const n=v7(),r=v7(),a=v7(),i=p7(!1),o=p7(void 0);return t7(s7(b7(n,r),l7(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),t7(s7(t,h7(r),l7(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),a),{customScrollParent:o,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:a,windowViewportRect:r}},Z6(I7)),t9=y7(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:a},{didMount:i},{useWindowScroll:o,windowScrollContainerState:l,windowViewportRect:c}])=>{const s=v7(),u=p7(void 0),d=p7(null),f=p7(null);return t7(l,d),t7(c,f),X6(s7(s,h7(t,r,o,d,f,n)),([e,t,n,r,a,i,o])=>{const l=function(e){return q7(e).map(({k:e,v:t},n,r)=>{const a=r[n+1];return{endIndex:a?a.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==a&&null!==i&&(n=a.scrollTop-i.offsetTop),e({ranges:l,scrollTop:n-=o})}),t7(s7(u,o7(Q6),l7(n9)),a),t7(s7(i,h7(u),o7(([,e])=>void 0!==e),i7(),l7(([,e])=>e.ranges)),e),{getState:s,restoreStateFrom:u}},Z6(g8,I7,k8,b8,e9));function n9(e){return{align:"start",index:0,offset:e.scrollTop}}const r9=y7(([{topItemsIndexes:e}])=>{const t=p7(0);return t7(s7(t,o7(e=>e>=0),l7(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Z6(U8));function a9(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const i9=a9(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),o9=y7(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:a,isScrolling:i,lastJumpDueToItemResize:o,scrollDirection:l},{listState:c},{beforeUnshiftWith:s,gap:u,shiftWithOffset:d,sizes:f},{log:h},{recalcInProgress:p}])=>{const m=g7(s7(c,h7(o),u7(([,e,t,n],[{bottom:r,items:a,offsetBottom:i,totalCount:o},l])=>{const c=r+i;let s=0;return t===o&&e.length>0&&a.length>0&&(0===a[0].originalIndex&&0===e[0].originalIndex||(s=c-n,0!==s&&(s+=l))),[s,a,o,c]},[0,[],0,0]),o7(([e])=>0!==e),h7(r,l,n,a,h,p),o7(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===z8),l7(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},A7.DEBUG),e))));function v(n){n>0?(J6(t,{behavior:"auto",top:-n}),J6(e,0)):(J6(e,0),J6(t,{behavior:"auto",top:-n}))}return X6(s7(m,h7(e,i)),([t,n,r])=>{r&&i9()?J6(e,n-t):v(-t)}),X6(s7(b7(m7(i,!1),e,p),o7(([e,t,n])=>!e&&!n&&0!==t),l7(([e,t])=>t),f7(1)),v),t7(s7(d,l7(e=>({top:-e}))),t),X6(s7(s,h7(f,u),l7(([e,{groupIndices:t,lastSize:n,sizeTree:r},a])=>{function i(e){return e*(n+a)}if(0===t.length)return i(e);{let n=0;const a=D7(r,0);let o=0,l=0;for(;o<e;){o++,n+=a;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;o+r>e&&(n-=a,r=e-o+1),o+=r,n+=i(r),l++}return n}})),n=>{J6(e,n),requestAnimationFrame(()=>{J6(t,{top:n}),requestAnimationFrame(()=>{J6(e,0),J6(p,!1)})})}),{deviation:e}},Z6(I7,I8,U8,g8,C7,e8)),l9=y7(([e,t,n,r,a,i,o,l,c,s,u])=>({...e,...t,...n,...r,...a,...i,...o,...l,...c,...s,...u}),Z6(P8,X8,b8,$8,V8,J8,W8,e9,Y8,C7,Q8)),c9=y7(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:a,gap:i,groupIndices:o,heightEstimates:l,itemSize:c,sizeRanges:s,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:v},g,y,_,b,{scrollToIndex:w},E,{topItemCount:A},{groupCounts:x},C])=>{const{listState:k,minOverscanItemCount:M,topItemsIndexes:z,rangeChanged:S,...O}=b;return t7(S,C.scrollSeekRangeChanged),t7(s7(C.windowViewportRect,l7(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:a,gap:i,groupCounts:x,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:v,sizeRanges:s,topItemCount:A,topItemsIndexes:z,totalCount:f,..._,groupIndices:o,itemSize:c,listState:k,minOverscanItemCount:M,scrollToIndex:w,statefulTotalCount:d,trackItemSizes:h,rangeChanged:S,...O,...C,...g,sizes:u,...y}},Z6(g8,k8,I7,t9,Z8,U8,A8,o9,r9,_8,l9));function s9(e,t){const n={},r={};let a=0;const i=e.length;for(;a<i;)r[e[a]]=1,a+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const u9=typeof document<"u"?a.useLayoutEffect:a.useEffect;function d9(t,n,r){const i=Object.keys(n.required||{}),o=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),c=Object.keys(n.events||{}),s=a.createContext({});function u(e,t){e.propsReady&&J6(e.propsReady,!1);for(const r of i){J6(e[n.required[r]],t[r])}for(const r of o)if(r in t){J6(e[n.optional[r]],t[r])}e.propsReady&&J6(e.propsReady,!0)}function d(e){return c.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(a,i){switch(a){case 1:return i?n===i?void 0:(r(),n=i,t=X6(e,i),t):(r(),G6);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=a.forwardRef((f,h)=>{const{children:p,...m}=f,[v]=a.useState(()=>Y6(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:a,singleton:i})=>{if(i&&t.has(a))return t.get(a);const o=e(r.map(e=>n(e)));return i&&t.set(a,o),o};return n(e)}(t),e=>{u(e,m)})),[g]=a.useState(W6(d,v));u9(()=>{for(const e of c)e in m&&X6(g[e],m[e]);return()=>{Object.values(g).map($6)}},[m,g,v]),u9(()=>{u(v,m)}),a.useImperativeHandle(h,F6(function(e){return l.reduce((t,r)=>(t[r]=t=>{J6(e[n.methods[r]],t)},t),{})}(v)));const y=r;return e(s.Provider,{value:v,children:r?e(y,{...s9([...i,...o,...c],m),children:p}):p})});return{Component:f,useEmitter:(e,t)=>{const n=a.useContext(s)[e];u9(()=>X6(n,t),[t,n])},useEmitterValue:a.version.startsWith("18")?e=>{const t=a.useContext(s)[e],n=a.useCallback(e=>X6(t,e),[t]);return a.useSyncExternalStore(n,()=>e7(t),()=>e7(t))}:e=>{const t=a.useContext(s)[e],[n,r]=a.useState(W6(e7,t));return u9(()=>X6(t,e=>{e!==n&&r(F6(e))}),[t,n]),n},usePublisher:e=>{const t=a.useContext(s);return a.useCallback(n=>{J6(t[e],n)},[t,e])}}}const f9=a.createContext(void 0),h9=a.createContext(void 0),p9=typeof document<"u"?a.useLayoutEffect:a.useEffect;function m9(e){return"self"in e}function v9(e,t,n,r=G6,i,o){const l=a.useRef(null),c=a.useRef(null),s=a.useRef(null),u=a.useCallback(n=>{let r,a,i;const l=n.target;if(function(e){return"body"in e}(l)||m9(l)){const e=m9(l)?l:l.defaultView;i=o?e.scrollX:e.scrollY,r=o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,a=o?e.innerWidth:e.innerHeight}else i=o?l.scrollLeft:l.scrollTop,r=o?l.scrollWidth:l.scrollHeight,a=o?l.offsetWidth:l.offsetHeight;const u=()=>{e({scrollHeight:r,scrollTop:Math.max(i,0),viewportHeight:a})};n.suppressFlushSync?u():A.flushSync(u),null!==c.current&&(i===c.current||i<=0||i===r-a)&&(c.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t,o]);return a.useEffect(()=>{const e=i||l.current;return r(i||l.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",u)}},[l,u,n,r,i]),{scrollByCallback:function(e){o&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(o?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const a="smooth"===n.behavior;let i,u,d;m9(r)?(u=Math.max(r8(r.document.documentElement,o?"width":"height"),o?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),i=o?r.innerWidth:r.innerHeight,d=o?window.scrollX:window.scrollY):(u=r[o?"scrollWidth":"scrollHeight"],i=r8(r,o?"width":"height"),d=r[o?"scrollLeft":"scrollTop"]);const f=u-i;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),M8(i,u)||n.top===d)return e({scrollHeight:u,scrollTop:d,viewportHeight:i}),void(a&&t(!0));a?(c.current=n.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,c.current=null,t(!0)},1e3)):c.current=null,o&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const g9="-webkit-sticky",y9="sticky",_9=a9(()=>{if(typeof document>"u")return y9;const e=document.createElement("div");return e.style.position=g9,e.style.position===g9?g9:y9});function b9(e){return e}const w9=y7(()=>{const e=p7(e=>`Item ${e}`),t=p7(e=>`Group ${e}`),n=p7({}),r=p7(b9),a=p7("div"),i=p7(G6),o=(e,t=null)=>m7(s7(n,l7(t=>t[e]),i7()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:a,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),E9=y7(([e,t])=>({...e,...t}),Z6(c9,w9)),A9=({height:t})=>e("div",{style:{height:t}}),x9={overflowAnchor:"none",position:_9(),zIndex:1},C9={overflowAnchor:"none"},k9={...C9,display:"inline-block",height:"100%"},M9=a.memo(function({showTopList:t=!1}){const n=V9("listState"),r=W9("sizeRanges"),i=V9("useWindowScroll"),o=V9("customScrollParent"),l=W9("windowScrollContainerState"),c=W9("scrollContainerState"),s=o||i?l:c,u=V9("itemContent"),d=V9("context"),f=V9("groupContent"),h=V9("trackItemSizes"),p=V9("itemSize"),v=V9("log"),g=W9("gap"),y=V9("horizontalDirection"),{callbackRef:_}=z7(r,p,h,t?G6:s,v,g,o,y,V9("skipAnimationFrameInResizeObserver")),[b,w]=a.useState(0);U9("deviation",e=>{b!==e&&w(e)});const E=V9("EmptyPlaceholder"),A=V9("ScrollSeekPlaceholder")||A9,x=V9("ListComponent"),C=V9("ItemComponent"),k=V9("GroupComponent"),M=V9("computeItemKey"),z=V9("isSeeking"),S=V9("groupIndices").length>0,O=V9("alignToBottom"),I=V9("initialItemFinalLocationReached"),N=t?{}:{boxSizing:"border-box",...y?{display:"inline-block",height:"100%",marginLeft:0!==b?b:O?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==b?b:O?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...I?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...N9(E,d)}):e(x,{...N9(x,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:_,style:N,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=M(t+n.firstItemIndex,e.data,d);return z?m(A,{...N9(A,d),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?m(k,{...N9(k,d),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:x9},f(e.index,d)):m(C,{...N9(C,d),...j9(C,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:y?k9:C9},S?u(e.index,e.groupIndex,e.data,d):u(e.index,e.data,d))})})}),z9={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},S9={outline:"none",overflowX:"auto",position:"relative"},O9=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),I9={position:_9(),top:0,width:"100%",zIndex:1};function N9(e,t){if("string"!=typeof e)return{context:t}}function j9(e,t){return{item:"string"==typeof e?void 0:t}}const T9=a.memo(function(){const t=V9("HeaderComponent"),n=W9("headerHeight"),r=V9("HeaderFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,V9("skipAnimationFrameInResizeObserver")),o=V9("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),D9=a.memo(function(){const t=V9("FooterComponent"),n=W9("footerHeight"),r=V9("HeaderFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,V9("skipAnimationFrameInResizeObserver")),o=V9("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null});function L9({useEmitter:t,useEmitterValue:n,usePublisher:r}){return a.memo(function({children:a,style:i,context:o,...l}){const c=r("scrollContainerState"),s=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),d=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:m}=v9(c,u,s,d,void 0,f);return t("scrollTo",m),t("scrollBy",h),e(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?S9:z9,...i},tabIndex:0,...l,...N9(s,o),children:a})})}function P9({useEmitter:t,useEmitterValue:n,usePublisher:r}){return a.memo(function({children:i,style:o,context:l,...c}){const s=r("windowScrollContainerState"),u=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),m=a.useRef(null),v=n("scrollerRef"),{scrollByCallback:g,scrollerRef:y,scrollToCallback:_}=v9(s,d,u,v,p);return p9(()=>{var e;return y.current=p||(null==(e=m.current)?void 0:e.ownerDocument.defaultView),()=>{y.current=null}},[y,p]),t("windowScrollTo",_),t("scrollBy",g),e(u,{ref:m,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...0!==f?{height:f+h}:{}},...c,...N9(u,l),children:i})})}const R9=({children:t})=>{const n=a.useContext(f9),r=W9("viewportHeight"),i=W9("fixedItemHeight"),o=V9("alignToBottom"),l=V9("horizontalDirection"),c=k7(a.useMemo(()=>V6(r,e=>r8(e,l?"width":"height")),[r,l]),!0,V9("skipAnimationFrameInResizeObserver"));return a.useEffect(()=>{n&&(r(n.viewportHeight),i(n.itemHeight))},[n,r,i]),e("div",{"data-viewport-type":"element",ref:c,style:O9(o),children:t})},H9=({children:t})=>{const n=a.useContext(f9),r=W9("windowViewportRect"),i=W9("fixedItemHeight"),o=V9("customScrollParent"),l=O7(r,o,V9("skipAnimationFrameInResizeObserver")),c=V9("alignToBottom");return a.useEffect(()=>{n&&(i(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,i]),e("div",{"data-viewport-type":"window",ref:l,style:O9(c),children:t})},B9=({children:t})=>{const n=V9("TopItemListComponent")||"div",r=V9("headerHeight"),a={...I9,marginTop:`${r}px`},i=V9("context");return e(n,{style:a,...N9(n,i),children:t})},q9=a.memo(function(t){const r=V9("useWindowScroll"),a=V9("topItemsIndexes").length>0,i=V9("customScrollParent"),o=V9("context");return n(i||r?G9:Q9,{...t,context:o,children:[a&&e(B9,{children:e(M9,{showTopList:!0})}),n(i||r?H9:R9,{children:[e(T9,{}),e(M9,{}),e(D9,{})]})]})}),{Component:F9,useEmitter:U9,useEmitterValue:V9,usePublisher:W9}=d9(E9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},q9),Q9=L9({useEmitter:U9,useEmitterValue:V9,usePublisher:W9}),G9=P9({useEmitter:U9,useEmitterValue:V9,usePublisher:W9}),Y9=F9,K9=y7(()=>{const e=p7(e=>n("td",{children:["Item $",e]})),t=p7(null),r=p7(e=>n("td",{colSpan:1e3,children:["Group ",e]})),a=p7(null),i=p7(null),o=p7({}),l=p7(b9),c=p7(G6),s=(e,t=null)=>m7(s7(o,l7(t=>t[e]),i7()),t);return{components:o,computeItemKey:l,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FillerRow:s("FillerRow"),fixedFooterContent:i,fixedHeaderContent:a,itemContent:e,groupContent:r,ScrollerComponent:s("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TableBodyComponent:s("TableBody","tbody"),TableComponent:s("Table","table"),TableFooterComponent:s("TableFoot","tfoot"),TableHeadComponent:s("TableHead","thead"),TableRowComponent:s("TableRow","tr"),GroupComponent:s("Group","tr")}});Z6(c9,K9),_9();const Z9={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},X9={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:J9,floor:$9,max:eee,min:tee,round:nee}=Math;function ree(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function aee(e,t){return e&&e.width===t.width&&e.height===t.height}function iee(e,t){return e&&e.column===t.column&&e.row===t.row}const oee=y7(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:a,headerHeight:i,scrollBy:o,scrollContainerState:l,scrollTo:c,scrollTop:s,smoothScrollTargetReached:u,viewportHeight:d},f,h,{didMount:p,propsReady:m},{customScrollParent:v,useWindowScroll:g,windowScrollContainerState:y,windowScrollTo:_,windowViewportRect:b},w])=>{const E=p7(0),A=p7(0),x=p7(Z9),C=p7({height:0,width:0}),k=p7({height:0,width:0}),M=v7(),z=v7(),S=p7(0),O=p7(null),I=p7({column:0,row:0}),N=v7(),j=v7(),T=p7(!1),D=p7(0),L=p7(!0),P=p7(!1),R=p7(!1);X6(s7(p,h7(D),o7(([e,t])=>!!t)),()=>{J6(L,!1)}),X6(s7(b7(p,L,k,C,D,P),o7(([e,t,n,r,,a])=>e&&!t&&0!==n.height&&0!==r.height&&!a)),([,,,,e])=>{J6(P,!0),x8(1,()=>{J6(M,e)}),n7(s7(s),()=>{J6(t,[0,0]),J6(L,!0)})}),t7(s7(j,o7(e=>null!=e&&e.scrollTop>0),c7(0)),A),X6(s7(p,h7(j),o7(([,e])=>null!=e)),([,e])=>{e&&(J6(C,e.viewport),J6(k,e.item),J6(I,e.gap),e.scrollTop>0&&(J6(T,!0),n7(s7(s,d7(1)),e=>{J6(T,!1)}),J6(c,{top:e.scrollTop})))}),t7(s7(C,l7(({height:e})=>e)),d),t7(s7(b7(w7(C,aee),w7(k,aee),w7(I,(e,t)=>e&&e.column===t.column&&e.row===t.row),w7(s)),l7(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),N),t7(s7(b7(w7(E),r,w7(I,iee),w7(k,aee),w7(C,aee),w7(O),w7(A),w7(T),w7(L),w7(D)),o7(([,,,,,,,e])=>!e),l7(([e,[t,n],r,a,i,o,l,,c,s])=>{const{column:u,row:d}=r,{height:f,width:h}=a,{width:p}=i;if(0===l&&(0===e||0===p))return Z9;if(0===h){const t=C8(s,e);return function(e){return{...X9,items:e}}(ree(t,t+Math.max(l-1,0),o))}const m=lee(p,h,u);let v,g;c?0===t&&0===n&&l>0?(v=0,g=l-1):(v=m*$9((t+d)/(f+d)),g=m*J9((n+d)/(f+d))-1,g=tee(e-1,eee(g,m-1)),v=tee(g,eee(0,v))):(v=0,g=-1);const y=ree(v,g,o),{bottom:_,top:b}=cee(i,r,a,y),w=J9(e/m);return{bottom:_,itemHeight:f,items:y,itemWidth:h,offsetBottom:w*f+(w-1)*d-_,offsetTop:b,top:b}})),x),t7(s7(O,o7(e=>null!==e),l7(e=>e.length)),E),t7(s7(b7(C,k,x,I),o7(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),l7(([e,t,{items:n},r])=>{const{bottom:a,top:i}=cee(e,r,t,n);return[i,a]}),i7($7)),t);const H=p7(!1);t7(s7(s,h7(H),l7(([e,t])=>t||0!==e)),H);const B=g7(s7(b7(x,E),o7(([{items:e}])=>e.length>0),h7(H),o7(([[e,t],n])=>{const r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),l7(([[,e]])=>e-1),i7())),q=g7(s7(w7(x),o7(({items:e})=>e.length>0&&0===e[0].index),c7(0),i7())),F=g7(s7(w7(x),h7(T),o7(([{items:e},t])=>e.length>0&&!t),l7(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),i7(J7),f7(0)));t7(F,h.scrollSeekRangeChanged),t7(s7(M,h7(C,k,E,I),l7(([e,t,n,r,a])=>{const i=E8(e),{align:o,behavior:l,offset:c}=i;let s=i.index;"LAST"===s&&(s=r-1),s=eee(0,s,tee(r-1,s));let u=see(t,a,n,s);return"end"===o?u=nee(u-t.height+n.height):"center"===o&&(u=nee(u-t.height/2+n.height/2)),c&&(u+=c),{behavior:l,top:u}})),c);const U=m7(s7(x,l7(e=>e.offsetBottom+e.bottom)),0);return t7(s7(b,l7(e=>({height:e.visibleHeight,width:e.visibleWidth}))),C),{customScrollParent:v,data:O,deviation:S,footerHeight:a,gap:I,headerHeight:i,increaseViewportBy:e,initialItemCount:A,itemDimensions:k,overscan:n,restoreStateFrom:j,scrollBy:o,scrollContainerState:l,scrollHeight:z,scrollTo:c,scrollToIndex:M,scrollTop:s,smoothScrollTargetReached:u,totalCount:E,useWindowScroll:g,viewportDimensions:C,windowScrollContainerState:y,windowScrollTo:_,windowViewportRect:b,...h,gridState:x,horizontalDirection:R,initialTopMostItemIndex:D,totalListHeight:U,...f,endReached:B,propsReady:m,rangeChanged:F,startReached:q,stateChanged:N,stateRestoreInProgress:T,...w}},Z6(P8,I7,I8,$8,b8,e9,C7));function lee(e,t,n){return eee(1,$9((e+n)/($9(t)+n)))}function cee(e,t,n,r){const{height:a}=n;if(void 0===a||0===r.length)return{bottom:0,top:0};const i=see(e,t,n,r[0].index);return{bottom:see(e,t,n,r[r.length-1].index)+a,top:i}}function see(e,t,n,r){const a=lee(e.width,n.width,t.column),i=$9(r/a),o=i*n.height+eee(0,i-1)*t.row;return o>0?o+t.row:o}const uee=y7(()=>{const e=p7(e=>`Item ${e}`),t=p7({}),n=p7(null),r=p7("virtuoso-grid-item"),a=p7("virtuoso-grid-list"),i=p7(b9),o=p7("div"),l=p7(G6),c=(e,n=null)=>m7(s7(t,l7(t=>t[e]),i7()),n),s=p7(!1),u=p7(!1);return t7(w7(u),s),{components:t,computeItemKey:i,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:o,itemClassName:r,ItemComponent:c("Item","div"),itemContent:e,listClassName:a,ListComponent:c("List","div"),readyStateChanged:s,reportReadyState:u,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),dee=y7(([e,t])=>({...e,...t}),Z6(oee,uee)),fee=a.memo(function(){const t=_ee("gridState"),n=_ee("listClassName"),r=_ee("itemClassName"),i=_ee("itemContent"),o=_ee("computeItemKey"),l=_ee("isSeeking"),c=bee("scrollHeight"),s=_ee("ItemComponent"),u=_ee("ListComponent"),d=_ee("ScrollSeekPlaceholder"),f=_ee("context"),h=bee("itemDimensions"),p=bee("gap"),v=_ee("log"),g=_ee("stateRestoreInProgress"),y=bee("reportReadyState"),_=k7(a.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;c(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:Aee("column-gap",getComputedStyle(e).columnGap,v),row:Aee("row-gap",getComputedStyle(e).rowGap,v)})},[c,h,p,v]),!0,!1);return p9(()=>{t.itemHeight>0&&t.itemWidth>0&&y(!0)},[t]),g?null:e(u,{className:n,ref:_,...N9(u,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const a=o(n.index,n.data,f);return l?e(d,{...N9(d,f),height:t.itemHeight,index:n.index,width:t.itemWidth},a):m(s,{...N9(s,f),className:r,"data-index":n.index,key:a},i(n.index,n.data,f))})})}),hee=a.memo(function(){const t=_ee("HeaderComponent"),n=bee("headerHeight"),r=_ee("headerFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,!1),o=_ee("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),pee=a.memo(function(){const t=_ee("FooterComponent"),n=bee("footerHeight"),r=_ee("headerFooterTag"),i=k7(a.useMemo(()=>e=>{n(r8(e,"height"))},[n]),!0,!1),o=_ee("context");return t?e(r,{ref:i,children:e(t,{...N9(t,o)})}):null}),mee=({children:t})=>{const n=a.useContext(h9),r=bee("itemDimensions"),i=bee("viewportDimensions"),o=k7(a.useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return a.useEffect(()=>{n&&(i({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,i,r]),e("div",{ref:o,style:O9(!1),children:t})},vee=({children:t})=>{const n=a.useContext(h9),r=bee("windowViewportRect"),i=bee("itemDimensions"),o=_ee("customScrollParent"),l=O7(r,o,!1);return a.useEffect(()=>{n&&(i({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,i]),e("div",{ref:l,style:O9(!1),children:t})},gee=a.memo(function({...t}){const r=_ee("useWindowScroll"),a=_ee("customScrollParent"),i=a||r?Eee:wee,o=a||r?vee:mee,l=_ee("context");return e(i,{...t,...N9(i,l),children:n(o,{children:[e(hee,{}),e(fee,{}),e(pee,{})]})})}),{useEmitter:yee,useEmitterValue:_ee,usePublisher:bee}=d9(dee,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},gee),wee=L9({useEmitter:yee,useEmitterValue:_ee,usePublisher:bee}),Eee=P9({useEmitter:yee,useEmitterValue:_ee,usePublisher:bee});function Aee(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,A7.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const xee=({optionsList:r=[],onSelectVariable:a,dropdownPosition:i,position:o="relative",width:l,height:c="160px",zIndex:s=9999})=>{const u={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"STEPGROUP"!==e?.parentVariableType||"LOCAL"!==e.type&&"STEPGROUP"!==e?.type?"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":u[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:T("ff-variable-dropdown",o),style:i?{top:i.top+30,left:i.left-30,width:l,height:c,zIndex:s}:{width:l,height:c,zIndex:s},children:hF(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(cF,{as:"span",fontSize:12,children:"No Option"})}):e(Y9,{totalCount:r.length,itemContent:i=>{const o=r[i];return o?e("div",{className:"ff-variable-data",onMouseDown:()=>a(o),children:l.endsWith("px")?n(t,{children:[e(pF,{title:xF(f(o),h(l),"pixel")?f(o):"",style:{width:`${h(l)}px`},children:e(cF,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(o)})}),e(lF,{name:d(o),height:24,width:24,hoverEffect:!0})]}):e(q6,{option:o})},`${o.id}-${i}`):null},style:{height:c,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},Cee=({data:r=[],width:a,height:i,lineChartWidth:o,yAxisLabel:c,xAxisLabel:u,yAxisValueColor:d,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:m,fontWeight:v,numberSize:g,chartName:y,shouldCenterSinglePoint:_,xAxisLabelGap:b=16,isLeftOverflow:w=!1})=>{const E=40,A=a-80,x=i-80,[C,k]=s(!1),[M,z]=s({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{k(!1),z(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,o=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:a+20+b,gap:b},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:i},children:e(cF,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:i,width:a,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:x,x2:A,y2:x,stroke:f,strokeWidth:1}),e("text",{x:A/2.1,y:x+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:v},children:u}),t.map((t,n)=>e("text",{x:n*(A/(l-1)),y:x+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:o}).map((t,n)=>{const a=n*r/(o-1),i=a/1024;return e("text",{x:-10,y:x-a*x/r,textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:i?.toFixed(1)},`y-${n}`)})]})})})]})}function S(e){if(!isNaN(e))return parseFloat(e);const t=CU,n=e.match(t);if(!n)throw new Error("Invalid input format. Use '<value> <unit>' format (e.g., '10.9580078125 KB') or just a number.");const r=parseFloat(n[1]);switch(n[2]?n[2].toUpperCase():null){case"GB":return parseFloat((1024*r).toFixed(2));case"MB":return parseFloat(r.toFixed(2));case"KB":return parseFloat((r/1024).toFixed(2));default:throw new Error("Invalid unit. Supported units are GB, MB, and KB.")}}const O=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),I="date",N=O?"totalMemory":"value",j=e=>{const t=r?.[0]?.data?.length;if(1===t)return _?A/2:A;const n=r[0].data.findIndex(t=>t[I]===e);return-1===n?0:n/(t-1)*A},T=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[N]))),5),D=e=>{if("memory"===y){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[N]))));return x-e*x/(t>1024?t:1024)}return x-e*x/(0===T?1024:T)},L=e=>{if(1===e?.length){const t=e?.[0],n=j(t[I]),r=D(S(t[N]));return`M 0 ${D(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const a=j(n[I]),i=D(S(n[N]));if(0===r)return`M ${a} ${i}`;const o=e[r-1],l=o?j(o[I]):0;return`${t} C ${l+(a-l)/2} ${o?D(S(o[N])):0}, ${a-(a-l)/2} ${i}, ${a} ${i}`},"")},P=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:a+20+b,gap:b},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:i},children:e(cF,{className:"ff-line-chart-yAxisLabel",fontSize:m,fontWeight:"semi-bold",children:c})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:i,width:a,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>x)return k(!1),void z({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let a={hoverValues:{},dotPositions:{}},i=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-j(t[I]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(i=r[I],a.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(EU),r=e.match(AU);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[N]),a.dotPositions[t]={x:j(r[I]),y:D(S(r[N]))})}),k(!0),z({cursorX:n,hoverValues:a.hoverValues,dotPositions:a.dotPositions,currentXValue:i,tooltip:i?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>z({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null}),className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:0,x2:0,y2:x,strokeWidth:2}),e("line",{x1:0,y1:x,x2:A,y2:x,stroke:f,strokeWidth:1}),e("text",{x:A/2.1,y:x+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:m,fontWeight:v},children:u}),r.map((r,a)=>{return!1!==r.show?n("g",{children:[e("path",{d:L(r.data),fill:"none",stroke:r.color,strokeWidth:o,opacity:(i=r.data,i.every(e=>0===S(e[N]))?.5:1)}),M.dotPositions[a]&&n(t,{children:[e("line",{x1:M.dotPositions[a].x,y1:0,x2:M.dotPositions[a].x,y2:x,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:M.dotPositions[a].x,cy:M.dotPositions[a].y,r:5,fill:"white",stroke:r.color,strokeWidth:o,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:M.dotPositions[a].y,x2:A,y2:M.dotPositions[a].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},a):null;var i}),(()=>{if(1===P.length){const t=P?.[0];return e("text",{x:_?A/2:A,y:x+15,textAnchor:_?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[I]?String(t[I]):""},String(t[I]))}if(P.length<7)return P.map(t=>e("text",{x:j(t[I]),y:x+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[I]?String(t[I]):""},String(t[I])));{const t=(a-80-7*9.2)/6;return Array.from({length:7}).map((n,r)=>{const a=Math.floor(r*(P?.length-1)/6),i=P[a];return e("text",{x:r*t,y:x+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=i?.[I]?String(i?.[I]):""},String(i?.[I]))})}})(),(()=>{if("memory"===y){const t=Math.max(T,1024);return Array.from({length:6}).map((n,r)=>{const a=r*t/5,i=a/1024;return e("text",{x:-10,y:D(a),textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:i.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*T/5;return e("text",{x:-10,y:D(r),textAnchor:"end",fill:d,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),C&&M.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&M.tooltip.left/2>a/1.75?M.tooltip.left-180:M.tooltip.left,top:M.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:M.currentXValue}),Object.entries(M.hoverValues).map(([t,a])=>!1!==r[Number(t)]?.show&&n("div",{className:"ff-line-chart-inner-tooltip",children:["default"!==r[Number(t)]?.name&&e("div",{className:"ff-line-chart-status-dot",style:{backgroundColor:r[Number(t)]?.color}}),r[Number(t)]?.name,": ",a]},t))]})]})]})},kee=({onClose:t,top:r="100px",left:a="0px",className:i,description:o="Download and Install the fireflink client to run the script",onClick:c=()=>{},optionZIndex:s=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${i}`,style:{top:r,left:a,zIndex:s},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(cF,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(lF,{name:"close",color:"var(--brand-color)",className:"ff-download-client-close-icon",height:12,width:12})]}),n("div",{className:"ff-download-client-content-text",children:[e(cF,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:o}),e(cF,{as:"div",className:"ff-download-client-description-text",textAlign:"center",fontWeight:"medium",lineHeight:"26px",children:"Choose OS to Download"}),e("div",{className:"ff-download-client-os-wrapper",children:["windows","mac_icon","linux"].map(t=>e("div",{className:"ff-os-version-wrapper",onClick:()=>{c("mac_icon"===t?"mac":t)},children:e(lF,{name:t,height:36,width:36})},t))})]})]})},Mee=({legendName:t,height:r,width:a,children:i})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:a},children:[e("legend",{className:"ff_legend_container",children:e(cF,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:i})]})}),zee=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:a="relative",width:i="100%",zIndex:o,truncateTextValue:l=34})=>e("div",{className:T(`ff-variable-dropdown-container ${a}`),style:n?{top:n.top+30,left:n.left-30,width:i,zIndex:o}:{width:i,zIndex:o},children:hF(r)?e("div",{className:"ff-variable-option no-data",children:e(cF,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(pF,{title:xF(n?.name,l,"pixel")?n?.name:"",children:e(cF,{children:AF(n?.name,l,"pixel")})})},n?.id))}),See=i(({label:t="",hashInputValue:r="",setHashInputValue:a,variableList:i=[],placeholder:c="Enter text",onChange:u,onPaste:d,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:m="100%",dropdownHeight:v="160px",isHash:g=!1,isOnlyHash:_=!1,dataFiles:b=[],showAddVariableIcon:w=!0,helperText:E="",error:A,autoComplete:x="off",required:C=!1,zIndex:k=9999,truncateTextValue:M=34,formProps:z={},getSelectedVariable:S=()=>{},symbol:O="$",type:I="text",clearIcon:N=!0,inputTitle:j="",onBlur:D,helperTextWidth:L,iconProps:P={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...R},H)=>{const[B,q]=s(!1),[F,U]=s(!1),[V,W]=s(!1),[Q,G]=s(null),[Y,K]=s(0),[Z,X]=s(!1),[J,$]=s([]),ee=o(null),te=o(null),[ne,re]=s("auto"),ae=P?.isShowIcon;l(()=>{const e=te.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;re(e)}});return t.observe(e),()=>{t.disconnect()}},[]),y(H,()=>ee.current),l(()=>{null!==Q&&ee.current&&(ee.current.setSelectionRange(Q,Q),ee.current.focus())},[Q]),l(()=>{g&&q(p.startsWith("#"));const e=b?.find(e=>e.name===p),t=i?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=b.filter(t=>t.name.toLowerCase().includes(e));$(t),q(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),a=p.length>(t?.name.length||0),o=p.length>0&&!r||p.startsWith("#");_?X(!1):r||n||p.includes("$")||p.includes("#")?(X(!1),o&&X(!0)):a&&!p.includes("$")&&X(!0)},[p]);const ie=()=>{ee.current&&K(ee.current.selectionStart||0)},oe=ie,le=ie;l(()=>{ee.current&&K(ee.current.selectionStart||0)},[p]);const ce=e=>{if(ee.current){const{selectionStart:t,selectionEnd:n}=ee.current,r=`${e.name}`;let i;if(i=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,u){u({target:{value:i}},e),S(e.name)}ee.current.value=i,a?.(e),G((t||0)+r.length),q(!1),U(!0)}};const se=function(e,t,n){let r=!1,a="";const i="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:a};const o=e.lastIndexOf(O,t-1),l=e.indexOf(O,t);if(-1!==o&&(_&&"$"===e[o]?r=!1:t===o+1?(r=!0,a=""):(a=e.slice(o+1,-1===l?void 0:l),t>o+1&&(a=e.slice(o+1,t)),r=!0),F&&i&&(r=!1),(/[{}]/.test(a)||0===t)&&(r=!1,a=""),a)){n.some(e=>e.name.toLowerCase().includes(a.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:a}}(p,Y,i),ue=()=>i?.filter(e=>e?.name?.toLowerCase()?.includes(se?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:te,children:[e(pF,{title:j,style:{width:"100%"},children:e(bV,{...R,name:"add_variable",ref:ee,type:I,className:T("ff-variable-input-container",{"ff-variable-input-container--show-icon":ae}),value:p,onChange:u,onPaste:()=>{X(!0)},variant:"primary",label:t,placeholder:c,onClick:oe,onKeyUp:le,onFocus:()=>W(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||W(!1)})(e),D?.(e)},autoComplete:x,helperText:E,error:A,required:C,helperTextWidth:L,...z})}),!hF(p)&&Z&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(cF,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!hF(p)&&!_&&e("div",{className:T("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":ae}),children:N&&e(pF,{title:"Cancel",style:{zIndex:99999},children:e(lF,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),ae&&e("div",{className:"ff-info-icon-container",children:e(pF,{title:ae&&!P?.isIconDisable?P?.iconToolTipTitle:"",children:e(lF,{name:P?.iconName||"",hoverEffect:!1,height:16,width:16,color:P?.iconColor||"var(--text-area-default-color)",onClick:e=>{P?.onIconClick&&P?.onIconClick(e)},disabled:P?.isIconDisable,cursorType:"pointer"})})})]}),se?.showDropdown&&V&&e(xee,{position:"absolute",zIndex:k,truncateTextValue:M,width:ne,height:hF(ue())?"auto":v,optionsList:ue(),onSelectVariable:ce}),B&&g&&V&&e(zee,{position:"relative",zIndex:k,truncateTextValue:M,width:ne,filteredOptions:J,onSelectVariable:ce})]})}),Oee=({isOpen:t,variableTypesList:r=[],onClose:a,onNameChange:i,onValueChange:o,variableName:c,variableValue:u,onVariableTypeChange:d,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:m,mode:v="create",disabled:g,dataFiles:y=[],truncateTextValue:_=34,isEnterKeySubmit:b=!1})=>{const[w,E]=s(!1),[A,x]=s(""),[C,k]=s(),[M,z]=s(!1),[S,O]=s(!1),[I,N]=s({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===v&&N({name:c,value:u,isChecked:h})},[]);const j=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":qF.test(e)?e.length<3?"Name should contain at least 3 characters":e.length>25?"Name can contain at most 25 characters":"":"Name should be alphanumeric":"Variable Name is required";function T(e){const t=!!e,n=qF.test(e),r=ZU.test(e),a=e.length>=3&&e.length<=25;return t&&n&&r&&a}l(()=>{const e=j(c);E(!!e),x(e)},[c]),l(()=>{if("edit"!==v)return;const{name:e,value:t,isChecked:n}=I;O(c!==e||u!==t||h!==n)},[v,c,u,h,I]);const D=()=>{!M&&T(c)&&(z(!0),m())};l(()=>{if(!b)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(c)||M||"edit"===v&&!S||D()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[b,c,u,h,M,v,S,f]);return e(vF,{zIndex:1350,onClose:a,isOpen:t,title:"create"===v?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(sF,{onClick:a,label:"Cancel",variant:"tertiary"}),e(sF,{variant:"primary",label:"create"===v?"Create":"Update",type:"submit",onClick:D,disabled:!T(c)||M||"edit"===v&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(bV,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:c||"",onChange:e=>{z(!1),i(e.target.value)},error:w,helperText:A,onBlur:e=>{const t=e.target.value,n=j(t);E(!!n),x(n)}})}),e(AW,{label:"Variable Type",required:!0,onChange:e=>{d(e),z(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===v}),e(See,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:_,dataFiles:y,dropdownWidth:"100%",setHashInputValue:k,hashInputValue:C||{},value:u||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;o(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(bF,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(pF,{title:"Once the value is hidden, it cannot be undone",children:e(lF,{name:"info",width:12,height:12})})]})]})})},Iee=({highlightText:t="",tableMeta:r=[],tableData:a=[],accordionType:i="row",noDataContent:o,height:l="100%",withFixedHeader:c=!1,headerType:u,TableAccordionStateIconWidth:d=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=s(-1),m=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},v=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===i&&0===r?"":e(cF,{children:m(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:T("ff-accordion-table-container",{"ff-accordion-fixed-header-table":c}),children:[e("table",{cellSpacing:0,className:T("ff-accordion-table",{"ff-accordion-fixed-header":c}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:T("ff-table-header",u&&`ff-accordion-table--${u}-bg`),children:e("div",{children:e(cF,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===i&&a.map((n,r)=>e(yF,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:v(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:d,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===i&&a.map((a,i)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(pF,{title:a.disable?a?.disableInfoMessage:"string"==typeof a.title&&xF(a.title,r[0]?.width,"pixel")?a.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${a.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(cF,{children:e(gF,{text:AF(a.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!a.disable&&(e=>{p(e===h?-1:e)})(i)},children:e(lF,{name:h===i?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:d,height:f,hoverEffect:!1})})]})})}),h===i&&e("div",{children:v(a.data)})]},`column-accordion-${i}`)),a.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:o})]})},Nee=({progressPercentage:t,totalMemory:r,usedMemory:a,color:i="var(--brand-color)",trackColor:o="#f0f0f0",height:l=10,label:c,labelFontSize:s=12,labelTextColor:u="var(--ff-card-status-text-color)",showPercentage:d=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const m=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),a=n[2];return"gb"===a?1024*r:"kb"===a?r/1024:r};let v=0,g=c;if(void 0!==r&&void 0!==a){const e=m(a),t=m(r);t>0?(v=e/t*100,g=c||a):(v=0,g="0MB")}else v=t||0;const y=Math.max(0,Math.min(v,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:o,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${y}%`,backgroundColor:i,height:`${l}px`},children:d&&e(cF,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(y)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(cF,{fontSize:s,color:u,children:e(pF,{title:xF(g,10,"count")?g:"",children:AF(g,10,"count")})})})]})},jee=({variant:t="primary",size:n="small",onClick:r,label:a="Choose File",disabled:i=!1,type:l="button",className:c="",style:u={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:m="auto",selectedFile:v={},handleCloseIcon:g,isMandatory:y=!1})=>{const _=o(null),[b,w]=s(0);d(()=>{_.current&&w(_.current.getBoundingClientRect().width-10)},[p]);const E=v?.name||a,A=b?AF(E,b,"pixel"):E,x=!!b&&xF(E,b,"pixel");return e("div",{ref:_,style:{width:p},children:e(pF,{title:x?E:"",children:e(sF,{variant:t,label:A,type:l,onClick:r,buttonWidth:p,buttonHeight:m,isChooseFile:h,size:n,disabled:i,className:c,iconName:f,style:u,iconPosition:"right",selectedFile:v,handleCloseIcon:g,isMandatory:y})})})},Tee=({selected:t="text",handleClick:r,tabList:a})=>{const i=a?.includes("Automation"),o=a?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(pF,{title:i?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(i?"Automation":"Add Automation"),children:e(lF,{name:i?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(pF,{title:o?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(o?"Manual":"Add Manual"),children:e(lF,{name:o?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},Dee=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(pF,{title:t===r.name?null:r.tooltip,zIndex:1e3,children:e("div",{className:"ff-switch-button "+(t===r.name?"active":""),onClick:()=>n(r.name),children:e(lF,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),Lee=({onModalClose:t,MediaSrc:r,fileName:i,onDeleteClick:o,mediaType:c,fileId:u,thumbnailMediaSrc:d,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:m=!1,previewOnly:v=!1,iconName:g="video_preview",isDisabled:y=!1})=>{const[_,b]=s(!1),w=a.useRef(null),E=()=>{b(!0),h&&h(u)},A=()=>{t?.(),b(!1)},x=()=>{p&&p(u)};return l(()=>{v&&b(!0)},[v]),n("div",{children:[!v&&(m?e(lF,{name:g,hoverEffect:!0,onClick:E,disabled:y}):e(H6,{mediaSrc:r,mediaType:c,onDownloadClick:x,onDeleteClick:()=>o?.(r),onExpandClick:E,fileName:i,fileId:u,thumbnailMediaSrc:d,isDelete:f})),_&&e(hJ,{isOpen:_,onClose:A,isFooterDisplayed:!1,isHeaderDisplayed:!1,customWidth:"1130px",customHeight:"570px",zIndex:1e4,children:n("div",{className:"media-wrapper",children:[n("div",{className:"ff-expand-icons",children:[e(pF,{title:"Download File",children:e(lF,{name:"download_file_icon",onClick:x,color:"var(--icons-default-color)",className:"header-icons"})}),e(pF,{title:"Expand",children:e(lF,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(pF,{title:"close",children:e(lF,{name:"close",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===c&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===c&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:w,onCanPlay:()=>{if(w.current){const e=w.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},Pee=({children:t,orientation:r="",navBarIcons:i=[],mobileHeight:o=448,mobileWidth:l=220,UtilityBar:c,tooltip:s={},background:u,navBarPosition:d="bottom"})=>{const f="portrait"===r,h=f?o:l,p=f?l:o,m=c&&"top"===d,v=c&&"bottom"===d,g=c&&"left"===d;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",m?"navbar-top":"",v?"navbar-bottom":""].filter(Boolean).join(" "),children:[m&&e("div",{className:"ff-nav-bar top-nav-bar",children:i.map(({title:t,name:n,className:r,...a},o)=>{const l=s?.[n]??o;return e(pF,{title:s?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${o===i.length-1?"last-icon":""} ${m?"navbar-top":""}`,children:e(lF,{name:n,...a})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:u||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:a.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*o+"px"}})})})}),c&&v&&e("div",{className:"ff-nav-bar",children:i?.map((t,n)=>{const{title:r,...a}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===i.length-1?"last-icon":""}`,children:e(pF,{title:r,children:e(lF,{...a})})},n)})}),c&&g&&e("div",{className:"ff-side-nav-bar",children:i?.map((t,n)=>{const{title:r,...a}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===i.length-1?"last-icon":""}`,children:e(pF,{title:r,placement:"bottom",children:e(lF,{...a})})},n)})})]})},Ree=i(({width:t=300,height:r=40,iconHeight:a=16,iconWidth:i=16,placeholder:l="Enter text",iconName:c="right_arrow_filled_icon",iconPosition:s="left",borderRadius:u=4,autoFocus:d=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:m,onPromptChange:v,onBlur:g,onFocus:y,disableInput:_,isAdditionalIcon:b=!1,additionalIconName:w,additionIconToolTip:E,onAdditionalIconClick:A},x)=>{const C=o(null);zF([{key:"Enter",action:()=>k()}],C);const k=e=>{f&&m?.(f.trim())};return n("div",{className:T("ff-prompt-container",{"icon-left":"left"===s,"icon-right":"left"!==s}),style:{width:`${t}px`,height:`${r}px`,borderRadius:u},ref:C,children:[e(pF,{placement:"top",title:p,children:e(lF,{name:c,className:"ff-prompt-icon",height:a,width:i,onClick:m,color:h,disabled:hF(f)})}),e("input",{ref:x,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:d,onChange:v,onFocus:y,onBlur:g,value:f,readOnly:_}),b&&w&&e(pF,{placement:"top",title:E,children:e(lF,{name:w,className:"ff-prompt-icon additional-icon",height:a,width:i,onClick:A})})]})}),Hee=({content:t,isVisible:n,maxWidth:r=300,onClick:a,isClickable:i=!0,arrowPosition:o="left"})=>e("div",{onClick:a,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:T("ff-chat-msg-box",{visible:n,hidden:!n,pointer:i,default:!i,"chat-arrow-left":"left"===o,"chat-arrow-right":"left"!==o}),children:e("div",{className:T("content",`arrow-${o}`),children:e(cF,{children:t})})}),Bee=({iconName:r,iconPosition:{top:a,left:i,bottom:o,right:l},hoverIconPosition:{top:c,left:u,bottom:d,right:f},modalPosition:{top:h,left:p,bottom:m,right:v},modalWidth:g,modalHeight:y,headerContent:_="Header Content",footerContent:b="Footer Content",iconWidth:w,iconHeight:E,modalHeading:A="Ask Fia",children:C,onClearChat:k})=>{const[M,z]=s(!1),[S,O]=s(!1);return n(t,{children:[n("div",{style:{top:void 0!==a?`${a}px`:void 0,left:void 0!==i?`${i}px`:void 0,bottom:void 0!==o?`${o}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(lF,{className:"ff-dynamic-icon",name:r,onClick:()=>{O(e=>!e),setTimeout(()=>z(e=>!e),10)},height:E,width:w}),e("div",{style:{top:void 0!==c?`${c}px`:void 0,left:void 0!==u?`${u}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==f?`${f}px`:void 0},className:"ff-chat-icon-hover",children:e(lF,{name:"ask_fia_icon",height:32,width:82})})]}),S&&x(e("div",{className:T("ff-dynamic-modal",{open:M}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==m?`${m}px`:void 0,right:void 0!==v?`${v}px`:void 0,position:"fixed",height:y,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[_&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(lF,{height:16,width:16,name:"fia_icon"}),e(cF,{fontWeight:"medium",children:A})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(pF,{title:"Clear chat",placement:"bottom",children:e(lF,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:k})})}),e("span",{className:"action",children:e(pF,{title:"Close",placement:"bottom",children:e(lF,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(z(!1),void setTimeout(()=>O(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:C}),b&&e("div",{className:"ff-dynamic-modal-footer",children:b})]})}),document.body)]})},qee=i(({iconName:r,hoverTitle:a,iconPosition:{top:i,left:c,bottom:u,right:d},hoverIconPosition:{top:f,left:h,bottom:p,right:m},modalPosition:{top:v,left:g,bottom:_,right:b},modalWidth:w,modalHeight:E,headerContent:A="Header Content",footerContent:C="Footer Content",iconWidth:k,iconHeight:M,children:z,onVisibilityChange:S},O)=>{const[I,N]=s(!1),[j,D]=s(!1),L=o(null),P=()=>{L.current&&clearTimeout(L.current),N(!1),L.current=setTimeout(()=>{D(!1),S?.(!1)},300)};return y(O,()=>({closeModal:P})),l(()=>()=>{L.current&&clearTimeout(L.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==c?`${c}px`:void 0,bottom:void 0!==u?`${u}px`:void 0,right:void 0!==d?`${d}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(lF,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{L.current&&clearTimeout(L.current),D(e=>!e),S?.(!j),L.current=setTimeout(()=>N(e=>!e),10)},height:M,width:k}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==m?`${m}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(cF,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:a})})})]}),j&&x(e("div",{className:T("ff-ai-dynamic-modal",{open:I}),style:{top:void 0!==v?`${v}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==_?`${_}px`:void 0,right:void 0!==b?`${b}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[A&&e("div",{className:"ff-ai-dynamic-modal-header",children:A}),e("div",{className:"ff-ai-dynamic-modal-body",children:z}),C&&e("div",{className:"ff-ai-dynamic-modal-footer",children:C})]})}),document.body)]})}),Fee=({variant:t,title:r,tabTitle:a,comment:i,profileShortName:o})=>n("div",{className:"ff-history-card",children:[e("div",{className:T("header",`header--${t}`),children:e(cF,{fontWeight:"semi-bold",children:a})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(cF,{className:T("avatar",`avatar--${t}`),children:o}),e(cF,{children:r})]})}),n("div",{className:"comment-container",children:[e(cF,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(cF,{color:"var(--details-page-value-color)",className:"comment",children:i})]})]})]}),Uee=({onChange:t,disabled:r,checked:a=!1,id:i="toggle",path:o})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${i}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:a}),e("label",{className:T("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${i}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(cF,{className:T("ff--ai-switch-typography",{left:a,right:!a}),as:"div",fontWeight:"bold",fontSize:18,color:a?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:o,alt:"AI image"})]})})})]}),Vee=i(({name:t,height:n=30,width:r=30,path:a="",onClick:i,color:c="var(--brand-color)",hoverEffect:s=!1,className:u="",disabled:d=!1,variant:f="light",isSelected:h=!1,x:p,y:m,tabIndex:v=-1,...g},y)=>{if(!oF[t])return null;const _=o(null);l(()=>{_.current&&(void 0!==p&&_.current.setAttribute("x",String(p)),void 0!==m&&_.current.setAttribute("y",String(m)))},[p,m]);const b={ref:y,onClick:d?void 0:i,style:{height:`${n}px`,width:`${r}px`,cursor:d?"not-allowed":"pointer",opacity:d?.3:1},tabIndex:v,...g};return e("span",{...b,children:e("img",{height:n,width:r,src:a,alt:""})})}),Wee=({id:r=0,serialNumber:a,activeId:i,setActiveId:c,children:u,onIconClick:d,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:m,disabled:v,isEditAccess:g,versionsLength:y,count:_,hiddenActions:b=[]})=>{const[w,E]=s(!1),[A,x]=s(!1),C=o(null),k=Array.isArray(b)?b:b?[b]:[],M=(e,t)=>{e.stopPropagation(),t()};l(()=>{C.current&&(()=>{if(C.current){const e=getComputedStyle(C.current),t=1.2*parseFloat(e.fontSize)*6;C.current.scrollHeight>t&&x(!0)}})()},[]);const z=e=>{e.stopPropagation(),E(!w)};return n("div",{className:`ff-prompt-container-Block ${i===r?"active":"inactive"} `,onClick:()=>{c(r),h()},children:[e(cF,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${a}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(w?"expanded":""),ref:C,children:[u,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:z,className:"read-less-btn",children:e(cF,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),A&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:z,className:"read-more-btn",children:e(cF,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!k.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(y??0)>=3||v;return e(pF,{title:t.title,placement:"bottom",children:e(lF,{disabled:r,name:t.action,color:t.color,hoverEffect:!0,onClick:e=>((e,t)=>{e.stopPropagation(),d(t)})(e,t.action)})},`${t?.title}-${n}`)})}),n("div",{className:"ff-prompt-icons-rightside",children:[e(lF,{disabled:1===_,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>M(e,m)}),f,e(lF,{disabled:_===y,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>M(e,p)})]})]})]})},Qee=i(({type:t="text",variant:r="primary",name:a="",label:i,disabled:o=!1,disableLinkIcon:l=!1,required:c=!1,placeholder:s="Attach Link",value:u,error:d,helperText:f,noBorder:h,className:p="",onChange:m,onBlur:v,onFocus:g,autoComplete:y="off",autoFocus:_=!1,minValue:b=-1/0,maxValue:w=1/0,transparentBackground:E=!1,size:A="small",isLabelRequired:x=!0,onClick:C,onKeyUp:k,isViewMode:M=!1,...z},S)=>{const O=!hF(u);return n("fieldset",{className:T("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":o}),children:[n("div",{className:T("ff-link-input-container",{"ff-link-input-container--float":O,"ff-link-input-container--disabled":!!o}),children:[x&&n("label",{className:T(`ff-link-input-label-container ff-link-input-label-container--${A}`,{"ff-link-input-label-container--danger":!!d}),htmlFor:a,children:[c&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:T(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!u,"ff-link-input-label--disabled":!!o,"ff-link-input-label--danger":!!d}),children:i})]}),e("input",{ref:S,name:a,value:u,type:t,spellCheck:!1,id:a,className:T(`ff-link-input ff-link-input-${r} default-input ff-link-input--${A}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!u,"ff-link-input--disabled":!!o,"ff-link-input--danger":!!d,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!x},`${p}`),placeholder:s,disabled:M||o,onChange:m,onFocus:g,onBlur:v,autoComplete:y,autoFocus:_,min:b,max:w,onClick:C,onKeyUp:k,...z}),e("div",{className:"input-link-icon",children:l||d||!O?e(lF,{name:"link",disabled:!0}):e(pF,{title:"Click here to navigate",children:e("span",{children:e(lF,{name:"link",disabled:!1,onClick:()=>{u&&!d&&window.open(u,"_blank")}})})})})]}),f&&d&&e("span",{className:T("ff-link-input-message",{"ff-link-input-message--danger":!!d}),children:f})]})}),Gee=({labelsList:r=[],height:a=""})=>{const i=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(cF,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!hF(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(pF,{title:r[0],children:e(cF,{as:"div",children:AF(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:a?{height:a}:void 0})}),r.length>1&&e(pF,{title:e(cF,{as:"div",children:i}),children:e(cF,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class Yee extends w{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Kee=({iconName:t="",onButtonClick:r,buttonLabel:a="Label",buttonText:i="To Add Group",disableButton:o=!1,stepCount:l=1,iconWidth:c=120,iconHeight:s=120,addContentLabel:u="step"})=>n("div",{className:"add-content-button "+(o?"disabled":""),children:[!hF(t)&&e("div",{className:"icon-container",children:e(lF,{name:t,width:c,height:s})}),n("div",{className:"typography-label-button",children:[n(cF,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[u+l," :"]}),e(cF,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(fJ,{label:a,onClick:r,iconName:"plus_user_icon",isDisable:o}),e(cF,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:i})]})]}),Zee=({variant:t="default",tabsData:r,activeTabId:a,onTabClick:i,noBorder:o=!1,noPadding:l=!1,titleSize:c="12px"})=>{const[u,d]=s(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:T(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":o,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(lF,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(u?"arrow_left_accordian":""),onClick:()=>{u>0&&d(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*u}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&i(r.id),disabled:r.disabled,className:T(`ff-tab-button--${t}`,{disabled:r.disabled,active:a===r.id}),style:{flex:"0 0 25%"},children:[n("div",{className:"label-count-section",children:[e(pF,{title:r.label.length>9?r.label:"",children:e(cF,{children:r.label.length>9?r.label.slice(0,9)+"...":r.label,fontSize:c,lineHeight:"18px",fontWeight:a===r.id?"semi-bold":"regular",color:a===r.id?"var(--tabs-label-active-color)":"var(--tabs-label-default-color)",className:T("ff-tab-label",{"ff-tab-label--active":a===r.id})})}),"default"===t&&r.count&&e("span",{className:T("tab-count",{"tab-count--active":a===r.id}),children:r.count})]}),e("div",{className:T("ff-tab-bar",{"ff-tab-bar--active":a===r.id})}),e("span",{className:"ff-defaultStatus "+("success"===r.status?"ff-successStatus":"error"===r.status?"ff-dangerStatus":"")})]},r.id))})}),r.length>4&&e(lF,{className:"ff-tab-icon ff-tab-icon--next",name:""+(u<Math.ceil(r.length/4)-1?"arrow_right_icon":""),onClick:()=>{u<Math.ceil(r.length/4)-1&&d(e=>e+1)},hoverEffect:!0})]}),e("div",{className:"ff-tab-content",children:r.find(e=>e.id===a)?.component})]})},Xee=i(({label:t="Status",iconName:r="update_icon",onClick:a,isDisable:i=!1,variant:o="default",backgroundColor:l=!1,border:c=!1},s)=>{const u={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:i,onClick:a,className:`\n ff-status-indicator\n ff-status-indicator--${o}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${o}-bg`:""}\n ${c?`ff-status-indicator--with-border ff-status-indicator--${o}-border`:""}\n `,ref:s,children:n("div",{className:"ff-status-indicator__content",children:[e(lF,{name:"danger"===o?"close":r,color:u[o]||u.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${o}`}),e(cF,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${o}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),Jee=({rootLabel:t,childrenLabels:r,align:a="center",direction:i="horizontal"})=>{const o=r.length;return n("div","vertical"===i?{className:"ff-os-tree-vertical",style:{"--child-count":o},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${a}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${a}`,style:{"--child-count":o},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},$ee=({handleClose:t,handleResend:r,handleOtp:a,resendTimeout:i=30})=>{const[c,u]=s(Array(6).fill("")),[d,f]=s(i),[h,p]=s(!0),m=o(Array(6).fill(null));l(()=>{h||m.current[0]?.focus()},[h]),l(()=>{let e;return d>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===d&&p(!1),()=>clearInterval(e)},[d]);const v=e=>{e.preventDefault();const t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6),n=Array(6).fill("");t.split("").forEach((e,t)=>{n[t]=e}),u(n);const r=Math.min(t.length,5);m.current[r]?.focus()};return e(hJ,{isOpen:!0,onClose:t,isFooterDisplayed:!1,isHeaderDisplayed:!1,zIndex:999999,customWidth:"340px",children:n("div",{className:"ff-otp-popup",children:[n("div",{className:"ff-otp-header",children:[e(cF,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(lF,{name:"close",height:16,width:16,onClick:t,className:"ff-close-icon"})]}),e("div",{className:"ff-otp-boxes",children:c.map((t,n)=>e("input",{type:"text",maxLength:1,className:`ff-otp-input ${t?"filled":""} ${n===c.findIndex(e=>""===e)?"active":""}`,value:t,onKeyDown:e=>((e,t)=>{const{key:n}=e;if(/^[0-9]$/.test(n)){e.preventDefault();const r=[...c];r[t]=n,u(r),t<5&&m.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...c];n[t]="",u(n),t>0&&m.current[t-1]?.focus()}})(e,n),onPaste:v,ref:e=>m.current[n]=e,readOnly:!0},n))}),e(sF,{variant:"primary",label:"Submit",onClick:()=>a(c.join("")),disabled:c.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(i),p(!0),u(Array(6).fill("")),r()},children:["Re-send OTP",d>0?` (${d}s)`:""]})]})})},ete=({isOpen:t,onClose:r,isPlaying:a,onTogglePlay:i,mediaType:c,src:u,headerTitle:d,onDownload:f,onExpand:h,showHeader:m=!0,showDownload:v=!0,showExpand:g=!0,width:y="800px",height:_="432px",showControls:b=!0,customStyle:w,overlay:E=!0,children:A,showControlDownload:x=!1,showControlExpand:C=!1})=>{const k=o(null),M=o(null),[z,S]=s(0),[O,I]=s(0),[N]=s(!1),[j,T]=s(!1),[D,L]=s(0);l(()=>{"video"===c&&k.current&&!A&&(a?k.current.play():k.current.pause())},[a,c,A]);const P=p(()=>{if(k.current&&!j){const e=k.current.currentTime/k.current.duration*100;L(e||0),S(k.current.currentTime)}},[j]),R=p(()=>{k.current&&I(k.current.duration)},[]),H=p(()=>{S(0),L(0),i?.()},[i]),B=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),q=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,L(e),S(t)}},[]),F=p(e=>{if(j||!M.current)return;const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[q,j]),U=p(e=>{if(!M.current)return;T(!0);const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[q]),V=p(e=>{if(!j||!M.current||!k.current)return;const t=M.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,a=Math.max(0,Math.min(100,n/r*100));q(a)},[j,q]),W=p(()=>{T(!1)},[]);return l(()=>{if(j)return document.addEventListener("mousemove",V),document.addEventListener("mouseup",W),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",W)}},[j,V,W]),t?e(qG,{isOpen:t,onClose:r,isMaximized:!1,showHeader:m,overlay:E,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(lF,{width:23,height:23,name:"automatic_locator"}),e(cF,{children:e("span",{className:"ff-header-title",children:d})})]}),icons:e(pF,{title:"Close",children:e(lF,{name:"close",onClick:r})}),width:y,height:_,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[A||("video"===c?e("video",{ref:k,src:u,className:"ff-media-video",onTimeUpdate:P,onLoadedMetadata:R,onEnded:H}):e("img",{src:u,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[v&&e(pF,{title:"Download",children:e(lF,{name:"download_file",color:"white",onClick:f})}),g&&e(pF,{title:N?"Minimize":"Maximize",children:e(lF,{name:N?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===c&&b&&!A&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:i,className:"ff-play-pause-btn",children:e(lF,a?{width:35,height:35,name:"pause_button",color:"white"}:{width:35,height:35,name:"play_button",color:"white"})}),n("div",{className:"ff-progress-bar",children:[e("span",{className:"ff-current-time",children:B(z)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:D,onChange:e=>q(parseFloat(e.target.value)),onClick:F,onMouseDown:U,ref:M}),e("span",{className:"ff-total-time",children:B(O)})]}),n("div",{className:"ff-control-icons",children:[x&&e(pF,{title:"Download",children:e(lF,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),C&&e(pF,{title:N?"Minimize":"Maximize",children:e(lF,{name:N?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},tte=({header:r,secondaryHeader:a,primaryCount:i,secondaryCount:o,primaryItems:l,secondaryItems:c,width:s,activeTab:u="primary",activeTabId:d,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:m,tabsData:v,notchPosition:g="top-left"})=>{const y=a&&"secondary"===u?c:l,_=o&&parseInt(o)>0,b=i&&parseInt(i)>0,w=a&&(b||_),{tooltip:E="Download",iconName:A="download_file",disabled:x=!1,onClick:C}=m?.download||{},{tooltip:k="Delete",iconName:M="delete_icon",disabled:z=!1,onClick:S}=m?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[m?.download&&e(pF,{title:E,children:e(lF,{name:A||"",className:"ff-dropdown-icon ff-download-icon",onClick:C,width:18,height:20,disabled:x,hoverEffect:!0})}),m?.delete&&e(pF,{title:k,children:e(lF,{name:M||"",className:"ff-dropdown-icon ff-delete-icon",onClick:S,width:25,height:25,disabled:z,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:s?{minWidth:s}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:a&&v&&d?n(t,{children:[e(tY,{tabsData:v,activeTabId:d,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),w&&O()]}):a&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===u?"active":""),onClick:f,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),i&&e("span",{className:"ff-dropdown-count",children:i})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===u?"active":""),onClick:h,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:a}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),O()]}):a?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===u?"active":""),onClick:f,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),i&&e("span",{className:"ff-dropdown-count",children:i})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===u?"active":""),onClick:h,children:[e(cF,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:a}),o&&e("span",{className:"ff-dropdown-count",children:o})]})]}):e(cF,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:y?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},nte=(e,t)=>"string"==typeof e?AF(e,t):a.isValidElement(e)?a.cloneElement(e,{},nte(e.props.children,t)):Array.isArray(e)?e.map(e=>nte(e,t)):e,rte=a.memo(({node:t,columnsData:r,gridTemplate:a,select:i,selected:o,onToggleExpand:l,onRowClick:c,onCheckBoxChange:s,isEven:u,isExpanding:d,hideOnDisable:f,scriptLengthTruncate:h=25,onAddConfirm:p,onAddCancel:m,handleEditFieldError:v,addModuleInputWidth:g,addModuleSelectWidth:y,disableEditLabelConfirmIcon:_,selectedNode:b,stickyOffsets:w=[],freezeColumns:E=0})=>{const A=e=>{s?.(e,t)},x=e=>{e.stopPropagation(),d||l()},C=`virtual-row ${u?"even":"odd"} ${o.includes(t.key)||b===t.key?"hover-selected":""}`;return e("div",{className:C,style:{display:"grid",gridTemplateColumns:a,height:"32px"},onClick:e=>c?.(e,t),children:r.map((r,a)=>{const l=a<E,c=l?w[a]:void 0;return e("div",{className:"virtual-cell "+(l?"sticky-col":""),style:l?{left:c,position:"sticky",zIndex:10,backgroundColor:"inherit"}:{},children:r.isTree?n("div",{className:"tree-cell-wrapper",children:[e("div",{className:"indentation-container",children:t.lines.map((t,n)=>e("span",{className:"indent-block "+(t?"vertical-line":"empty")},n))}),t.depth>0&&e("div",{className:"connector-block "+(t.isLastChild?"is-last":"is-middle"),children:e("span",{className:"connector-line"})}),e("div",{className:"expander-container",children:t.hasChildren?e("span",{onClick:x,className:"expander-btn",children:d?e(KG,{className:"spinner"}):e(Qe,{className:"expander-arrow "+(t.expanded?"expanded":"collapsed")})}):e("span",{className:"expander-spacer"})}),"checkbox"===i&&!t.isNewNode&&e("div",{className:"selection-container",children:e(bF,{checked:"completely"===t.selectedStatus,partial:"partially"===t.selectedStatus,onChange:A,disabled:t.isDisabled||f&&t.unselectable})}),"radio"===i&&!t.isNewNode&&e("div",{className:"selection-container",children:e(YW,{name:t.key,checked:o.includes(t.key),value:t.key,onChange:A,disabled:t.isDisabled})}),e("span",{className:"cell-content",children:t.isNewNode?e(QG,{onConfirm:p,onCancel:m,value:t.value,label:t.label,optionsList:t.options,selectedOption:t.selectedOption,withDropdown:"inputWithDropdown"===t.type,handleCustomError:v,inputFieldWidth:g,selectFieldWidth:y,confirmIconTooltip:t.confirmIconTooltip,cancelIconTooltip:t.cancelIconTooltip,isOnBlurTrue:!0,isDisable:{confirm:_}}):e("span",{className:"node-name "+(t.container?"folder":""),title:"string"==typeof t[r.accessor]?t[r.accessor]:"",children:nte(t[r.accessor]||t.name,h)})}),r.actions&&!t.isNewNode&&e("div",{className:"row-actions",children:r.actions(t)})]}):e("span",{className:"cell-content",children:r.cell?r.cell(t):t[r.accessor]})},`${t.key}-${a}`)})})});function ate(e,t,n){var r=function(e){return atob(e)}(e),a=r.indexOf("\n",10)+1,i=r.substring(a)+"",o=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(o)}function ite(e,t,n){var r;return function(t){return r=r||ate(e),new Worker(r,t)}}rte.displayName="VirtualRow";var ote=ite("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8vIEludGVybmFsIFN0YXRlCiAgICBsZXQgbm9kZU1hcCA9IG5ldyBNYXAoKTsKICAgIGxldCByb290SWRzID0gW107CiAgICAvLyAxLiBJbml0aWFsaXplIERhdGEgU3RydWN0dXJlIChPKE4pKQogICAgY29uc3QgaW5pdGlhbGl6ZURhdGEgPSAocmF3Tm9kZXMpID0+IHsKICAgICAgICBub2RlTWFwLmNsZWFyKCk7CiAgICAgICAgcm9vdElkcyA9IFtdOwogICAgICAgIGNvbnN0IGNoaWxkcmVuTWFwID0gbmV3IE1hcCgpOwogICAgICAgIC8vIFBhc3MgMTogQnVpbGQgTWFwICYgQWRqYWNlbmN5IExpc3QKICAgICAgICByYXdOb2Rlcy5mb3JFYWNoKG5vZGUgPT4gewogICAgICAgICAgICBjb25zdCB2Tm9kZSA9IHsKICAgICAgICAgICAgICAgIC4uLm5vZGUsCiAgICAgICAgICAgICAgICBsaW5lczogW10sCiAgICAgICAgICAgICAgICBkZXB0aDogMCwKICAgICAgICAgICAgICAgIGhhc0NoaWxkcmVuOiBmYWxzZSwKICAgICAgICAgICAgICAgIGlzTGFzdENoaWxkOiBmYWxzZSwKICAgICAgICAgICAgICAgIGV4cGFuZGVkOiBub2RlLmV4cGFuZGVkID8/IGZhbHNlLAogICAgICAgICAgICAgICAgY2hpbGRyZW5JZHM6IFtdCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIG5vZGVNYXAuc2V0KG5vZGUua2V5LCB2Tm9kZSk7CiAgICAgICAgICAgIGlmIChub2RlLnBhcmVudElkKSB7CiAgICAgICAgICAgICAgICBpZiAoIWNoaWxkcmVuTWFwLmhhcyhub2RlLnBhcmVudElkKSkKICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbk1hcC5zZXQobm9kZS5wYXJlbnRJZCwgW10pOwogICAgICAgICAgICAgICAgY2hpbGRyZW5NYXAuZ2V0KG5vZGUucGFyZW50SWQpLnB1c2gobm9kZS5rZXkpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcm9vdElkcy5wdXNoKG5vZGUua2V5KTsKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIC8vIFBhc3MgMjogTGluayBDaGlsZHJlbgogICAgICAgIG5vZGVNYXAuZm9yRWFjaChub2RlID0+IHsKICAgICAgICAgICAgY29uc3QgY2hpbGRyZW4gPSBjaGlsZHJlbk1hcC5nZXQobm9kZS5rZXkpIHx8IFtdOwogICAgICAgICAgICBub2RlLmhhc0NoaWxkcmVuID0gY2hpbGRyZW4ubGVuZ3RoID4gMDsKICAgICAgICAgICAgbm9kZS5jaGlsZHJlbklkcyA9IGNoaWxkcmVuOwogICAgICAgIH0pOwogICAgfTsKICAgIC8vIDIuIEl0ZXJhdGl2ZSBUcmVlIEZsYXR0ZW5pbmcgKFN0YWNrIERGUykKICAgIGNvbnN0IHJlYnVpbGRGbGF0TGlzdCA9ICgpID0+IHsKICAgICAgICBjb25zdCBmbGF0TGlzdCA9IFtdOwogICAgICAgIC8vIEluaXRpYWxpemUgc3RhY2sgd2l0aCByb290cyAocmV2ZXJzZWQgZm9yIGNvcnJlY3QgcG9wIG9yZGVyKQogICAgICAgIGNvbnN0IHN0YWNrID0gWy4uLnJvb3RJZHNdLnJldmVyc2UoKS5tYXAoKGlkLCBpbmRleCkgPT4gKHsKICAgICAgICAgICAgaWQsCiAgICAgICAgICAgIGRlcHRoOiAwLAogICAgICAgICAgICBsaW5lczogW10sCiAgICAgICAgICAgIGlzTGFzdENoaWxkOiBpbmRleCA9PT0gMCAvLyBJbiByZXZlcnNlLCAwIGlzIHRoZSB2aXN1YWwgbGFzdAogICAgICAgIH0pKTsKICAgICAgICAvLyBDb3JyZWN0aW9uOiBUaGUgc3RhY2sgbG9naWMgZm9yIHJvb3RzIGRlcGVuZHMgb24gYXJyYXkgb3JkZXIuCiAgICAgICAgLy8gSWYgcm9vdHMgYXJlIFtBLCBCLCBDXSwgc3RhY2sgaXMgW0MsIEIsIEFdLiBDIGlzIGxhc3QuCiAgICAgICAgLy8gU28gd2hlbiB3ZSBwdXNoIEMgKGlkeCAwKSwgaXNMYXN0Q2hpbGQgPSB0cnVlLgogICAgICAgIHdoaWxlIChzdGFjay5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIGNvbnN0IHsgaWQsIGRlcHRoLCBsaW5lcywgaXNMYXN0Q2hpbGQgfSA9IHN0YWNrLnBvcCgpOwogICAgICAgICAgICBjb25zdCBub2RlID0gbm9kZU1hcC5nZXQoaWQpOwogICAgICAgICAgICBpZiAoIW5vZGUpCiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgbm9kZS5kZXB0aCA9IGRlcHRoOwogICAgICAgICAgICBub2RlLmxpbmVzID0gbGluZXM7CiAgICAgICAgICAgIG5vZGUuaXNMYXN0Q2hpbGQgPSBpc0xhc3RDaGlsZDsKICAgICAgICAgICAgZmxhdExpc3QucHVzaChub2RlKTsKICAgICAgICAgICAgaWYgKG5vZGUuZXhwYW5kZWQgJiYgbm9kZS5jaGlsZHJlbklkcy5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgbGluZXMgZm9yIGNoaWxkcmVuLiAKICAgICAgICAgICAgICAgIC8vIElmIHBhcmVudCBpcyBOT1QgbGFzdCBjaGlsZCwgY2hpbGRyZW4gbmVlZCBhIHZlcnRpY2FsIGxpbmUuCiAgICAgICAgICAgICAgICBjb25zdCBuZXh0TGluZXMgPSBbLi4ubGluZXMsICFpc0xhc3RDaGlsZF07CiAgICAgICAgICAgICAgICAvLyBQdXNoIGNoaWxkcmVuIGluIHJldmVyc2Ugb3JkZXIKICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBub2RlLmNoaWxkcmVuSWRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hpbGRJZCA9IG5vZGUuY2hpbGRyZW5JZHNbaV07CiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkSWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2sucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogY2hpbGRJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoOiBkZXB0aCArIDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lczogbmV4dExpbmVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNMYXN0Q2hpbGQ6IGkgPT09IG5vZGUuY2hpbGRyZW5JZHMubGVuZ3RoIC0gMQogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZsYXRMaXN0OwogICAgfTsKICAgIC8vIDMuIFNlbGVjdGlvbiBDYXNjYWRlIExvZ2ljCiAgICBjb25zdCBwZXJmb3JtU2VsZWN0aW9uQ2FzY2FkZSA9IChub2RlSWQsIHN0YXR1cykgPT4gewogICAgICAgIGNvbnN0IG5vZGUgPSBub2RlTWFwLmdldChub2RlSWQpOwogICAgICAgIGlmICghbm9kZSkKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIG5vZGUuc2VsZWN0ZWRTdGF0dXMgPSBzdGF0dXM7CiAgICAgICAgLy8gQ2FzY2FkZSBEb3duCiAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2NvbXBsZXRlbHknIHx8IHN0YXR1cyA9PT0gJ25vbmUnKSB7CiAgICAgICAgICAgIGNvbnN0IGNhc2NhZGVDaGlsZHJlbiA9IChjdXJyZW50SWQpID0+IHsKICAgICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gbm9kZU1hcC5nZXQoY3VycmVudElkKTsKICAgICAgICAgICAgICAgIGlmICghY2hpbGQpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgY2hpbGQuc2VsZWN0ZWRTdGF0dXMgPSBzdGF0dXM7CiAgICAgICAgICAgICAgICBjaGlsZC5jaGlsZHJlbklkcy5mb3JFYWNoKGNhc2NhZGVDaGlsZHJlbik7CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIG5vZGUuY2hpbGRyZW5JZHMuZm9yRWFjaChjYXNjYWRlQ2hpbGRyZW4pOwogICAgICAgIH0KICAgICAgICAvLyBDYXNjYWRlIFVwCiAgICAgICAgY29uc3QgY2FzY2FkZVBhcmVudCA9IChwYXJlbnRJZCkgPT4gewogICAgICAgICAgICBpZiAoIXBhcmVudElkKQogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBjb25zdCBwYXJlbnQgPSBub2RlTWFwLmdldChwYXJlbnRJZCk7CiAgICAgICAgICAgIGlmICghcGFyZW50KQogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBsZXQgYWxsQ29tcGxldGUgPSB0cnVlOwogICAgICAgICAgICBsZXQgYWxsTm9uZSA9IHRydWU7CiAgICAgICAgICAgIHBhcmVudC5jaGlsZHJlbklkcy5mb3JFYWNoKGNpZCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBjaGlsZCA9IG5vZGVNYXAuZ2V0KGNpZCk7CiAgICAgICAgICAgICAgICBpZiAoY2hpbGQpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc2VsZWN0ZWRTdGF0dXMgIT09ICdjb21wbGV0ZWx5JykKICAgICAgICAgICAgICAgICAgICAgICAgYWxsQ29tcGxldGUgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc2VsZWN0ZWRTdGF0dXMgIT09ICdub25lJykKICAgICAgICAgICAgICAgICAgICAgICAgYWxsTm9uZSA9IGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgaWYgKGFsbENvbXBsZXRlKQogICAgICAgICAgICAgICAgcGFyZW50LnNlbGVjdGVkU3RhdHVzID0gJ2NvbXBsZXRlbHknOwogICAgICAgICAgICBlbHNlIGlmIChhbGxOb25lKQogICAgICAgICAgICAgICAgcGFyZW50LnNlbGVjdGVkU3RhdHVzID0gJ25vbmUnOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBwYXJlbnQuc2VsZWN0ZWRTdGF0dXMgPSAncGFydGlhbGx5JzsKICAgICAgICAgICAgY2FzY2FkZVBhcmVudChwYXJlbnQucGFyZW50SWQpOwogICAgICAgIH07CiAgICAgICAgY2FzY2FkZVBhcmVudChub2RlLnBhcmVudElkKTsKICAgIH07CiAgICAvLyA0LiBBZGQgTm9kZSBMb2dpYwogICAgY29uc3QgYWRkTm9kZSA9IChuZXdOb2RlRGF0YSkgPT4gewogICAgICAgIC8vIERldGVybWluZSBwYXJlbnQgSUQgYmFzZWQgb24gYWN0aW9uIChzaW1wbGlmaWVkKQogICAgICAgIC8vIEluIHJlYWwgdXNhZ2UsIHlvdSBtaWdodCBwYXJzZSAnYWRkSW5zaWRlJyB2cyAnYWRkQmVsb3cnIGxvZ2ljIGhlcmUgCiAgICAgICAgLy8gc2ltaWxhciB0byB0aGUgb3JpZ2luYWwgYWRkTmV3Um93LnRzCiAgICAgICAgY29uc3QgcGFyZW50SWQgPSBuZXdOb2RlRGF0YS5hY3Rpb24gPT09ICdhZGRJbnNpZGUnID8gbmV3Tm9kZURhdGEuc291cmNlSWQgOgogICAgICAgICAgICAobm9kZU1hcC5nZXQobmV3Tm9kZURhdGEuc291cmNlSWQpPy5wYXJlbnRJZCk7CiAgICAgICAgY29uc3QgcGFyZW50ID0gcGFyZW50SWQgPyBub2RlTWFwLmdldChwYXJlbnRJZCkgOiB1bmRlZmluZWQ7CiAgICAgICAgY29uc3QgbmV3Tm9kZSA9IHsKICAgICAgICAgICAga2V5OiBgbmV3LSR7RGF0ZS5ub3coKX1gLAogICAgICAgICAgICBuYW1lOiBuZXdOb2RlRGF0YS52YWx1ZSB8fCAnJywKICAgICAgICAgICAgaGllcmFyY2h5OiBwYXJlbnQgPyAocGFyZW50LmhpZXJhcmNoeSB8fCAwKSArIDEgOiAwLAogICAgICAgICAgICBwYXJlbnRJZDogcGFyZW50SWQsCiAgICAgICAgICAgIGxpbmVzOiBbXSwKICAgICAgICAgICAgZGVwdGg6IHBhcmVudCA/IHBhcmVudC5kZXB0aCArIDEgOiAwLAogICAgICAgICAgICBoYXNDaGlsZHJlbjogZmFsc2UsCiAgICAgICAgICAgIGlzTGFzdENoaWxkOiB0cnVlLAogICAgICAgICAgICBjaGlsZHJlbklkczogW10sCiAgICAgICAgICAgIGV4cGFuZGVkOiBmYWxzZSwKICAgICAgICAgICAgc2VsZWN0ZWRTdGF0dXM6ICdub25lJywKICAgICAgICAgICAgaXNOZXdOb2RlOiB0cnVlLAogICAgICAgICAgICAuLi5uZXdOb2RlRGF0YQogICAgICAgIH07CiAgICAgICAgbm9kZU1hcC5zZXQobmV3Tm9kZS5rZXksIG5ld05vZGUpOwogICAgICAgIGlmIChwYXJlbnQpIHsKICAgICAgICAgICAgcGFyZW50LmNoaWxkcmVuSWRzLnB1c2gobmV3Tm9kZS5rZXkpOwogICAgICAgICAgICBwYXJlbnQuaGFzQ2hpbGRyZW4gPSB0cnVlOwogICAgICAgICAgICBwYXJlbnQuZXhwYW5kZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcm9vdElkcy5wdXNoKG5ld05vZGUua2V5KTsKICAgICAgICB9CiAgICB9OwogICAgLy8gTWVzc2FnZSBIYW5kbGVyCiAgICBzZWxmLm9ubWVzc2FnZSA9IChlKSA9PiB7CiAgICAgICAgY29uc3QgeyB0eXBlLCBwYXlsb2FkIH0gPSBlLmRhdGE7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7CiAgICAgICAgICAgICAgICBjYXNlICdJTklUX0RBVEEnOgogICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVEYXRhKHBheWxvYWQudHJlZURhdGEpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnVE9HR0xFX0VYUEFORCc6CiAgICAgICAgICAgICAgICAgICAgY29uc3QgbiA9IG5vZGVNYXAuZ2V0KHBheWxvYWQuaWQpOwogICAgICAgICAgICAgICAgICAgIGlmIChuKQogICAgICAgICAgICAgICAgICAgICAgICBuLmV4cGFuZGVkID0gIW4uZXhwYW5kZWQ7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdVUERBVEVfU0VMRUNUSU9OJzoKICAgICAgICAgICAgICAgICAgICBwZXJmb3JtU2VsZWN0aW9uQ2FzY2FkZShwYXlsb2FkLmlkLCBwYXlsb2FkLnN0YXR1cyk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdBRERfTk9ERSc6CiAgICAgICAgICAgICAgICAgICAgYWRkTm9kZShwYXlsb2FkLm5ld05vZGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIEFsd2F5cyByZXR1cm4gdXBkYXRlZCB2aWV3CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAgdHlwZTogJ1VQREFURV9WSUVXJywKICAgICAgICAgICAgICAgIHBheWxvYWQ6IHsgZmxhdFZpZXc6IHJlYnVpbGRGbGF0TGlzdCgpLCB0b3RhbENvdW50OiBub2RlTWFwLnNpemUgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0eXBlOiAnRVJST1InLCBwYXlsb2FkOiBTdHJpbmcoZXJyb3IpIH0pOwogICAgICAgIH0KICAgIH07Cgp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD10cmVlLndvcmtlci5qcy5tYXAKCg==");const lte=i(({treeData:r,columnsData:a,selected:i=[],select:c,onChange:u,onClick:d,onExpand:f,loadMore:m=()=>{},tableBorder:v,height:g="calc(100vh - 134px)",newNode:_,onAddConfirm:b=()=>{},onAddCancel:w=()=>{},handleEditFieldError:E,loading:A=!1,rootNode:x,pagination:C=!0,selectedNode:k,tableHeaderBgColor:M="var(--border-color)",hideOnDisable:z=!1,freezeColumns:S=0,scriptLengthTruncate:O=25,addModuleInputWidth:I=150,addModuleSelectWidth:N,onScroll:j,onScrollEnd:T,disableEditLabelConfirmIcon:D=!1,transparentHeader:L=!1,navigateTreeNode:P=null,handleRemoveNavigateTreeNode:R=()=>{},scrollThreshold:H=128,showHeader:B=!0},q)=>{const[F,U]=s([]),[V,W]=s(0),[Q,G]=s(600),Y=o(null),K=o(),Z=o(null);y(q,()=>Y.current),l(()=>(K.current=new ote,K.current.onmessage=e=>{"UPDATE_VIEW"===e.data.type&&U(e.data.payload.flatView)},()=>K.current?.terminate()),[]),l(()=>{K.current&&(K.current.postMessage({type:"INIT_DATA",payload:{treeData:r}}),_&&_.action&&K.current.postMessage({type:"ADD_NODE",payload:{newNode:_,rootNode:x}}))},[r,_,x]),l(()=>{const e=Y.current;if(!e)return;"string"==typeof g&&g.includes("px")&&!g.includes("calc")&&G(parseInt(g,10));const t=new ResizeObserver(e=>{for(const t of e)t.contentRect.height>0&&G(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[g]);const{visibleRange:X,totalContentHeight:J,offsetY:$,startIndex:ee}=(({totalItems:e,containerHeight:t,rowHeight:n,scrollTop:r,buffer:a=5})=>h(()=>{if(0===e||0===t)return{visibleRange:[0,0],totalContentHeight:0,offsetY:0,startIndex:0};const i=e*n,o=Math.floor(r/n),l=Math.ceil(t/n),c=Math.max(0,o-a);return{visibleRange:[c,Math.min(e,o+l+a)],totalContentHeight:i,offsetY:c*n,startIndex:o}},[e,t,n,r,a]))({totalItems:F.length,containerHeight:Q,rowHeight:32,scrollTop:V}),te=h(()=>F.slice(X[0],X[1]),[F,X]),ne=h(()=>{if(!S||S<=0)return[];const e=[];let t=0;for(let n=0;n<S;n++){e.push(t);const r=a[n]?.width||"100px";t+=parseInt(r.replace("px",""),10)||100}return e},[a,S]),re=p(e=>{const t=e.currentTarget;if(requestAnimationFrame(()=>W(t.scrollTop)),j?.(),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>T?.(),150),A||!C)return;const n=t.scrollHeight-(t.scrollTop+t.clientHeight)<H,r=t.scrollTop<H;n?HW(()=>m("below"),200)():r&&t.scrollTop>0&&HW(()=>m("above"),200)()},[A,C,H,m,j,T]),ae=p(e=>{K.current?.postMessage({type:"TOGGLE_EXPAND",payload:{id:e.key}}),f?.(e)},[f]);l(()=>{if(P&&F.length>0&&Y.current){const e=F.findIndex(e=>e.key===P);if(-1!==e){const t=Math.max(0,32*e-Q/2+16);Y.current.scrollTo({top:t,behavior:"smooth"}),R()}}},[P,F,Q,R]);const ie=h(()=>a.map(e=>e.width).join(" "),[a]);return n("div",{className:"tree-table-wrapper-container",children:[B&&n(t,{children:[x&&e("div",{className:"virtual-header-root",children:e("div",{className:"virtual-header-root-row",style:{display:"grid",gridTemplateColumns:ie,backgroundColor:L?"transparent":M},children:a.map((t,r)=>{const a=r<(S||0),o=a?ne[r]:void 0;return n("div",{className:"header-root-cell "+(a?"sticky-col":""),style:a?{left:o,position:"sticky",zIndex:11,backgroundColor:M}:{},children:[0===r&&n("div",{className:"root-selection-wrapper",children:["checkbox"===x.select&&e(bF,{checked:"completely"===x.node?.selectedStatus,partial:"partially"===x.node?.selectedStatus,onChange:e=>u?.(e,x.node),disabled:x.node.isDisabled||z&&x.node.isDisabled}),"radio"===x.select&&e(YW,{name:x.node.key,checked:i.includes(x.node.key),value:x.node.key,onChange:e=>u?.(e,x.node),disabled:x.node.isDisabled})]}),e("span",{className:"cell-content",children:x.node[t.accessor]}),x.cell&&0===r&&e("div",{className:"root-cell-actions",children:x.cell(x.node)})]},r)})})}),e("div",{className:"virtual-header",style:{display:"grid",gridTemplateColumns:ie,backgroundColor:L?"transparent":M},children:a.map((t,n)=>{const r=n<(S||0),a=r?ne[n]:void 0;return e("div",{className:"header-cell "+(r?"sticky-col":""),style:r?{left:a,position:"sticky",zIndex:11,backgroundColor:M}:{},children:t.name},t.accessor)})})]}),n("div",{className:"virtual-scroll-container",ref:Y,style:{height:g,border:v},onScroll:re,children:[e("div",{style:{height:J,width:"1px"}}),e("div",{className:"virtual-render-layer",style:{transform:`translate3d(0, ${$}px, 0)`},children:te.map((t,n)=>e(rte,{node:t,columnsData:a,gridTemplate:ie,select:c,selected:i,isEven:(ee+n)%2==0,onToggleExpand:()=>ae(t),onRowClick:d,onCheckBoxChange:u,onAddConfirm:b,onAddCancel:w,handleEditFieldError:E,addModuleInputWidth:I,addModuleSelectWidth:N,disableEditLabelConfirmIcon:D,hideOnDisable:z,scriptLengthTruncate:O,selectedNode:k,stickyOffsets:ne,freezeColumns:S},t.key))}),A&&e("div",{className:"virtual-loading-overlay",children:n("div",{className:"loading-spinner",children:[e(KG,{}),e("span",{children:"Loading..."})]})})]})]})});function cte(e,t,n,r,a,i="children"){return function e(o){for(let l=0;l<o.length;l++){const c=o[l];if(c&&c[t]===n){const e=[...o];return"replace"===a?e[l]=r:e.splice("above"===a?l:l+1,0,r),{updatedArray:e}}if(c&&c[i]&&Array.isArray(c[i])){const t=e(c[i]);if(t)return{updatedArray:o.map((e,n)=>n===l?{...e,[i]:t.updatedArray}:e)}}}return null}(e)}lte.displayName="TableTreeFnVirtual";const ste=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const a=n?e:Object.keys(e),i=r?t:Object.keys(t);if(a.length!==i.length)return!1;if(n)return a.every((e,t)=>ste(e,i[t]));{const n=new Set(i);return a.every(r=>n.has(r)&&ste(e[r],t[r]))}},ute=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return ste(e,r)}));async function dte(e,t){const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),a=(new TextEncoder).encode(e),i=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,a);return btoa(String.fromCharCode(...new Uint8Array(i)))}const fte=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},hte=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},pte=({data:r,isYaxisSticky:a=!1,barWidth:i,height:c,barGap:u=20,colors:d=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:m=20,yAxisDivisions:v=5,barBorderRadius:g=0,legend:y=!0,showXAxisLabels:_=!0,icons:b=[],iconSize:w,legendPosition:E="bottom",legendGap:A=5,extendBarChartRightWidth:x=0,isYAxisValuePercentage:C=!1,selectedBar:k,setSelectedBar:M,onSelectedBar:z=e=>{},totalLabel:S="Total Execution",customToolTip:O=!1,isOnclick:I=!1,isDashboardVersions:N,type:j="",isMemory:T,tooltipWidth:D="fit-content"})=>{const L=o(null),[P,R]=s(null),[H,B]=s(!1);l(()=>{const e=()=>{const e=L.current;e&&H&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[H]);const q=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),F=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===j)t=hte(e.value);else if(T)switch(q){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=hte(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let U=0;"memory"===j&&(U=r.reduce((e,t)=>"string"==typeof t.value?e+fte(t.value):e+1024*Number(t.value)*1024*1024,0));const V=U/1048576,W=V<1024?`${Math.round(V)} mb`:`${(V/1024).toFixed(1)} gb`;let Q=Math.max(...F.map(e=>e.normalizedValue));Q="memory"===j?Math.max(Q,1):Math.max(Q,v);const G=40,Y=40,K=F.length*i+(F.length-1)*u+(a?Y:90)+x,Z=Date.now(),X=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${Z}-${j}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,a)=>e("stop",{offset:a/(t.length-1)*100+"%",stopColor:r},`${n}-${a}`))})},n)),J=e=>{if(!d.length)return"grey";const t=d[e%d.length];return 1===t?.length?t[0]:`url(#gradient-${Z}-${j}-${e%d.length})`},$=(e,t,n,r,a)=>{B(!0);const i=L.current;if(i)if(i.style.display="block",O)i.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${S} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(N){const e=a?a.join(", "):"";i.innerHTML=`\n <div>\n <div><Typography>${S} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else i.innerHTML="memory"===j?`<strong>${e}</strong>: ${t} / ${W}`:`<strong>${e}</strong>: ${t} ${C?"%":""}`},ee=(e,t=!1)=>{const n=L.current;if(n){const r=n.parentElement?.getBoundingClientRect(),a=window.scrollX,i=window.scrollY,o=1===F?.length||!t?e.clientX-(r?.left||0)+a+10:e.clientX-(r?.left||0)+a-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+i-20;n.style.left=`${o}px`,n.style.top=`${l}px`}},te=()=>{B(!1);const e=L.current;e&&(e.style.display="none")},ne=e=>{M&&(M(e),I&&z(e))},re=e=>{if(h){if(AF(e,10).endsWith("...")){const t=L.current;t&&(t.style.display="block",t.innerHTML=e)}}},ae=(e,t,n)=>{if(h){AF(t,10).endsWith("...")&&ee(e,n===F.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:L,className:"ff-bar-chart-tooltip",style:{width:D}}),y&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${A}px`},children:F.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>R(r),onMouseLeave:()=>R(null),children:[b[r]&&"string"==typeof b[r]?e(lF,{name:String(b[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:d[r%d.length]?.[0]||"grey"}}),e(cF,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),a?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:c+G+(f?20:0),children:n(t,{children:[Array.from({length:v+1}).map((t,n)=>{const r=c-n/v*c+G+4,a=n*Q/v,i="memory"===j?a.toFixed(1):C?`${a.toFixed(0).padStart(2,"0")}%`:a.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:i},n)}),p&&e("text",{x:-(c/2+35),y:a?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:K,height:c+G+5+(_?20:0)+(f?20:0),children:[Array.isArray(d)&&d.length>0&&X(d),F.map((t,r)=>{const a=t.normalizedValue/Q*c,o=t.normalizedValue<1?2:a,l=r*(i+u)+m,s=c-o+G,d=w||20,f=l+i/2-d/2,p=s-d,v=k===t.label,y=P===r;return n("g",{children:[b[r]&&"string"==typeof b[r]&&e("g",{onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,children:e(lF,{name:String(b[r]),x:String(f),y:String(p),width:d,height:d,chartIcon:!0})}),e("rect",{x:l,y:s,width:i,height:o,fill:J(r),rx:g,ry:g,style:{strokeWidth:v?3:0,opacity:null===P||y?1:.3,cursor:I?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>$(t.label,"memory"===j||T?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,onClick:()=>ne(t.label)}),v&&I&&e("rect",{x:l,y:s,width:i,height:o,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te}),_&&e("text",{onMouseEnter:()=>re(t.label),onMouseMove:e=>ae(e,t.label,r),onMouseLeave:te,x:0===r?l:r===F.length-1?l+i:l+i/2,y:c+G+15,className:"ff-bar-chart-labels",fill:v?"var(--brand-color)":"black",fontWeight:v?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?AF(t.label,10):t.label})]},r)}),e("line",{x1:a?0:m,y1:c+G,x2:K,y2:c+G,stroke:"#D9D9D9",strokeWidth:"1"}),!a&&f&&e("text",{x:K/2,y:c+G+(_?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:K,height:c+G+5+(_?20:0)+(f?20:0),children:[Array.isArray(d)&&d.length>0&&X(d),Array.from({length:v+1}).map((t,n)=>{const r=c-n/v*c+G+4,a=n*Q/v,i="memory"===j?a.toFixed(1):C?`${a.toFixed(0).padStart(2,"0")}%`:a.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:i},n)}),F.map((t,r)=>{const a=t.normalizedValue/Q*c,o=t.normalizedValue<1?2:a,l=r*(i+u)+Y+m,s=c-o+G,d=w||20,f=l+i/2-d/2,p=s-d,v=k===t.label,y=P===r;return n("g",{children:[b[r]&&"string"==typeof b[r]&&e("g",{onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,children:e(lF,{name:String(b[r]),x:String(f),y:String(p),width:d,height:d,chartIcon:!0})}),e("rect",{x:l,y:s,width:i,height:o,fill:J(r),rx:g,ry:g,style:{strokeWidth:v?3:0,opacity:null===P||y?1:.3,cursor:I?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>$(t.label,"memory"===j||T?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te,onClick:()=>ne(t.label)}),v&&I&&e("rect",{x:l,y:s,width:i,height:o,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>$(t.label,"memory"===j?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ee(e,r===F.length-1),onMouseLeave:te}),_&&e("g",{children:e("text",{x:0===r?l:r===F.length-1?l+i:l+i/2,y:c+G+15,className:"ff-bar-chart-labels",fill:v?"var(--brand-color)":"black",fontWeight:v?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>re(t.label),onMouseMove:e=>ae(e,t.label,r),onMouseLeave:te,children:h?AF(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:c+G,x2:K,y2:c+G,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:K/2,y:c+G+(_?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(c/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),y&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${A}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>R(r),onMouseLeave:()=>R(null),children:[b[r]&&"string"==typeof b[r]?e(lF,{name:String(b[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:d[r%d.length]?.[0]||"grey"}}),e("div",{children:e(cF,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},mte=(e,t,n,r,a)=>{const i=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(a),c=t+n*Math.sin(a);return`M ${i} ${o} A ${n} ${n} 0 ${a-r>Math.PI?1:0} 1 ${l} ${c}`},vte=({radius:r,lineWidth:a,lineCap:i,barValues:o,labelHeading:l,legendType:c="numberLegend",isLegendDetails:u=!0,isPillValueVisible:d=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:m=8,gapBetweenArch:v=10,capsuleStyle:g={padding:"4px"}})=>{const[y,_]=s({visible:!1,x:0,y:0,content:"",isArc:!1}),[b,w]=s(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,A=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,x=o.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),C=x.reduce((e,t)=>e+t.normalizedValue,0),k=r,M=a+v,z=2*(k+M*(x.length-1)+a),S=[...x].reverse(),O=l.trim().split(" "),I=(e,t,n)=>{const{clientX:r,clientY:a}=e;_({visible:!0,x:r,y:a,content:t,isArc:n})},N=e=>{const{clientX:t,clientY:n}=e;_(e=>({...e,x:t,y:n}))},j=()=>{_({visible:!1,x:0,y:0,content:"",isArc:!1})};return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===c?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:z,height:z},children:n("svg",{width:z,height:z,viewBox:`0 0 ${z} ${z}`,className:"absolute top-0 left-0",children:[e("defs",{children:o.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${z/2+1}, ${z/2+1})`,children:[S.map((t,r)=>{const o=x.length-1-r,l=2*(t.normalizedValue/C)*Math.PI;let c=-Math.PI/2,s=c+l;t.normalizedValue===C&&(c=0,s=2*Math.PI);const u=k+M*o,d=mte(0,0,u,0,2*Math.PI),f={opacity:null!==b?t.barLabel===b?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=u*Math.cos(-Math.PI/2),i=u*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:d,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:a,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:i,r:a+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),onMouseEnter:e=>I(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:N,onMouseLeave:j,style:f})]},o)}const h=mte(0,0,u,c,s);return n("g",{children:[e("path",{d:d,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:a,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),strokeWidth:a,strokeLinecap:"square"===i?"butt":"round",onMouseEnter:e=>I(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:N,onMouseLeave:j,style:{pointerEvents:"stroke",...f}})]},o)}),e("text",{x:"0",y:`-${a+v+2}`,fill:(()=>{if(!y.visible)return"";const e=y.content.split(":")[0]?.trim();if(void 0===e)return"";const t=x.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return A(n)})(),textAnchor:"middle",dominantBaseline:"central",children:y.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(T=y.content.split(":")[1]?.trim()||"",D=9,T.length>D?T.slice(0,D)+"...":T)}),y.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${a+v+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:O.map((t,r)=>{if(0===r){const[a,...i]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:a}),e("tspan",{x:"0",dy:18,style:{fontSize:`${m}px`},className:"ff-center-text",children:i.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${m}px`},children:t},r)})})})]})]})}),y.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${y.y+10}px`,left:`${y.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:y.content}),u&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),I(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:N,onMouseLeave:()=>{w(null),j()},children:[e(cF,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:A(t),children:t.key.padStart(2,"0")}),e(cF,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),I(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:N,onMouseLeave:()=>{w(null),j()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:A(t)},children:e(cF,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:d&&t.value})}),e(cF,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(x.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),c)]});var T,D};function gte(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yte(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bte(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_te(Object(n),!0).forEach(function(t){yte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ete(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ate(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ete(Object(n),!0).forEach(function(t){wte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ete(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xte(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(a,r))}}}function Cte(e){return{}.toString.call(e).includes("Object")}function kte(e){return"function"==typeof e}var Mte=xte(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),zte={changes:function(e,t){return Cte(t)||Mte("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&Mte("changeField"),t},selector:function(e){kte(e)||Mte("selectorType")},handler:function(e){kte(e)||Cte(e)||Mte("handlerType"),Cte(e)&&Object.values(e).some(function(e){return!kte(e)})&&Mte("handlersType")},initial:function(e){var t;e||Mte("initialIsRequired"),Cte(e)||Mte("initialType"),t=e,Object.keys(t).length||Mte("initialContent")}};function Ste(e,t){return kte(t)?t(e.current):t}function Ote(e,t){return e.current=Ate(Ate({},e.current),t),t}function Ite(e,t,n){return kte(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var Nte={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zte.initial(e),zte.handler(t);var n={current:e},r=xte(Ite)(n,t),a=xte(Ote)(n),i=xte(zte.changes)(e),o=xte(Ste)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return zte.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,a,i,o)(e)}]}};var jte={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},Tte=function(e){return function t(){for(var n=this,r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(a,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(jte),Dte={config:function(e){var t;return e||Tte("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||Tte("configType"),e.urls?(console.warn(jte.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function Lte(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Lte(e[n],t[n]))}),bte(bte({},e),t)}var Pte={type:"cancelation",msg:"operation is manually canceled"};function Rte(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(Pte):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var Hte,Bte,qte=["monaco"],Fte=Nte.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),Ute=(Bte=2,function(e){if(Array.isArray(e))return e}(Hte=Fte)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return l}}(Hte,Bte)||function(e,t){if(e){if("string"==typeof e)return gte(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gte(e,t):void 0}}(Hte,Bte)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),Vte=Ute[0],Wte=Ute[1];function Qte(e){return document.body.appendChild(e)}function Gte(e){var t=Vte(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Yte(){var e=Vte(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;Kte(n),e.resolve(n)},function(t){e.reject(t)})}function Kte(e){Vte().monaco||Wte({monaco:e})}var Zte=new Promise(function(e,t){return Wte({resolve:e,reject:t})}),Xte={config:function(e){var t=Dte.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,qte);Wte(function(e){return{config:Lte(e.config,r),monaco:n}})},init:function(){var e=Vte(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(Wte({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Rte(Zte);if(window.monaco&&window.monaco.editor)return Kte(window.monaco),e.resolve(window.monaco),Rte(Zte);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(Qte,Gte)(Yte)}return Rte(Zte)},__getMonacoInstance:function(){return Vte(function(e){return e.monaco})}},Jte={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$te={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var ene=function({children:e}){return a.createElement("div",{style:$te.container},e)},tne=ene;var nne=function({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:l}){return a.createElement("section",{style:{...Jte.wrapper,width:e,height:t},...l},!n&&a.createElement(tne,null,r),a.createElement("div",{ref:i,style:{...Jte.fullWidth,...!n&&Jte.hide},className:o}))},rne=g(nne);var ane=function(e){l(e,[])};var ine=function(e,t,n=!0){let r=o(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function one(){}function lne(e,t,n,r){return function(e,t){return e.editor.getModel(cne(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?cne(e,r):void 0)}(e,t,n,r)}function cne(e,t){return e.Uri.parse(t)}var sne=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:c,modifiedModelPath:u,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:m="Loading...",options:v={},height:g="100%",width:y="100%",className:_,wrapperProps:b={},beforeMount:w=one,onMount:E=one}){let[A,x]=s(!1),[C,k]=s(!0),M=o(null),z=o(null),S=o(null),O=o(E),I=o(w),N=o(!1);ane(()=>{let e=Xte.init();return e.then(e=>(z.current=e)&&k(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>M.current?function(){let e=M.current?.getModel();d||e?.original?.dispose(),f||e?.modified?.dispose(),M.current?.dispose()}():e.cancel()}),ine(()=>{if(M.current&&z.current){let t=M.current.getOriginalEditor(),a=lne(z.current,e||"",r||n||"text",c||"");a!==t.getModel()&&t.setModel(a)}},[c],A),ine(()=>{if(M.current&&z.current){let e=M.current.getModifiedEditor(),r=lne(z.current,t||"",i||n||"text",u||"");r!==e.getModel()&&e.setModel(r)}},[u],A),ine(()=>{let e=M.current.getModifiedEditor();e.getOption(z.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],A),ine(()=>{M.current?.getModel()?.original.setValue(e||"")},[e],A),ine(()=>{let{original:e,modified:t}=M.current.getModel();z.current.editor.setModelLanguage(e,r||n||"text"),z.current.editor.setModelLanguage(t,i||n||"text")},[n,r,i],A),ine(()=>{z.current?.editor.setTheme(h)},[h],A),ine(()=>{M.current?.updateOptions(v)},[v],A);let j=p(()=>{if(!z.current)return;I.current(z.current);let a=lne(z.current,e||"",r||n||"text",c||""),o=lne(z.current,t||"",i||n||"text",u||"");M.current?.setModel({original:a,modified:o})},[n,t,i,e,r,c,u]),T=p(()=>{!N.current&&S.current&&(M.current=z.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...v}),j(),z.current?.editor.setTheme(h),x(!0),N.current=!0)},[v,h,j]);return l(()=>{A&&O.current(M.current,z.current)},[A]),l(()=>{!C&&!A&&T()},[C,A,T]),a.createElement(rne,{width:y,height:g,isEditorReady:A,loading:m,_ref:S,className:_,wrapperProps:b})};g(sne);var une=function(e){let t=o();return l(()=>{t.current=e},[e]),t.current},dne=new Map;var fne,hne=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:c,theme:u="light",line:d,loading:f="Loading...",options:h={},overrideServices:m={},saveViewState:v=!0,keepCurrentModel:g=!1,width:y="100%",height:_="100%",className:b,wrapperProps:w={},beforeMount:E=one,onMount:A=one,onChange:x,onValidate:C=one}){let[k,M]=s(!1),[z,S]=s(!0),O=o(null),I=o(null),N=o(null),j=o(A),T=o(E),D=o(),L=o(r),P=une(c),R=o(!1),H=o(!1);ane(()=>{let e=Xte.init();return e.then(e=>(O.current=e)&&S(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>I.current?(D.current?.dispose(),g?v&&dne.set(c,I.current.saveViewState()):I.current.getModel()?.dispose(),void I.current.dispose()):e.cancel()}),ine(()=>{let a=lne(O.current,e||r||"",t||i||"",c||n||"");a!==I.current?.getModel()&&(v&&dne.set(P,I.current?.saveViewState()),I.current?.setModel(a),v&&I.current?.restoreViewState(dne.get(c)))},[c],k),ine(()=>{I.current?.updateOptions(h)},[h],k),ine(()=>{!I.current||void 0===r||(I.current.getOption(O.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(H.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),H.current=!1))},[r],k),ine(()=>{let e=I.current?.getModel();e&&i&&O.current?.editor.setModelLanguage(e,i)},[i],k),ine(()=>{void 0!==d&&I.current?.revealLine(d)},[d],k),ine(()=>{O.current?.editor.setTheme(u)},[u],k);let B=p(()=>{if(N.current&&O.current&&!R.current){T.current(O.current);let a=c||n,o=lne(O.current,r||e||"",t||i||"",a||"");I.current=O.current?.editor.create(N.current,{model:o,automaticLayout:!0,...h},m),v&&I.current.restoreViewState(dne.get(a)),O.current.editor.setTheme(u),void 0!==d&&I.current.revealLine(d),M(!0),R.current=!0}},[e,t,n,r,i,c,h,m,v,u,d]);return l(()=>{k&&j.current(I.current,O.current)},[k]),l(()=>{!z&&!k&&B()},[z,k,B]),L.current=r,l(()=>{k&&x&&(D.current?.dispose(),D.current=I.current?.onDidChangeModelContent(e=>{H.current||x(I.current.getValue(),e)}))},[k,x]),l(()=>{if(k){let e=O.current.editor.onDidChangeMarkers(e=>{let t=I.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=O.current.editor.getModelMarkers({resource:t});C?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,C]),a.createElement(rne,{width:y,height:_,isEditorReady:k,loading:f,_ref:N,className:b,wrapperProps:w})},pne=g(hne),mne={exports:{}},vne={},gne={exports:{}},yne={},_ne={};function bne(){if(fne)return _ne;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return fne=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(0!==a.item(0).indexOf(t)&&a.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},_ne.Output=n,_ne}var wne,Ene={};function Ane(){if(wne)return Ene;return wne=1,Ene.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},Ene}var xne,Cne={};function kne(){return xne||(xne=1,i="(?:"+(a="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",o="(?:"+a+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(e=Cne).identifier=new RegExp(i+o,"g"),e.identifierStart=new RegExp(i),e.identifierMatch=new RegExp("(?:"+a+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")),Cne;var e,t,n,r,a,i,o}var Mne,zne,Sne={},One={};function Ine(){if(Mne)return One;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,a={};for(r in e=n(e))r!==t&&(a[r]=e[r]);if(t&&e[t])for(r in e[t])a[r]=e[t][r];return a}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return Mne=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},One.Options=e,One.normalizeOpts=n,One.mergeOpts=t,One}function Nne(){if(zne)return Sne;zne=1;var e=Ine().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i<a.length;i++)"preserve-inline"===a[i]?this.brace_preserve_inline=!0:this.brace_style=a[i];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,Sne.Options=n,Sne}var jne,Tne={},Dne={};function Lne(){if(jne)return Dne;jne=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,a="";return e&&(r=this.match(e))&&(a+=r[0]),!t||!r&&e||(a+=this.readUntil(t,n)),a},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var a=e.exec(this.__input);return a?(r=a.index,t&&(r+=a[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,a="g";return n&&e&&(a="y"),"string"==typeof t&&""!==t?r=new RegExp(t,a):t&&(r=new RegExp(t.source,a)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},Dne.InputScanner=t,Dne}var Pne,Rne={},Hne={};var Bne,qne,Fne,Une={},Vne={};function Wne(){if(Bne)return Vne;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return Bne=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},Vne.Pattern=e,Vne}function Qne(){if(Fne)return Rne;Fne=1;var e=Lne().InputScanner,t=Ane().Token,n=function(){if(Pne)return Hne;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return Pne=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},Hne.TokenStream=e,Hne}().TokenStream,r=function(){if(qne)return Une;qne=1;var e=Wne().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],a=e.exec(t);a;)r.push(t.substring(n,a.index)),n=a.index+a[0].length,a=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},Une.WhitespacePattern=t,Une}().WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return i.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(a.START,""),i=null,o=[],l=new n;r.type!==a.EOF;){for(e=this._get_next_token(r,i);this._is_comment(e);)l.add(e),e=this._get_next_token(r,i);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=i,this._is_opening(e)?(o.push(i),i=e):i&&this._is_closing(e,i)&&(e.opened=i,i.closed=e,i=o.pop(),e.parent=i),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},i.prototype._is_comment=function(e){return!1},i.prototype._is_opening=function(e){return!1},i.prototype._is_closing=function(e,t){return!1},i.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Rne.Tokenizer=i,Rne.TOKEN=a,Rne}var Gne,Yne={};function Kne(){if(Gne)return Yne;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return Gne=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},Yne.Directives=e,Yne}var Zne,Xne,Jne,$ne,ere={};function tre(){if(Zne)return ere;Zne=1;var e=Wne().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var a=new e(n);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},ere.TemplatablePattern=n,ere}function nre(){if(Xne)return Tne;Xne=1;var e=Lne().InputScanner,t=Qne().Tokenizer,n=Qne().TOKEN,r=Kne().Directives,a=kne(),i=Wne().Pattern,o=tre().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},s=new r(/\/\*/,/\*\//),u=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,d=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var m,v=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),y=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+y.join("|")+")$"),b=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new i(this._input),l=new o(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(a.identifier).matching(a.identifierMatch),number:r.matching(u),punct:r.matching(v),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(a.lineBreak),shebang:r.starting_with(/#!/).until_after(a.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(b.prototype=new t)._is_comment=function(e){return e.type===c.COMMENT||e.type===c.BLOCK_COMMENT||e.type===c.UNKNOWN},b.prototype._is_opening=function(e){return e.type===c.START_BLOCK||e.type===c.START_EXPR},b.prototype._is_closing=function(e,t){return(e.type===c.END_BLOCK||e.type===c.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},b.prototype._reset=function(){m=!1},b.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(c.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(c.UNKNOWN,this._input.next())},b.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(a.allLineBreaks,"\n"),e.type!==c.DOT&&(e.type!==c.RESERVED||"set"!==e.text&&"get"!==e.text)&&_.test(t)?"in"!==t&&"of"!==t||e.type!==c.WORD&&e.type!==c.STRING?this._create_token(c.RESERVED,t):this._create_token(c.OPERATOR,t):this._create_token(c.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(c.WORD,t):void 0},b.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(c.START_EXPR,e):")"===e||"]"===e?t=this._create_token(c.END_EXPR,e):"{"===e?t=this._create_token(c.START_BLOCK,e):"}"===e?t=this._create_token(c.END_BLOCK,e):";"===e?t=this._create_token(c.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(c.DOT,e):","===e&&(t=this._create_token(c.COMMA,e)),t&&this._input.next(),t},b.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(c.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},b.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(c.EQUALS,e):"?."===e?this._create_token(c.DOT,e):this._create_token(c.OPERATOR,e)},b.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(c.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(c.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(d)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)t+=this._input.next();return m=!0,this._create_token(c.COMMENT,t)}}else if(m&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return m=!1,this._create_token(c.COMMENT,t);return null},b.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=s.get_directives(n);r&&"start"===r.ignore&&(n+=s.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),(t=this._create_token(c.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(c.COMMENT,n))}return t},b.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,a=new e(t),i=null;for(;a.hasNext();)if((i=a.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=i[0]),"\\"===a.peek()){if(a.next(),"x"===a.peek())i=a.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==a.peek()){n+="\\",a.hasNext()&&(n+=a.next());continue}(i=a.match(/u([0-9A-Fa-f]{4})/g))||(i=a.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!i)return t;if((r=parseInt(i[1],16))>126&&r<=255&&0===i[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+i[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}return null},b.prototype._allow_regexp_or_xml=function(e){return e.type===c.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===c.END_EXPR&&")"===e.text&&e.opened.previous.type===c.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},b.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==e)&&!this._input.testChar(a.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?i=!0:"]"===this._input.peek()&&(i=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(c.STRING,n)}return null},b.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===i.indexOf("{"),l=0;r;){var s=!!r[1],u=r[2];if(!(!!r[r.length-1]||"![CDATA["===u.slice(0,8))&&(u===i||o&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(s?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},b.prototype._read_string_recursive=function(e,t,n){var r,i;"'"===e?i=this.__patterns.single_quote:'"'===e?i=this.__patterns.double_quote:"`"===e?i=this.__patterns.template_text:"}"===e&&(i=this.__patterns.template_expression);for(var o=i.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&a.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=i.read()}return o},Tne.Tokenizer=b,Tne.TOKEN=c,Tne.positionable_operators=h.slice(),Tne.line_starters=g.slice(),Tne}function rre(){if(Jne)return yne;Jne=1;var e=bne().Output,t=Ane().Token,n=kne(),r=Nne().Options,a=nre().Tokenizer,i=nre().line_starters,o=nre().positionable_operators,l=nre().TOKEN;function c(e,t){return-1!==t.indexOf(e)}function s(e){return e.replace(/^\s+/g,"")}function u(e,t){return e&&e.type===l.RESERVED&&e.text===t}function d(e,t){return e&&e.type===l.RESERVED&&c(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),p=[h.before_newline,h.preserve_newline],m="BlockStatement",v="Statement",g="ObjectLiteral",y="ArrayLiteral",_="ForInitializer",b="Conditional",w="Expression";function E(e,t){t.multiline_frame||t.mode===_||t.mode===b||e.remove_indent(t.start_line_index)}function A(e){return e===y}function x(e){return c(e,[w,_,b])}function C(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}C.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},C.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var r=new a(t,this._options);return this._tokens=r.tokenize(),t},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},C.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},C.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&A(this._flags.mode);if(e.comments_before)for(var a=e.comments_before.next();a;)this.handle_whitespace_and_comments(a,t),this.handle_token(a,t),a=e.comments_before.next();if(r)for(var i=0;i<n;i+=1)this.print_newline(i>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var o=1;o<n;o+=1)this.print_newline(!0,t)}};var k=["async","break","continue","return","throw","yield"];return C.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(c(this._flags.last_token.text,o)||c(e.text,o)){var r=c(this._flags.last_token.text,o)&&c(this._options.operator_position,p)||c(e.text,o);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,k))return;this._output.set_wrap_point()}}},C.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&u(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},C.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},C.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},C.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},C.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===v&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},C.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===v&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},C.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||d(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||u(this._flags.last_token,"do"))||!(this._flags.parent.mode===g&&this._flags.mode===v)&&d(this._flags.last_token,k)&&!e.newlines)||u(this._flags.last_token,"else")&&!(u(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===_||this._previous_flags.mode===b))||this._flags.last_token.type===l.WORD&&this._flags.mode===m&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(v),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,d(e,["do","for","if","while"])),!0)},C.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=w;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=y,A(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),c(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=_):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=b):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,i)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},C.prototype.handle_end_expr=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===b&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},C.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(m),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m):n&&(c(n.text,[":",","])&&c(t.type,[l.STRING,l.WORD,l.RESERVED])||c(t.text,["get","set","..."])&&c(n.type,[l.WORD,l.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(m):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(m):c(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g):this.set_mode(m),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,a=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var i=0,o=null;this._flags.inline_frame=!0;do{if(i+=1,(o=this._tokens.peek(i-1)).newlines){this._flags.inline_frame=!1;break}}while(o.type!==l.EOF&&(o.type!==l.END_BLOCK||o.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(a||this._flags.last_token.type===l.EQUALS||d(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!A(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(c(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},C.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===v;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},C.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(c(e.text,["set","get"])&&this._flags.mode!==g)e.type=l.WORD;else if("import"===e.text&&c(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(c(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===g){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?d(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||x(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(u(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&u(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===v;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===g||this.allow_wrap_or_preserved_newline(e),u(e,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,k)||u(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!x(this._flags.mode)&&!A(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":d(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===m?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&x(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===g&&c(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),d(e,i)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==m||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?d(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&d(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&d(e,["var","let","const"])||":"===this._flags.last_token.text||(u(e,"if")&&u(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(e,i)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&u(e,"from")&&(this._flags.import_block=!1))},C.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&u(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},C.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},C.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},C.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(x(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===g||this._flags.mode===v&&this._flags.parent.mode===g?(this._flags.mode===v&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},C.prototype.handle_operator=function(e){var t="*"===e.text&&(d(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=c(e.text,["-","+"])&&(c(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||c(this._flags.last_token.text,i)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(c(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&c(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var a=!0,s=!0,u=!1;if(":"===e.text?0===this._flags.ternary_depth?a=!1:(this._flags.ternary_depth-=1,u=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&c(e.text,o)){var g=":"===e.text,y=g&&u,_=g&&!u;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!_,this.print_token(e),g&&!y||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!g||y?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return _||this.allow_wrap_or_preserved_newline(e),a=!(this._output.just_added_newline()||_),this._output.space_before_token=a,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),a=!1;var b=this._tokens.peek();s=b&&c(b.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),a=this._flags.last_token.type===l.START_BLOCK,s=!1;else if(c(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),a=!1,s=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=d(this._flags.last_token,f)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&x(this._flags.mode)&&(a=!0),this._flags.last_token.type===l.RESERVED?a=!0:this._flags.last_token.type===l.END_EXPR?a=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(a=c(e.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(e.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==m||this._flags.inline_frame)&&this._flags.mode!==v||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||a,this.print_token(e),this._output.space_before_token=s}else this.print_token(e);else this.print_token(e)},C.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},C.prototype.print_block_commment=function(e,t){var r,a=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),i=!1,o=!1,l=e.whitespace_before,c=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(a[0]),this.print_newline(!1,t),a.length>1){for(i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(a=a.slice(1),"*"),o=function(e,t){for(var n,r=0,a=e.length;r<a;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(a,l),i&&(this._flags.alignment=1),r=0;r<a.length;r++)i?(this.print_token_line_indentation(e),this._output.add_token(s(a[r]))):o&&a[r]?(this.print_token_line_indentation(e),this._output.add_token(a[r].substring(c))):(this._output.current_line.set_indent(-1),this._output.add_token(a[r])),this.print_newline(!1,t);this._flags.alignment=0}},C.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},C.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},C.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},C.prototype.handle_eof=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e)},yne.Beautifier=C,yne}var are,ire,ore,lre={exports:{}},cre={},sre={};function ure(){if(are)return sre;are=1;var e=Ine().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<r.length;a++)"expand"!==r[a]?this.brace_style="collapse":this.brace_style=r[a]}return t.prototype=new e,sre.Options=t,sre}function dre(){if(ore)return lre.exports;ore=1;var e=function(){if(ire)return cre;ire=1;var e=ure().Options,t=bne().Output,n=Lne().InputScanner,r=new(0,Kne().Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=/\s/,l=/(?:\s|\n)+/g,c=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,s=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function u(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return u.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},u.prototype.eatWhitespace=function(e){for(var t=o.test(this._input.peek()),n=0;o.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},u.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},u.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},u.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},u.prototype.indent=function(){this._indentLevel++},u.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,u=this._options.eol;"auto"===u&&(u="\n",e&&a.test(e||"")&&(u=e.match(a)[0]));var d=(e=e.replace(i,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,d),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,p=0,m=!1,v=!1,g=!1,y=!1,_=!1,b=this._ch,w=!1;f=""!==this._input.read(l),h=b,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),b=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(c),A=r.get_directives(E);A&&"start"===A.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(s)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")&&(v=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var C=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);C.match(/[ :]$/)&&(C=this.eatString(": ").replace(/\s+$/,""),this.print_string(C),this._output.space_before_token=!0),0===p&&-1!==C.indexOf(":")?(v=!0,this.indent()):C in this.NESTED_AT_RULE?(this._nestedLevel+=1,C in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||v||(y=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)v&&(v=!1,this.outdent()),y=!1,g?(g=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),v&&(this.outdent(),v=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){w=!0;break}!m&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||y||0!==p?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),v||(v=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var M='"'===h||"'"===h;this.preserveSingleSpace(M||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===p?(v&&(this.outdent(),v=!1),y=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),p++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),p&&(p--,this.outdent()));else{var z=!1;this._input.lookBack("with")&&(z=!0),this.preserveSingleSpace(f||z),this.print_string(this._ch),v&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),_=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),_&&";"===this._input.peek()&&this._options.selector_separator_newline&&(_=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||v&&!_||0!==p||y?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||v||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),o.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var S='"'===h||"'"===h;this.preserveSingleSpace(S||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&o.test(this._ch)&&(this._ch=""));return this._output.get_code(u)},cre.Beautifier=u,cre}().Beautifier,t=ure().Options;return lre.exports=function(t,n){return new e(t,n).beautify()},lre.exports.defaultOptions=function(){return new t},lre.exports}var fre,hre={exports:{}},pre={},mre={};function vre(){if(fre)return mre;fre=1;var e=Ine().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,mre.Options=t,mre}var gre,yre,_re,bre,wre,Ere={};function Are(){if(gre)return Ere;gre=1;var e=Qne().Tokenizer,t=Qne().TOKEN,n=Kne().Directives,r=tre().TemplatablePattern,a=Wne().Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},o=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var i=new r(this._input).read_options(this._options),o=new a(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),word_control_flow_close_excluded:i.until(/[\n\r\t <}]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),angular_control_flow_start:o.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),handlebars_open:o.until(/[\n\r\t }]/),handlebars_raw_close:o.until(/}}/),comment:o.starting_with(/<!--/).until_after(/-->/),cdata:o.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:o.starting_with(/<!\[/).until_after(/]>/),processing:o.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=o.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===i.TAG_OPEN||e.type===i.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===i.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===i.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(i.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(i.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=o.get_directives(n))&&"start"===r.ignore&&(n+=o.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(i.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(i.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==i.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(i.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==i.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(i.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(i.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var a=n.endsWith("(")?1:0,o=0;!n.endsWith("{")||a!==o;){var l=this._input.next();if(null===l)break;"("===l?a++:")"===l&&o++,n+=l}r=this._create_token(i.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===i.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(i.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===i.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(i.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(i.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,a="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(i.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(i.VALUE,o)}else(a=this.__patterns.attribute.read())&&(r=t.type===i.EQUALS?this._create_token(i.VALUE,a):this._create_token(i.ATTRIBUTE,a));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===i.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var a=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(a)&&(r=this._input.readUntil(new RegExp("</"+a+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(i.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===i.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=i.TEXT,r;var a=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(a)return this._create_token(i.TEXT,a)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===i.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(i.TEXT,n):null},Ere.Tokenizer=l,Ere.TOKEN=i,Ere}function xre(){if(yre)return pre;yre=1;var e=vre().Options,t=bne().Output,n=Are().Tokenizer,r=Are().TOKEN,a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,o=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};o.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},o.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},o.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},o.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(e){this._output.add_new_line(e)},o.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},o.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,a=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?a="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?a="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?a="html":n.search(/test\/null/)>-1&&(a="null"),a):null};function c(e,t){return-1!==t.indexOf(e)}function s(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function u(e){this._printer=e,this._current_frame=null}function d(t,n,r,a){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=a,this._tag_stack=null;var i=new e(n,"html");this._options=i,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}u.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},u.prototype.record_tag=function(e){var t=new s(this._current_frame,e,this._printer.indent_level);this._current_frame=t},u.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},u.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},u.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},u.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.test(e)&&(t=e.match(a)[0]));var l=(e=e.replace(i,"\n")).match(/^[\t ]*/)[0],c={text:"",type:""},s=new f(this._options),d=new o(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new u(d);for(var p=null,m=h.next();m.type!==r.EOF;)m.type===r.TAG_OPEN||m.type===r.COMMENT?s=p=this._handle_tag_open(d,m,s,c,h):m.type===r.ATTRIBUTE||m.type===r.EQUALS||m.type===r.VALUE||m.type===r.TEXT&&!s.tag_complete?p=this._handle_inside_tag(d,m,s,c):m.type===r.TAG_CLOSE?p=this._handle_tag_close(d,m,s):m.type===r.TEXT?p=this._handle_text(d,m,s):m.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(d,m):m.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(d,m):d.add_raw_token(m),c=p,m=h.next();return d._output.get_code(t)},d.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},d.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},d.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},d.prototype._handle_inside_tag=function(e,t,n,a){var i=n.has_wrapped_attrs,o={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),i=i||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(a.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),i=!0)),e.print_token(t),i=i||e.previous_token_wrapped(),n.has_wrapped_attrs=i),o},d.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},d.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var a,i=t.text,o=1,l="",c="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?a=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?a=this._css_beautify:"html"===n.custom_beautifier_name&&(a=function(e,t){return new d(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-e.indent_level);var s=e.get_full_indent(o);if(i=i.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===i[0]&&i.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(i);if(!u)return void e.add_raw_token(t);l=s+u[1]+"\n",i=u[4],u[5]&&(c=s+u[5]),i=i.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(t.whitespace_before=u[0])}if(i)if(a){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,i=a(s+i,new f)}else{var h=t.whitespace_before;h&&(i=i.replace(new RegExp("\n("+h+")?","g"),"\n")),i=s+i.replace(/\n/g,"\n"+s)}l&&(i=i?l+i+"\n"+c:l+c),e.print_newline(!1),i&&(t.text=i,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},d.prototype._handle_tag_open=function(e,t,n,a,i){var o=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||o.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,o,n,a),o.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),o.is_start_tag&&this._is_wrap_attributes_force){var l,c=0;do{(l=i.peek(c)).type===r.ATTRIBUTE&&(o.attr_count+=1),c+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=t.text.length+1),o.tag_complete||o.is_unformatted||(e.alignment_size=o.alignment_size),o};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var a;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(a=n.text.match(/^<([^\s>]*)/),this.tag_check=a?a[1]:""):(a=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=a?a[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var i=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(i=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(i)))}else this.tag_complete=!0};d.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||c(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&c(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&c(t.tag_check,this._options.content_unformatted),t.is_inline_element=c(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},d.prototype._set_tag_position=function(e,t,n,a,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),c(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&i.type===r.TAG_CLOSE&&a.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var o=!1;o=(o=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(a.is_inline_element||a.is_unformatted)&&!(i.type===r.TAG_CLOSE&&n.start_tag_token===a)&&"TK_CONTENT"!==i.type,(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===i.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},d.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];return d.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==p.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},pre.Beautifier=d,pre}function Cre(){if(bre)return vne;bre=1;var e=function(){if($ne)return gne.exports;$ne=1;var e=rre().Beautifier,t=Nne().Options;return gne.exports=function(t,n){return new e(t,n).beautify()},gne.exports.defaultOptions=function(){return new t},gne.exports}(),t=dre(),n=function(){if(_re)return hre.exports;_re=1;var e=xre().Beautifier,t=vre().Options;return hre.exports=function(t,n,r,a){return new e(t,n,r,a).beautify()},hre.exports.defaultOptions=function(){return new t},hre.exports}();function r(r,a,i,o){return n(r,a,i=i||e,o=o||t)}return r.defaultOptions=n.defaultOptions,vne.js=e,vne.css=t,vne.html=r,vne}var kre=(wre||(wre=1,function(e){var t,n,r,a,i=Cre();i.js_beautify=i.js,i.css_beautify=i.css,i.html_beautify=i.html,e.exports=(t=i,n=i,r=i,a=function(e,n){return t.js_beautify(e,n)},a.js=t.js_beautify,a.css=n.css_beautify,a.html=r.html_beautify,a.js_beautify=t.js_beautify,a.css_beautify=n.css_beautify,a.html_beautify=r.html_beautify,a)}(mne)),mne.exports);const Mre=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:a}=e,i=t.getBoundingClientRect();let o=r,l=a;return o-=o+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,a>.6*i.width?l-=n+50:a<.5*i.width+n&&(l-=42),{top:o,left:l}},zre=i(({width:t="100%",height:r="100%",VariableDropdownHeight:a="160px",readOnly:i=!1,value:c="",handleChange:u,setValue:d,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:m="light",isRequisiteType:v=!1,onPaste:g,showVariableDropdown:_=!0,defaultValue:b,customOptions:w={},editorVariableZindex:E=99999,showMinimap:A=!0,isFocus:x=!1},C)=>{const k=o(null),M=o([]),z=o(null),S=o(null),[O,I]=s(0),[N,j]=s(!1),[T,D]=s(!1),[L,P]=s({top:0,left:0}),[R,H]=s([]),B=o(f);l(()=>{B.current=f},[f]);l(()=>{const e=k.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{D(!1),z.current=null,S.current=null,M.current=[],I(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[T]),l(()=>{const e=k.current;if(!e||!O)return;const t=[],n=[];N?n.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),M.current=e.deltaDecorations(M.current,[...t,...n])},[O,N]);const q=(e,t)=>{switch(t){case"json":case"javascript":return kre.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return kre.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return y(C,()=>({getEditorInstance:()=>k.current,focus:()=>{k.current?.focus()},beautify:()=>{if(k.current){const e=k.current.getValue(),t=k.current.getModel()?.getLanguageId(),n=q(e,t||"json");k.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(pne,{defaultValue:b,height:r,width:t,language:p,value:c,options:{minimap:{enabled:A},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:i,guides:{indentation:!1},...w},onMount:(e,t)=>{k.current=e,x&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{I(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const a=r.getLineContent(n.lineNumber),i=n.column-1;if(0===i)return void D(!1);const o=a.lastIndexOf("$",i-1),l=a.lastIndexOf("${",i-1),c=-1!==l?a.indexOf("}",l+2):-1,s=-1!==l&&-1!==c&&i-1>l&&i-1<c,u=!/\}/.test(a.slice(o+1,i));if(-1!==o&&i>o&&!/\s/.test(a.slice(o+1,i))&&!s&&u){z.current=o,S.current=a.slice(o+1,i);const r=(S.current??"").toLowerCase(),l=B.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));H(l);const c=e.getScrolledVisiblePosition(n),s=e.getDomNode();P(Mre(c,s,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&D(!0)}else D(!1),z.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=k.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),a=t.column-2;"$"===r[a]?(z.current=a,S.current=""):(z.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);j(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();d(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const a=r.getLineContent(n.lineNumber),i=n.column-2;if("$"===a[z.current??i]){null===z.current&&(z.current=i),S.current=a.slice(z.current+1,i);const t=B.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?H(t):(H([]),z?.current!==i&&" "===a[i]&&(z.current=null,S.current=null,D(!1)));const r=e.getScrolledVisiblePosition(n),o=e.getDomNode();P(Mre(r,o,150))}else z.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=q(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),a=e.getWordAtPosition(n),i=a?new t.Range(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),o=[];return r.endsWith("ff.")&&o.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:i},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:i},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:i}),{suggestions:o}}})},onChange:(e,t)=>u(e,t),theme:m}),T&&L&&_&&e(xee,{position:"absolute",width:"300px",height:a,optionsList:R,onSelectVariable:e=>{if(v&&k.current){const t=k.current,n=t.getPosition();if(n){const r=`'${e.name}'`,a=z?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:a+1,endLineNumber:n.lineNumber,endColumn:a+(n.column-a)},text:r,forceMoveMarkers:!0}]),S.current=null,z.current=null,D(!1)}}else((e,t)=>{if(k.current){const n=k.current,r=n.getPosition();if(r){const a=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,i=z?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:i+2,endLineNumber:r.lineNumber,endColumn:i+(r.column-i)},text:a,forceMoveMarkers:!1}]);const o=[];o.push({range:{startLineNumber:O,startColumn:1,endLineNumber:O,endColumn:1},options:{isWholeLine:!1}}),M.current=n.deltaDecorations(M.current,o),S.current=null,z.current=null,D(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:L,zIndex:E})]})}),Sre=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...a}=e;return{...a,...t,runCount:n+1}}));var Ore,Ire={exports:{}};var Nre=(Ore||(Ore=1,"undefined"!=typeof self&&self,Ire.exports=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(t,n){t.exports=e},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var a=r(n(0));t.ArcherContainerContext=a.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var a=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(a).default}});var i=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(i).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&("get"in a?t.__esModule:!a.writable&&!a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),l=n(7),c=n(1),s=n(2),u=n(8),d=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,a=e.children,i=(0,o.useMemo)(function(){return(0,s.encodeId)(t)},[t]),f=(0,o.useContext)(c.ArcherContainerContext),h=(0,o.useRef)(),p=(0,o.useCallback)(function(e){var t=(0,d.generateSourceToTarget)(i,e);(0,d.assertContextExists)(f),f.registerTransitions(i,t)},[f,i]),m=(0,o.useCallback)(function(){(0,d.assertContextExists)(f),f.unregisterTransitions(i)},[f,i]),v=(0,o.useCallback)(function(e){e&&((0,d.assertContextExists)(f),f.registerChild(i,e))},[i,f]),g=(0,o.useCallback)(function(){(0,d.assertContextExists)(f),f.unregisterChild(i)},[f,i]);(0,l.useIsomorphicLayoutEffect)(function(){return v(h.current),function(){return g()}},[v,g]),(0,u.useDeepCompareEffect)(function(){return p(r),function(){return m()}},[p,r,m]),o.default.Children.only(a);var y=a;return o.default.cloneElement(y,Object.assign(Object.assign({},y.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var a=n(0),i=r(n(9));function o(e){var t=(0,a.useRef)();return(0,i.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,a.useEffect)(e,t.map(o))}},function(e,t,n){var r=Array.isArray,a=Object.keys,i=Object.prototype.hasOwnProperty,o="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,c,s,u=r(t),d=r(n);if(u&&d){if((c=t.length)!=n.length)return!1;for(l=c;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(u!=d)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var p=t instanceof RegExp,m=n instanceof RegExp;if(p!=m)return!1;if(p&&m)return t.toString()==n.toString();var v=a(t);if((c=v.length)!==a(n).length)return!1;for(l=c;0!=l--;)if(!i.call(n,v[l]))return!1;if(o&&t instanceof Element&&n instanceof Element)return t===n;for(l=c;0!=l--;)if(!("_owner"===(s=v[l])&&t.$$typeof||e(t[s],n[s])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,a=t.sourceAnchor,i=t.targetAnchor,o=t.label,l=t.className,c=t.style,s=t.order,u=void 0===s?0:s,d=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:a},target:{id:(0,r.encodeId)(n),anchor:i},className:l,label:o,style:c,order:u,domAttributes:d,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&("get"in a?t.__esModule:!a.writable&&!a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return l(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=c(n(0)),d=s(n(12)),f=n(1),h=n(14),p=n(4),m=n(19),v=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},y=u.default.forwardRef(function(e,t){var n=e.endShape,i=void 0===n?p.endShapeDefaultProp:n,o=e.strokeColor,l=void 0===o?"#f00":o,c=e.strokeWidth,s=void 0===c?2:c,y=e.svgContainerStyle,_=void 0===y?{}:y,b=e.noCurves,w=e.children,E=e.className,A=e.endMarker,x=e.lineStyle,C=e.offset,k=e.startMarker,M=e.strokeDasharray,z=e.style,S=a((0,u.useState)({}),2),O=S[0],I=S[1],N=a((0,u.useState)({}),2),j=N[0],T=N[1],D=(0,u.useRef)(new d.default(function(){B()})).current,L=(0,u.useRef)(null),P=a(u.default.useState(),2)[1],R=(0,u.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,u.useImperativeHandle)(t,function(){return{refreshScreen:B,arrowMarkerUniquePrefix:R}});var H,B=u.default.useCallback(function(){return P({})},[]),q=(0,u.useCallback)(function(e,t){T(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),F=(0,u.useCallback)(function(e){T(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),U=(0,u.useCallback)(function(e,t){I(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),V=(0,u.useCallback)(function(e){I(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),W=(0,u.useMemo)(function(){return Object.assign(Object.assign({},g),_)},[_]);H="function"==typeof w?w(f.ArcherContainerContext):w,(0,v.useResizeListener)(B),(0,v.useObserveElements)(O,D);var Q=(0,u.useMemo)(function(){return{registerTransitions:q,unregisterTransitions:F,registerChild:U,unregisterChild:V}},[q,F,U,V]);return u.default.createElement(f.ArcherContainerContextProvider,{value:Q},u.default.createElement("div",{style:Object.assign(Object.assign({},z),{position:"relative"}),className:E},u.default.createElement("svg",{style:W},u.default.createElement("defs",null,u.default.createElement(m.ArrowMarkers,{endShape:i,sourceToTargetsMap:j,strokeColor:l,uniqueId:R})),u.default.createElement(h.SvgArrows,{startMarker:k,endMarker:A,endShape:i,strokeColor:l,strokeWidth:s,strokeDasharray:M,noCurves:b,lineStyle:x,offset:C,parentCurrent:L.current,refs:O,uniqueId:R,sourceToTargetsMap:j})),u.default.createElement("div",{style:{height:"100%"},ref:L},H)))});t.default=y},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var a=r[n];e.call(t,a[1],a[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,a=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(a):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=2,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,s=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,a=0;function l(){n&&(n=!1,e()),r&&s()}function c(){i(l)}function s(){var e=Date.now();if(n){if(e-a<o)return;r=!0}else n=!0,r=!1,setTimeout(c,t);a=e}return s}(this.refresh.bind(this),20)};s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},s.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null;var u=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},d=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||a},f=y(0,0,0,0);function h(e){return parseFloat(e)||0}function p(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function m(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=d(e).getComputedStyle(e),a=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var a=r[n],i=e["padding-"+a];t[a]=h(i)}return t}(r),i=a.left+a.right,o=a.top+a.bottom,l=h(r.width),c=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+i)!==t&&(l-=p(r,"left","right")+i),Math.round(c+o)!==n&&(c-=p(r,"top","bottom")+o)),!function(e){return e===d(e).document.documentElement}(e)){var s=Math.round(l+i)-t,u=Math.round(c+o)-n;1!==Math.abs(s)&&(l-=s),1!==Math.abs(u)&&(c-=u)}return y(a.left,a.top,l,c)}var v="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof d(e).SVGGraphicsElement}:function(e){return e instanceof d(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return r?v(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):m(e):f}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e};_.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},_.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var b=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,a=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(i.prototype);return u(o,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),o}(t);u(this,{target:e,contentRect:n})},w=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};w.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new _(e)),this.controller_.addObserver(this),this.controller_.refresh())}},w.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},w.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},w.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},w.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new b(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},w.prototype.clearActive=function(){this.activeObservations_.splice(0)},w.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,A=function(e){if(!(this instanceof A))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=s.getInstance(),n=new w(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){A.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var x=void 0!==a.ResizeObserver?a.ResizeObserver:A;t.default=x}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var a=r(n(0)),i=n(15),o=r(n(17)),l=n(3),c=function(e){var t,n,r=e.style||{},c=r.startMarker||e.startMarker,s=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,u=(0,l.createShapeObj)(r,e.endShape),d=e.domAttributes,f=e.cursor,h=e.hitSlop,p=r.strokeColor||e.strokeColor,m=r.strokeWidth||e.strokeWidth,v=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),y=r.lineStyle||e.lineStyle||(g?"angle":"curve"),_=e.offset||0,b=e.source.anchor,w=(0,i.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,A=(0,i.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return w?A?a.default.createElement(o.default,{className:e.className,startingPoint:w,startingAnchorOrientation:b,endingPoint:A,endingAnchorOrientation:E,strokeColor:p,strokeWidth:m,strokeDasharray:v,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:y,offset:_,enableStartMarker:!!c,disableEndMarker:!s,endShape:u,domAttributes:d,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,i.getPointFromElement)(e.parentCurrent);return t?a.default.createElement(a.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return a.default.createElement(c,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var a=r(n(16));function i(e){return new a.default(e.left,e.top)}var o=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=o(e);return t?i(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=o(r[t]);if(!l)return null;var c=function(e,t){switch(e){case"top":return i(t).add(new a.default(t.width/2,0));case"bottom":return i(t).add(new a.default(t.width/2,t.height));case"left":return i(t).add(new a.default(0,t.height/2));case"right":return i(t).add(new a.default(t.width,t.height/2));case"middle":return i(t).add(new a.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return c?c.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=a},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var a=r(n(0)),i=n(18);function o(e,t,n,r,a,o,l,c){var s=(0,i.computeArrowDirectionVector)(a),u=s.arrowX,d=s.arrowY;if("straight"===o&&void 0!==l&&void 0!==c){var f=Math.atan2(c-t,l-e);u=Math.cos(f),d=Math.sin(f)}return{xPoint:e+u*n*r/2,yPoint:t+d*n*r/2}}function l(e,t,n,r,a){return"top"===a||"bottom"===a?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===a||"right"===a?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function c(e,t,n,r,a){return"top"===a||"bottom"===a?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===a||"right"===a?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function s(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=o,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=c,t.computeLabelDimensions=s,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,i=e.endingPoint,u=e.endingAnchorOrientation,d=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,m=e.arrowMarkerId,v=e.lineStyle,g=e.offset,y=e.enableStartMarker,_=e.disableEndMarker,b=e.endShape,w=e.domAttributes,E=e.hitSlop,A=void 0===E?10:E,x=e.cursor,C=void 0===x?"pointer":x,k=b.circle?2*b.circle.radius:2*b.arrow.arrowLength,M=o(n.x,n.y,y?k:0,f,r,v,i.x,i.y),z=M.xPoint,S=M.yPoint,O=o(i.x,i.y,_?0:k,f,u,v,n.x,n.y),I=O.xPoint,N=O.yPoint,j=l(z,S,I,N,r),T=j.xAnchor1,D=j.yAnchor1,L=c(z,S,I,N,u),P=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,a=e.yAnchor1,i=e.xAnchor2,o=e.yAnchor2,l=e.xEnd,c=e.yEnd,s=e.lineStyle,u=e.offset;if(u&&0!==u){var d="straight"===s?Math.atan2(c-n,l-t):Math.atan2(a-n,r-t),f=u*Math.cos(d),h=u*Math.sin(d);"straight"!==s&&(t+=f,n+=h),l-=f,c-=h}var p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(s)&&(p+="".concat("curve"===s?"C":"").concat(r,",").concat(a," ").concat(i,",").concat(o," ")),p+"".concat(l,",").concat(c)}({xStart:z,yStart:S,xAnchor1:T,yAnchor1:D,xAnchor2:L.xAnchor2,yAnchor2:L.yAnchor2,xEnd:I,yEnd:N,lineStyle:v,offset:g}),R=s(z,S,I,N),H=R.xLabel,B=R.yLabel,q=R.labelWidth,F=R.labelHeight,U="url(#".concat(m,")");return a.default.createElement("g",{className:t},a.default.createElement("path",{d:P,style:{fill:"none",stroke:d,strokeWidth:f,strokeDasharray:h},markerStart:y?U:void 0,markerEnd:_?void 0:U}),w&&a.default.createElement("path",Object.assign({d:P,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:A,cursor:w?C:"initial",pointerEvents:"all"}},w)),p&&a.default.createElement("foreignObject",{x:H,y:B,width:q,height:F,style:{overflow:"visible",pointerEvents:"none"}},a.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},a.default.createElement("div",null,p))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var a=r(n(0)),i=n(4),o=n(3),l=function(e,t){return function(){var n,r,o,l,c,s,u,d,f,h,p,m,v=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(o=t.circle)||void 0===o?void 0:o.radius)||i.endShapeDefaultProp.circle.radius,g=(null===(c=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===c?void 0:c.strokeWidth)||(null===(s=t.circle)||void 0===s?void 0:s.strokeWidth)||i.endShapeDefaultProp.circle.strokeWidth,y=(null===(d=null===(u=e.endShape)||void 0===u?void 0:u.circle)||void 0===d?void 0:d.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||i.endShapeDefaultProp.circle.strokeColor,_=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(m=t.circle)||void 0===m?void 0:m.fillColor)||i.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*v,markerHeight:4*v,refX:2*v+g,refY:2*v,path:a.default.createElement("circle",{cx:2*v,cy:2*v,r:v,fill:_,stroke:y,strokeWidth:g})}}},c=function(e,t,n){return function(){var r,o,l,c,s,u,d,f,h=e.strokeColor||n,p=null!==(s=null!==(l=null===(o=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===o?void 0:o.arrowLength)&&void 0!==l?l:null===(c=null==t?void 0:t.arrow)||void 0===c?void 0:c.arrowLength)&&void 0!==s?s:i.endShapeDefaultProp.arrow.arrowLength,m=(null===(d=null===(u=e.endShape)||void 0===u?void 0:u.arrow)||void 0===d?void 0:d.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||i.endShapeDefaultProp.arrow.arrowThickness,v="M0,0 L0,".concat(m," L").concat(p,",").concat(m/2," z");return{markerWidth:p,markerHeight:m,refX:0,refY:m/2,path:a.default.createElement("path",{d:v,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,i=e.uniqueId;return a.default.createElement(a.default.Fragment,null,(0,o.getSourceToTargets)(t).map(function(e){var t=e.source,s=e.target,u=e.style,d=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,a=(0,o.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:c(t,r,n)}[a]()}({style:void 0===u?{}:u,endShape:n,strokeColor:r}),f=d.markerHeight,h=d.markerWidth,p=d.path,m=d.refX,v=d.refY;return a.default.createElement("marker",{id:(0,o.getMarkerId)(i,t,s),key:(0,o.getMarkerId)(i,t,s),markerWidth:h,markerHeight:f,refX:m,refY:v,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}])}(a)),Ire.exports);const jre=({getChildNodeComponent:r,parentNodeIndex:a,parentNodeData:i,verticalLineHeight:o,datasetHeight:l,curveHeights:c,itemRefs:s,datasetRef:u,isReadOnlyMode:d})=>e(t,{children:0===i?.machineInstances?.length?e(t,{children:!d&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:i,parentNodeIndex:a})})]})}):i?.machineInstances?.map((f,h)=>{const p=0===h;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${o}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((o,d)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===d?u:null,children:n("div",{className:"ff-execution-item",ref:e=>s.current[d]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${d}`,style:{height:`${c[d]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${d}`}),Number(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(cF,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:o,runLevelExecutionDataSetIndex:d,parentNodeData:i,parentNodeIndex:a})})]})},o?.runLevelExecutionDataSetId))}),h===i?.machineInstances.length-1&&e(t,{children:!d&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:i,parentNodeIndex:a,childNodeIndex:h+1})})]})})]},h)})}),Tre=({data:t,noOfScripts:r,getChildNodeComponent:i,getParentNodeComponent:c,getParentNodeComponentActionItems:u,childNodeCurveHeight:d=1.28,isReadOnlyMode:f=!1})=>{const h=o(null),[p,m]=s(0),[v,g]=s([]),y=o([]);l(()=>{h.current&&m(h.current.offsetHeight)},[t]);l(()=>{(()=>{const e=y.current.map((e,t)=>0===t?0:p*d);g(e)})()},[p,t]);const _=e=>1+(e.machineInstances?.length+1||0);let b=1;const w=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||hF(e.machineInstances)?1:e.machineInstances.length)(t):e+_(t),0),E=Math.round(w/2);let A=1===E&&f&&2===w||1===E&&!f&&2===w;return e("div",{className:"connecting-branch-container",children:e(Nre.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(Nre.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:A?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(cF,{children:r}),e(cF,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const o=b,l=_(t);b+=l;const s=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(a.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${o} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(Nre.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:c({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),u({parentNodeData:t,parentNodeIndex:r})]})}),e(jre,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:s,datasetHeight:p,curveHeights:v,itemRefs:y,datasetRef:h,getChildNodeComponent:i,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${b}`},children:e(Nre.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:c({isMultiSelect:!0})})})})]})})})},Dre=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},Lre=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:a,mentionUserRef:i})=>{const[c,u]=s(0),d=o([]);if(!t)return null;const f=n.filter(e=>!a||e.name.toLowerCase().startsWith(a.toLowerCase()));l(()=>{u(0)},[a]);const h=p(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),u(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),u(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[c];t&&r(t.name,t.emailId)}},[f,c,t,r]);return l(()=>{d.current[c]&&d.current[c]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[c]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:i,children:f.length?f.map((t,n)=>e("div",{ref:e=>d.current[n]=e,className:"mention-option "+(n===c?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(cF,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(cF,{children:"No user name found"})})})})},Pre=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],Rre=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},Hre=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:a,comment:i,depth:c=0,isDisable:u,userDetails:d,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:m=83,isVewMode:v=!1,deleteEnable:g=!0})=>{const[y,_]=s(""),[b,w]=s(!1),[E,A]=s(!1),[x,C]=s(!0),[k,M]=s([]),[z,S]=s(!1),[O,I]=s([]),[N,j]=s({top:0,left:0}),[T,D]=s(""),L=o(null),P=o(null),R=o(null);l(()=>{b&&i?.description&&_(i?.description)},[b,i.description]),l(()=>{const e=Pre(d);M(e)},[d]),l(()=>{const e=(y.match(QU)||[]).map(e=>Rre(e,k)).filter(Boolean);I(e)},[y]),l(()=>{const e=e=>{const t=P.current&&!P.current.contains(e.target)&&L.current&&!L.current.contains(e.target),n=R.current&&!R.current.contains(e.target)&&L.current&&!L.current.contains(e.target);(t||n)&&(S(!1),_(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return z&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[z]);const{modifiedByUname:H,createdByUname:B,modifiedOn:q,createdOn:F}=i||{},U=q??F??(new Date).toLocaleString(),V=H??B??"Anonymous",W=c>2,Q=V?V.charAt(0).toUpperCase():"A";l(()=>{b&&i.description&&_(i.description)},[b,i.description]);const G=()=>{0!==y.trim().length&&(b?(r(i.id,y,O),A(!1),_("")):(C(!0),t(i.id,y,O),A(!1),_("")),b&&w(!1))};l(()=>{(()=>{if(!L.current)return;const e=L?.current,t=b?P?.current:R?.current,n=L.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const a=e.value.slice(0,t);n.textContent=a||".";const i=document.createElement("span");i.textContent=".",n.appendChild(i);const o=i.getBoundingClientRect();return document.body.removeChild(n),{top:o.top-20,left:o.left}})(e,n),a=t?.getBoundingClientRect().height??0,i=e?.getBoundingClientRect();if(!i)return;const o=window.innerHeight-i.bottom,l=i.top;j({top:o<a&&l>a?n-a-16:n+32,left:r.left+10})})()},[y]);const Y=e=>{const t=e.target.value;_(t);const n=(t.match(/@\S+/g)||[]).map(e=>Rre(e,k)).filter(e=>null!==e);I(n);const r=e.target.selectionStart,a=t.slice(0,r),i=a.match($U);D(i?.[1]||"");const o=JU.test(a);S(!!o)},K=e=>{if("@"===e.key)S(!0);else if("Backspace"===e.key&&L.current){const t=L.current.selectionStart,n=y.slice(0,t);n.endsWith("@")&&S(!1);const r=n.match(KU);if(r){e.preventDefault();const a=r[1],i=n.lastIndexOf(a||""),o=y.slice(0,i)+y.slice(t);_(o),S(!1),I(()=>(o.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Rre(e,k)).filter(Boolean)),setTimeout(()=>{L.current?.setSelectionRange(i,i)},0)}}},Z=e=>{if(!L.current)return;const t=L.current.selectionStart,n=y.slice(0,t),r=n.match(GU);if(r){const a=n.lastIndexOf(r[1]||""),i=y.slice(t),o=`@${e.replace(/\s+/g,"")} `,l=y.slice(0,a)+o+i;_(l),S(!1),setTimeout(()=>{L.current?.focus(),L.current?.setSelectionRange(a+o.length+1,a+o.length+1)},0),I(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>Rre(e,k)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:i?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${i?.profileImage}`}):Q}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:V}),e("div",{className:"ff-message-time",children:U})]}),n("div",{className:"ff-editable-container",children:[!b&&e(cF,{className:"typography-text",children:i?.description?.split(eV).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),b&&n("div",{className:"inputContainer",children:[e("textarea",{rows:y.length<m?1:3,className:"inputContainer_input first_input",value:y,autoFocus:!0,placeholder:"Edit comment",ref:L,onChange:e=>Y(e),onKeyDown:K}),z&&e("div",{id:"mention-user",style:{position:"absolute",top:`${N.top}px`,left:`${N.left}px`},children:e(Lre,{hasAtSymbol:z,usersObj:k,optionClicked:Z,charsAfterAt:T,mentionUserRef:P})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(pF,{title:b?"Update":"Add",children:e(lF,{name:"comment_reply",hoverEffect:!0,disabled:b&&y.trim()===(i?.description?.trim()??"")||0===y.trim().length,onClick:()=>{G(),w(!1),A(!1)}})})}),e("div",{className:"reply",onClick:()=>{w(!1),A(!1),_("")},children:e(pF,{title:b?"Cancel":"Close",children:e(lF,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!W&&c<2&&i.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>C(e=>!e),children:e(pF,{title:""+(x?"collapse":"expand"),children:e(lF,{name:x?"collapse-arrow":"expand-arrow",disabled:b||E,hoverEffect:!0})})}),!W&&c<2&&0===i.comments?.length&&e("div",{className:"action-icon",children:e(lF,{name:"expand-arrow",disabled:!0})}),!v&&n("div",{className:"ff-comment-action-item",children:[c<2&&e("div",{className:"action-icon",children:e(pF,{title:"Reply",children:e(lF,{name:"comment_icon",disabled:b||u,hoverEffect:!0,onClick:()=>{A(!0)}})})}),h&&e("div",{className:"action-icon",children:e(pF,{title:"Edit",children:e(lF,{name:"edit",disabled:E||u,hoverEffect:!0,onClick:()=>w(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(pF,{title:"Delete",children:e(lF,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||a(i.id)},disabled:b||E||u,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:y.length<m?1:3,className:"inputContainer_input first_input",value:y,autoFocus:!0,placeholder:"Add reply comments",ref:L,onChange:e=>Y(e),onKeyDown:K}),z&&e("div",{id:"mention-user",style:{position:"absolute",top:`${N.top}px`,left:`${N.left}px`},children:e(Lre,{hasAtSymbol:z,usersObj:k,optionClicked:Z,charsAfterAt:T,mentionUserRef:R})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{G(),w(!1),A(!1)},children:e(pF,{title:"Reply",children:e(lF,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!y.length)})})}),e("div",{className:"reply",onClick:()=>{w(!1),A(!1),_("")},children:e(pF,{title:"Cancel",children:e(lF,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),x&&i.comments?.length>0&&e("div",{className:`child-comments ${0===c?"first-level-child":""} ${1===c?"second-level-child":""}`,children:i.comments.map(n=>e("div",{className:`child-comments child-comments-${c+1}`,children:e(Hre,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:a,comment:n,depth:c+1,isDisable:u,userDetails:d,isEditDeleteActionAllowed:i.createdBy===p,createdByID:p,isVewMode:v})},n.id))})]})})},Bre=({commentsData:t,handleAddComment:r,handleEditComment:a,handleDeleteComment:i,onCommentsDataChange:c,currentUser:u,isDisable:d=!1,userDetails:f,createdByID:h,rowBreakCharCount:m=83,isVewMode:v=!1,deleteEnable:g=!0,showTextarea:y=!1,autoFocus:_=!1})=>{const[b,w]=s(""),[E,A]=s([]),[x,C]=s(!1),[k,M]=s([]),[z,S]=s({top:0,left:0}),[O,I]=s(""),N=o(null),j=o(null),[T,D]=s(!1);l(()=>{const e=Pre(f);M(e)},[f]);const L=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=L(n.comments,t);if(e)return e}return null};l(()=>{t&&A(t)},[t]),l(()=>{const e=e=>{j.current&&!j.current.contains(e.target)&&(C(!1),w(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:P,editNode:R,deleteNode:H}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:T2(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),B=(e,t,n)=>{if(!t.trim())return;const a={id:T2(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:u?.createdBy,modifiedBy:u?.modifiedBy,createdByUname:u?.createdByUname,modifiedByUname:u?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};A(t=>P(t,e,a)),r&&r(a,L(E,e))},q=p((e,t,n)=>{const r=R(E,e,t);A(r);const i=L(r,e);a&&a(e,t,i,n)},[E,R,a]),F=p(async e=>{try{if(i){const t=await i(e);if(t?.success){const t=H(E,e);A(t)}}}catch(e){console.error("Error deleting comment:",e)}},[H,i]);l(()=>{c&&c(E)},[E,c]);l(()=>{(()=>{if(!N.current)return;const e=N?.current,t=j?.current,n=N.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const a=e.value.slice(0,t);n.textContent=a||".";const i=document.createElement("span");i.textContent=".",n.appendChild(i);const o=i.getBoundingClientRect();return document.body.removeChild(n),{top:o.top,left:o.left}})(e,n),a=t?.getBoundingClientRect().height??0,i=e?.getBoundingClientRect();if(!i)return;const o=window.innerHeight-i.bottom,l=i.top;S({top:o<a&&l>a?n-a-16:n+32,left:r.left+10})})()},[b]);l(()=>{b.includes("\n")||D(!1)},[b]);return n("div",{className:"ff-comments-container-box",children:[!v&&n("div",{className:"ff-first-comment "+(y?"no-border":""),children:[e(cF,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!y&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:T?3:b.length<m?1:3,autoFocus:_,value:b,onChange:e=>(e=>{const t=e.target.value;w(t);const n=e.target.selectionStart,r=t.slice(0,n),a=r.match($U);I(a?.[1]||"");const i=JU.test(r);C(!!i),t||D(!1)})(e),placeholder:"Add a comment",disabled:d,ref:N,onKeyDown:e=>{if("@"===e.key)C(!0);else if("Backspace"===e.key&&N.current){const t=N.current.selectionStart;if(b.slice(0,t).endsWith("@")&&C(!1),x){e.preventDefault();const n=b.slice(0,t-1)+b.slice(t);w(n);const r=t-1,a=n.slice(0,r).match($U);I(a?.[1]||""),C(!!a),setTimeout(()=>{N.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&D(!0)}}),x&&e("div",{id:"mention-user",style:{position:"absolute",top:`${z.top}px`,left:`${z.left}px`},children:e(Lre,{hasAtSymbol:x,usersObj:k,optionClicked:e=>{if(!N.current)return;const t=N.current.selectionStart,n=b.slice(0,t),r=n.match(YU);if(r){const a=n.lastIndexOf(r[1]??""),i=b.slice(t),o=`@${e} `,l=b.slice(0,a)+o+i;w(l),C(!1),setTimeout(()=>{N.current?.focus();const e=a+o.length+1;N.current?.setSelectionRange(e,e)},0)}},charsAfterAt:O,mentionUserRef:j})}),e("span",{className:"reply-comment",children:e(pF,{title:"Add",children:e(lF,{name:"comment_reply",onClick:()=>{if(!b.trim())return;const e=k.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(b)).map(e=>e.emailId),t={id:T2(),description:b,comments:[],createdBy:u?.createdBy,modifiedBy:u?.modifiedBy,createdByUname:u?.createdByUname,modifiedByUname:u?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),A(e=>[...e,t]),w("")},hoverEffect:!0,disabled:Boolean(!b.length)})})})]})]}),E.length>0&&E.map(t=>e(Hre,{handleInsertNode:B,handleEditNode:q,handleDeleteNode:F,comment:t,depth:0,isDisable:d,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:v,deleteEnable:g},t.id))]})},qre=()=>{const e=o(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},Fre=({isOpen:t,onClose:r,onContinue:a,titleMessage:i="Warning!",subTitleMessage:o="Unsaved Changes.",iconName:l,modalMessage:c="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:s="Cancel",secondButtonLabel:u="Continue",buttonVariant:d="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:p="226",colorForTitleMessage:m="var(--status-button-bg-warning)",footerContent:v,firstButtonDisabled:g=!1,secondButtonDisabled:y=!1,zIndex:_=1100,iconSize:b=94})=>e(hJ,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:_,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(lF,{name:l,className:"warning_modal_icon",width:b,height:b}),n("div",{className:"warning_modal_message",children:[n(cF,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(cF,{color:`${m}`,fontSize:20,fontWeight:"semi-bold",children:[" ",i," "]})," ",o]}),n("div",{className:"warning_modal_message_wrapper",children:[e(cF,{fontSize:16,children:c}),e(cF,{as:"div",children:v})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(sF,{buttonHeight:"24px",variant:"secondary",label:s,onClick:r,disabled:g}),u&&e(sF,{buttonHeight:"24px",variant:d||"warning",label:u,onClick:a,disabled:y})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function Ure(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(DU,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function Vre(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):Ure(e,t)}const Wre=({onSelectVariable:t,dropdownPosition:r,filteredOptions:a=[],position:i="relative",width:o="300px",zIndex:l=1e3,height:c="160px",truncateTextValue:s=34,isTruncateText:u=!1})=>n("div",{className:T("ff-variable-dropdown",i),style:r?{top:r.top+30,left:r.left-30,width:o,zIndex:l}:{width:o,zIndex:l,height:c},children:[a?.map(n=>{const r=u?AF(n?.name,s,"pixel"):n?.name,a=!!u&&xF(n?.name,s,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:u?e(pF,{title:a?n?.name:"",children:e(cF,{children:r})}):e(cF,{children:r})},n?.id)}),0===a?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(cF,{as:"span",fontSize:14,children:"No Option"})})]}),Qre=i(({label:t="",hashInputValue:r="",setHashInputValue:a,variableList:i=[],addForloopPrefix:c=!1,placeholder:u="Enter text",onChange:d,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:m=!1,dataFiles:v=[],showAddVariableIcon:g=!0,helperText:_="",error:b,autoComplete:w="off",showHidePasswordIcon:E=!0,required:A=!1,formProps:x={},onlyDropdown:C=!1,type:k,onFocus:M,onBlur:z,readOnly:S=!1,height:O="160px",truncateTextValue:I=34,isTruncateText:N=!1,...j},T)=>{const[D,L]=s(!1),[P,R]=s(!1),[H,B]=s(!1),[q,F]=s(null),[U,V]=s(0),[W,Q]=s(!1),[G,Y]=s(!1),[K,Z]=s([]),X=o(null);y(T,()=>X.current),l(()=>{null!==q&&X.current&&(X.current.setSelectionRange(q,q),X.current.focus())},[q]),l(()=>{if(m?L(h.startsWith("#")):Y(!h?.includes("$")),h.startsWith("#")&&m){const e=h.slice(1).toLowerCase(),t=v.filter(t=>t.name.toLowerCase().includes(e));Z(t),L(!0)}},[h]),l(()=>{if(!W&&C){const e=v.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));Z(e),L(e.length>0)}Q(!1)},[h]);const J=()=>{X.current&&V(X.current.selectionStart||0)},$=J,ee=J;l(()=>{X.current&&V(X.current.selectionStart||0)},[h]);const te=e=>{if(X.current){const{selectionStart:t,selectionEnd:n}=X.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.includes("PARAMETER")?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`;let i;if(i=m&&"#"===h[0]||C?e.name+h.slice(n||1):h.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(h,U)||0)+"$"+r+h.slice(n||0),d){d({target:{value:i}},e)}X.current.value=i,a?.(e),F((t||0)+r.length),L(!1),Q(!0),R(!0)}};const ne=function(e,t,n){let r=!1,a="";const i="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:a};const o=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==o&&(t===o+1?(r=!0,a=""):(a=e.slice(o+1,-1===l?void 0:l),t>o+1&&(a=e.slice(o+1,t)),r=!0),P&&i&&(r=!1),(/[{}]/.test(a)||0===t)&&(r=!1,a=""),a)){n.some(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(a.toLowerCase()))||(r=!1,a="")}return{showDropdown:r,searchString:a}}(h,U,i),[re,ae]=s(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(bV,{readOnly:S,...j,name:"add_variable",ref:X,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,re),value:h,onChange:d,variant:"primary",label:t,placeholder:u,onClick:$,onKeyUp:ee,onFocus:e=>{setTimeout(()=>{B(!0),M?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||B(!1)})(e),z?.(e)},autoComplete:w,helperText:_,error:b,required:A,...x}),"password"===k&&E&&e(pF,{title:re?"Hide":"Show",children:e(cF,{as:"span",className:"ff-password-icon",children:e(lF,{onClick:()=>{ae(e=>!e)},name:re?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!hF(h)&&!m&&G&&g&&e(pF,{title:"Add Variable",children:e(lF,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ne?.showDropdown&&H&&e(xee,{position:"absolute",width:p,optionsList:i.filter(e=>("_startforloop"===e.type&&c?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ne?.searchString.toLowerCase())),onSelectVariable:te,height:O}),D&&(m||C)&&e(Wre,{position:"relative",width:p,filteredOptions:K,zIndex:2e3,onSelectVariable:te,height:O,isTruncateText:N,truncateTextValue:I})]})}),Gre=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var Yre,Kre;var Zre=(Kre||(Kre=1,Yre=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=a},function(e,t,n){var r;
|
|
29
29
|
/*!
|
|
30
30
|
Copyright (c) 2017 Jed Watson.
|
|
31
31
|
Licensed under the MIT License (MIT), see
|