tp-react-elements-dev 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -43471,7 +43471,7 @@ var functionPlugin = function functionPlugin() {
43471
43471
  };
43472
43472
  };
43473
43473
 
43474
- var at = '@global';
43474
+ var at$1 = '@global';
43475
43475
  var atPrefix = '@global ';
43476
43476
 
43477
43477
  var GlobalContainerRule =
@@ -43479,7 +43479,7 @@ var GlobalContainerRule =
43479
43479
  function () {
43480
43480
  function GlobalContainerRule(key, styles, options) {
43481
43481
  this.type = 'global';
43482
- this.at = at;
43482
+ this.at = at$1;
43483
43483
  this.isProcessed = false;
43484
43484
  this.key = key;
43485
43485
  this.options = options;
@@ -43548,7 +43548,7 @@ var GlobalPrefixedRule =
43548
43548
  function () {
43549
43549
  function GlobalPrefixedRule(key, style, options) {
43550
43550
  this.type = 'global';
43551
- this.at = at;
43551
+ this.at = at$1;
43552
43552
  this.isProcessed = false;
43553
43553
  this.key = key;
43554
43554
  this.options = options;
@@ -43584,7 +43584,7 @@ function addScope(selector, scope) {
43584
43584
  function handleNestedGlobalContainerRule(rule, sheet) {
43585
43585
  var options = rule.options,
43586
43586
  style = rule.style;
43587
- var rules = style ? style[at] : null;
43587
+ var rules = style ? style[at$1] : null;
43588
43588
  if (!rules) return;
43589
43589
 
43590
43590
  for (var name in rules) {
@@ -43593,7 +43593,7 @@ function handleNestedGlobalContainerRule(rule, sheet) {
43593
43593
  }));
43594
43594
  }
43595
43595
 
43596
- delete style[at];
43596
+ delete style[at$1];
43597
43597
  }
43598
43598
 
43599
43599
  function handlePrefixedGlobalRule(rule, sheet) {
@@ -43601,8 +43601,8 @@ function handlePrefixedGlobalRule(rule, sheet) {
43601
43601
  style = rule.style;
43602
43602
 
43603
43603
  for (var prop in style) {
43604
- if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
43605
- var selector = addScope(prop.substr(at.length), rule.selector);
43604
+ if (prop[0] !== '@' || prop.substr(0, at$1.length) !== at$1) continue;
43605
+ var selector = addScope(prop.substr(at$1.length), rule.selector);
43606
43606
  sheet.addRule(selector, style[prop], _extends$1({}, options, {
43607
43607
  selector: selector
43608
43608
  }));
@@ -43618,7 +43618,7 @@ function jssGlobal() {
43618
43618
  function onCreateRule(name, styles, options) {
43619
43619
  if (!name) return null;
43620
43620
 
43621
- if (name === at) {
43621
+ if (name === at$1) {
43622
43622
  return new GlobalContainerRule(name, styles, options);
43623
43623
  }
43624
43624
 
@@ -53677,7 +53677,68 @@ const DeleteField = ({ onClickFn, tooltip = "Delete", text }) => {
53677
53677
  }, text: text })] }));
53678
53678
  };
53679
53679
 
53680
+ var Et=Object.create;var Ye=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var Lt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Pt=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of gt(e))!wt.call(n,o)&&o!==r&&Ye(n,o,{get:()=>e[o],enumerable:!(i=bt(e,o))||i.enumerable});return n};var St=(n,e,r)=>(r=n!=null?Et(yt(n)):{},Pt(!n||!n.__esModule?Ye(r,"default",{value:n,enumerable:!0}):r,n));var je=Lt((he,Je)=>{(function(n,e){typeof he=="object"&&typeof Je<"u"?e(he):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.fastUniqueNumbers={}));})(he,function(n){var e=function(l){return function(p){var f=l(p);return p.add(f),f}},r=function(l){return function(p,f){return l.set(p,f),f}},i=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=o*2,g=function(l,p){return function(f){var B=p.get(f),y=B===void 0?f.size:B<u?B+1:0;if(!f.has(y))return l(f,y);if(f.size<o){for(;f.has(y);)y=Math.floor(Math.random()*u);return l(f,y)}if(f.size>i)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;f.has(y);)y=Math.floor(Math.random()*i);return l(f,y)}},O=new WeakMap,W=r(O),m=g(W,O),a=e(m);n.addUniqueNumber=a,n.generateUniqueNumber=m;});});St(je());var M=(typeof window>"u"?"undefined":typeof window)=="object";var I={setTimeout:M?setTimeout.bind(window):setTimeout,clearTimeout:M?clearTimeout.bind(window):clearTimeout,setInterval:M?setInterval.bind(window):setInterval,clearInterval:M?clearInterval.bind(window):clearInterval};function it(n){I.setTimeout=n.setTimeout,I.clearTimeout=n.clearTimeout,I.setInterval=n.setInterval,I.clearInterval=n.clearInterval;}var Q={},Ae=class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,Q[e]=Q[e]||[],Q[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener("storage",this.onStorage);}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||e.newValue===null)return;let r=JSON.parse(e.newValue);this.mc.port2.postMessage(r);}postMessage(e){if(this.closed)throw new Error("InvalidStateError");let r=JSON.stringify(e),i=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(i,r),I.setTimeout(()=>{window.localStorage.removeItem(i);},500),Q[this.name].forEach(o=>{o!==this&&o.mc.port2.postMessage(JSON.parse(r));});}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener("storage",this.onStorage);let e=Q[this.name].indexOf(this);Q[this.name].splice(e,1);}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e;}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e;}addEventListener(e,r){return this.mc.port1.addEventListener(e,r)}removeEventListener(e,r){return this.mc.port1.removeEventListener(e,r)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},st=typeof window>"u"?void 0:typeof window.BroadcastChannel=="function"?window.BroadcastChannel:Ae;function ot(n=0){return new Promise(e=>I.setTimeout(e,n))}function Te(){return Math.random().toString(36).substring(2)}var Ie=class{options;channel;token=Te();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,r){this.channel=e,this.options=r,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this);}async apply(){if(this.isLeader||this.isDead)return !1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,r=i=>{let{token:o,action:u}=i.data;o!==this.token&&(u===0&&o>this.token&&(e=!0),u===1&&(e=!0));};this.channel.addEventListener("message",r);try{return this.sendAction(0),await ot(this.options.responseTime),this.channel.removeEventListener("message",r),this.isApplying=!1,e?this.reApply?this.apply():!1:(this.assumeLead(),!0)}catch{return !1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,r=null;return new Promise(i=>{let o=()=>{if(e)return;e=!0;try{I.clearInterval(r);}catch{}let g=this.intervals.indexOf(r);g>=0&&this.intervals.splice(g,1),this.channel.removeEventListener("message",u),i();};r=I.setInterval(()=>{this.apply().then(()=>{this.isLeader&&o();});},this.options.fallbackInterval),this.intervals.push(r);let u=g=>{let{action:O}=g.data;O===2&&this.apply().then(()=>{this.isLeader&&o();});};this.channel.addEventListener("message",u);})}sendAction(e){this.channel.postMessage({action:e,token:this.token});}assumeLead(){this.isLeader=!0;let e=r=>{let{action:i}=r.data;i===0&&this.sendAction(1);};return this.channel.addEventListener("message",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred?this.deferred:(this.deferred=this.awaitLeadership(),this.deferred)}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener("message",e)),this.intervals.forEach(e=>I.clearInterval(e));}catch{}}}};var Ee=class{channel;options;elector;token=Te();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:r}=e;if(this.options=e,this.channel=new st(r),this.registry.set(this.token,1),e.leaderElection){let i={fallbackInterval:2e3,responseTime:100};this.elector=new Ie(this.channel,i),this.elector.waitForLeadership();}this.channel.addEventListener("message",i=>{let{action:o,token:u,data:g}=i.data;switch(o){case 3:this.registry.set(u,2);break;case 4:this.registry.delete(u);break;case 5:this.idle(u);break;case 6:this.active(u);break;case 7:this.prompt(u);break;case 8:this.start(u);break;case 9:this.reset(u);break;case 10:this.activate(u);break;case 11:this.pause(u);break;case 12:this.resume(u);break;case 13:this.options.onMessage(g);break}}),this.send(3);}get isLeader(){if(!this.elector)throw new Error('\u274C Leader election is not enabled. To Enable it set the "leaderElection" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let r=[...this.registry.values()].every(i=>i===0);e===this.token&&this.send(7),r&&this.options.onPrompt();}idle(e=this.token){this.registry.set(e,2);let r=[...this.registry.values()].every(i=>i===2);e===this.token&&this.send(5),!this.allIdle&&r&&(this.allIdle=!0,this.options.onIdle());}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let r=[...this.registry.values()].some(i=>i===1);e===this.token&&this.send(6),r&&this.options.onActive(),this.isLastActive=e===this.token;}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token;}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token;}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token;}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0);}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0);}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e});}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token});}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close();}};var at=M?document:null,xe=["mousemove","keydown","wheel","DOMMouseScroll","mousewheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange","focus"];function ct(n,e){let r;function i(...o){r&&clearTimeout(r),r=setTimeout(()=>{n(...o),r=null;},e);}return i.cancel=function(){clearTimeout(r);},i}function be(n,e){let r=0;return function(...i){let o=new Date().getTime();if(!(o-r<e))return r=o,n(...i)}}var v=()=>Date.now();var Z=2147483647;function se({timeout:n=1e3*60*20,promptTimeout:e=0,promptBeforeIdle:r=0,element:i=at,events:o=xe,timers:u=void 0,immediateEvents:g=[],onPresenceChange:O=()=>{},onPrompt:W=()=>{},onIdle:m=()=>{},onActive:a=()=>{},onAction:d=()=>{},onMessage:l=()=>{},debounce:p=0,throttle:f=0,eventsThrottle:B=200,startOnMount:y=!0,startManually:D=!1,stopOnIdle:ce=!1,crossTab:j=!1,name:Oe="idle-timer",syncTimers:ee=0,leaderElection:Ce=!1,disabled:C=!1}={}){let De=React$1.useRef(v()),ue=React$1.useRef(v()),w=React$1.useRef(null),R=React$1.useRef(null),F=React$1.useRef(0),te=React$1.useRef(0),N=React$1.useRef(0),S=React$1.useRef(0),h=React$1.useRef(!1),E=React$1.useRef(!1),H=React$1.useRef(!1),_=React$1.useRef(!0),re=React$1.useRef(!1),U=React$1.useRef(null),s=React$1.useRef(null),k=React$1.useRef(n),G=React$1.useRef(0);React$1.useEffect(()=>{if(e&&console.warn("\u26A0\uFE0F IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."),r&&e)throw new Error("\u274C Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");if(n>=Z)throw new Error(`\u274C The value for the timeout property must fit in a 32 bit signed integer, ${Z}.`);if(e>=Z)throw new Error(`\u274C The value for the promptTimeout property must fit in a 32 bit signed integer, ${Z}.`);if(r>=Z)throw new Error(`\u274C The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ${Z}.`);if(r>=n)throw new Error(`\u274C The value for the promptBeforeIdle property must be less than the timeout property, ${n}.`);if(r?(k.current=n-r,G.current=r):(k.current=n,G.current=e),!_.current){if(D||C)return;h.current&&(X.current(null,L),s.current&&s.current.active()),J();}},[n,e,r,D,C]);let Ne=React$1.useRef(ce);React$1.useEffect(()=>{Ne.current=ce;},[ce]);let He=React$1.useRef(g),ne=React$1.useRef(i),ye=React$1.useRef([...new Set([...o,...g]).values()]),A=React$1.useRef(C);React$1.useEffect(()=>{A.current=C,!_.current&&(C?fe():D||J());},[C]);let ie=React$1.useRef(O);React$1.useEffect(()=>{ie.current=O;},[O]);let le=React$1.useRef(W);React$1.useEffect(()=>{le.current=W;},[W]);let me=React$1.useRef(m);React$1.useEffect(()=>{me.current=m;},[m]);let X=React$1.useRef(a);React$1.useEffect(()=>{X.current=a;},[a]);let de=React$1.useRef(d);React$1.useEffect(()=>{de.current=d;},[d]);let z=React$1.useRef(l);React$1.useEffect(()=>{z.current=l;},[l]);let q=React$1.useMemo(()=>{let t=(P,K)=>de.current(P,K);return p>0?ct(t,p):f>0?be(t,f):t},[f,p]),_e=React$1.useRef();React$1.useEffect(()=>{j&&ee&&(_e.current=be(()=>{s.current.active();},ee));},[j,ee]);let x=()=>{U.current!==null&&(I.clearTimeout(U.current),U.current=null);},$=(t,P=!0)=>{x(),U.current=I.setTimeout(Le,t||k.current),P&&(R.current=v());},Ue=t=>{!E.current&&!h.current&&(le.current(t,L),ie.current({type:"active",prompted:!0},L)),S.current=0,N.current=v(),E.current=!0,$(G.current,!1);},Fe=()=>{x(),h.current||(me.current(null,L),ie.current({type:"idle"},L)),h.current=!0,w.current=v(),Ne.current?Y():E.current&&(N.current=0,E.current=!1);},we=t=>{x(),(h.current||E.current)&&(X.current(t,L),ie.current({type:"active",prompted:!1},L)),E.current=!1,N.current=0,h.current=!1,F.current+=v()-w.current,te.current+=v()-w.current,V(),$();},Le=t=>{if(!h.current){q.cancel&&q.cancel();let K=v()-R.current;if(!(k.current+G.current<K)&&G.current>0&&!E.current){s.current?s.current.prompt():Ue(t);return}s.current?s.current.idle():Fe();return}s.current?s.current.active():we(t);},Pe=t=>{if(!y&&!R.current&&(R.current=v(),X.current(null,L)),q(t,L),E.current)return;if(x(),!h.current&&He.current.includes(t.type)){Le(t);return}let P=v()-R.current;if(h.current&&!ce||!h.current&&P>=k.current){Le(t);return}H.current=!1,S.current=0,N.current=0,$(),j&&ee&&_e.current();},pe=React$1.useRef(Pe);React$1.useEffect(()=>{let t=re.current;t&&Y(),B>0?pe.current=be(Pe,B):pe.current=Pe,t&&V();},[B,f,p,de,j,ee]);let V=()=>{M&&ne.current&&(re.current||(ye.current.forEach(t=>{ne.current.addEventListener(t,pe.current,{capture:!0,passive:!0});}),re.current=!0));},Y=(t=!1)=>{M&&ne.current&&(re.current||t)&&(ye.current.forEach(P=>{ne.current.removeEventListener(P,pe.current,{capture:!0});}),re.current=!1);},J=React$1.useCallback(t=>A.current?!1:(x(),V(),h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,s.current&&!t&&s.current.start(),$(),!0),[U,h,A,k,s]),Se=React$1.useCallback(t=>A.current?!1:(x(),V(),ue.current=v(),F.current+=v()-w.current,te.current+=v()-w.current,F.current=0,h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,s.current&&!t&&s.current.reset(),D||$(),!0),[U,h,k,D,A,s]),Ve=React$1.useCallback(t=>A.current?!1:(x(),V(),(h.current||E.current)&&we(),h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,ue.current=v(),s.current&&!t&&s.current.activate(),$(),!0),[U,h,E,A,k,s]),fe=React$1.useCallback((t=!1)=>A.current||H.current?!1:(S.current=We(),H.current=!0,Y(),x(),s.current&&!t&&s.current.pause(),!0),[U,A,s]),Me=React$1.useCallback((t=!1)=>A.current||!H.current?!1:(H.current=!1,E.current||V(),h.current||$(S.current),N.current&&(N.current=v()),s.current&&!t&&s.current.resume(),!0),[U,k,A,S,s]),ut=React$1.useCallback((t,P)=>(s.current?(P&&z.current(t,L),s.current.message(t)):P&&z.current(t,L),!0),[l]),lt=React$1.useCallback(()=>h.current,[h]),mt=React$1.useCallback(()=>E.current,[E]),dt=React$1.useCallback(()=>s.current?s.current.isLeader:null,[s]),pt=React$1.useCallback(()=>s.current?s.current.isLastActive:null,[s]),ft=React$1.useCallback(()=>s.current?s.current.token:null,[s]),We=React$1.useCallback(()=>{if(H.current)return S.current;let t=S.current?S.current:G.current+k.current,P=R.current?v()-R.current:0,K=Math.floor(t-P);return K<0?0:Math.abs(K)},[k,G,E,S,R]),Be=React$1.useCallback(()=>Math.round(v()-ue.current),[ue]),Ge=React$1.useCallback(()=>Math.round(v()-De.current),[De]),ht=React$1.useCallback(()=>w.current?new Date(w.current):null,[w]),vt=React$1.useCallback(()=>R.current?new Date(R.current):null,[R]),qe=React$1.useCallback(()=>h.current?Math.round(v()-w.current+F.current):Math.round(F.current),[w,F]),$e=React$1.useCallback(()=>h.current?Math.round(v()-w.current+te.current):Math.round(te.current),[w,te]),Tt=React$1.useCallback(()=>{let t=Math.round(Be()-qe());return t>=0?t:0},[w,F]),It=React$1.useCallback(()=>{let t=Math.round(Ge()-$e());return t>=0?t:0},[w,F]);React$1.useEffect(()=>{if(p>0&&f>0)throw new Error("\u274C onAction can either be throttled or debounced, not both.");u&&it(u);let t=()=>{s.current&&s.current.close(),q.cancel&&q.cancel(),x(),Y(!0);};return M&&window.addEventListener("beforeunload",t),()=>{M&&window.removeEventListener("beforeunload",t),s.current&&s.current.close(),q.cancel&&q.cancel(),x(),Y(!0);}},[]),React$1.useEffect(()=>{s.current&&s.current.close(),j?s.current=new Ee({channelName:Oe,leaderElection:Ce,onPrompt:()=>{Ue();},onIdle:()=>{Fe();},onActive:()=>{we();},onMessage:t=>{z.current(t,L);},start:J,reset:Se,activate:Ve,pause:fe,resume:Me}):s.current=null;},[j,Oe,Ce,le,me,X,z,J,Se,fe,Me]),React$1.useEffect(()=>{_.current||(x(),Y(!0)),!(D||C)&&(y?J():V());},[D,y,C,_]),React$1.useEffect(()=>{if(!_.current){let t=[...new Set([...o,...g]).values()];if(Y(),ye.current=t,ne.current=i,He.current=g,D||C)return;y?J():V();}},[i,JSON.stringify(o),JSON.stringify(g),_,C,D,y]),React$1.useEffect(()=>{_.current&&(_.current=!1);},[_]);let L={message:ut,start:J,reset:Se,activate:Ve,pause:fe,resume:Me,isIdle:lt,isPrompted:mt,isLeader:dt,isLastActiveTab:pt,getTabId:ft,getRemainingTime:We,getElapsedTime:Be,getTotalElapsedTime:Ge,getLastIdleTime:ht,getLastActiveTime:vt,getIdleTime:qe,getTotalIdleTime:$e,getActiveTime:Tt,getTotalActiveTime:It,setOnPresenceChange:t=>{O=t,ie.current=t;},setOnPrompt:t=>{W=t,le.current=t;},setOnIdle:t=>{m=t,me.current=t;},setOnActive:t=>{a=t,X.current=t;},setOnAction:t=>{d=t,de.current=t;},setOnMessage:t=>{l=t,z.current=t;}};return L}var ge=React$1.createContext(null);ge.Consumer;
53681
+
53682
+ const secondsToMMSS = (totalSeconds) => {
53683
+ const minutes = Math.floor(totalSeconds / 60);
53684
+ const seconds = Math.floor(totalSeconds % 60);
53685
+ const formattedMinutes = String(minutes).padStart(2, "0");
53686
+ const formattedSeconds = String(seconds).padStart(2, "0");
53687
+ return `${formattedMinutes}:${formattedSeconds}`;
53688
+ };
53689
+ const promptBeforeValue = 120000;
53690
+ const SessionTimeOut = ({ sessionTime, handleSubmitSession, onSessionExpire, }) => {
53691
+ const [openConfirmModal, setOpenConfirmModal] = React$1.useState(false);
53692
+ const expiryDetails = sessionTime;
53693
+ const providedTimestamp = new Date(expiryDetails).getTime();
53694
+ const currentTimestamp = new Date().getTime();
53695
+ const remainingTime = providedTimestamp - currentTimestamp;
53696
+ const timeout = remainingTime;
53697
+ const promptBeforeIdle = Math.min(promptBeforeValue, timeout - 1000);
53698
+ const [remainingTimeInSeconds, setRemainingTimeInSeconds] = React$1.useState(0); // Initialize remaining time in seconds
53699
+ const [formattedRemainingTime, setFormattedRemainingTime] = React$1.useState("");
53700
+ const onIdle = () => {
53701
+ if (sessionTime) {
53702
+ onSessionExpire();
53703
+ }
53704
+ };
53705
+ const onActive = () => {
53706
+ setOpenConfirmModal(false);
53707
+ };
53708
+ const handleSubmit = () => {
53709
+ handleSubmitSession();
53710
+ };
53711
+ const handleCancel = () => {
53712
+ setOpenConfirmModal(false);
53713
+ };
53714
+ const onPrompt = () => {
53715
+ setOpenConfirmModal(true);
53716
+ };
53717
+ const { getRemainingTime, activate } = se({
53718
+ onIdle,
53719
+ onPrompt,
53720
+ onActive,
53721
+ promptBeforeIdle,
53722
+ timeout,
53723
+ throttle: 400,
53724
+ });
53725
+ React$1.useEffect(() => {
53726
+ const interval = setInterval(() => {
53727
+ const remainingSeconds = Math.ceil(getRemainingTime() / 1000);
53728
+ setRemainingTimeInSeconds(promptBeforeIdle !== promptBeforeValue ? remainingSeconds : 0);
53729
+ const formattedTime = secondsToMMSS(remainingSeconds);
53730
+ setFormattedRemainingTime(promptBeforeIdle !== promptBeforeValue ? formattedTime : "0");
53731
+ }, 500);
53732
+ return () => {
53733
+ clearInterval(interval);
53734
+ };
53735
+ }, [promptBeforeIdle]);
53736
+ const sessionMessage = `Your session will expire in ${formattedRemainingTime} seconds. Do you want to extend the session?`;
53737
+ return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [" ", jsxRuntimeExports.jsx(ConfirmationDialog, { openConfirmDialog: openConfirmModal, handleCancel: handleCancel, onClickSubmit: () => handleSubmit(), text: sessionMessage })] }));
53738
+ };
53739
+
53680
53740
  exports.DeleteField = DeleteField;
53681
53741
  exports.RenderForm = FormRenderWrapper;
53742
+ exports.SessionTimeoutField = SessionTimeOut;
53682
53743
  exports.useFormValidatingContext = useFormValidatingContext;
53683
53744
  //# sourceMappingURL=index.js.map