@ambuj.bhaskar/react-component-library 0.24.11-alpha → 0.24.12-alpha
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.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -11
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -336,7 +336,7 @@ __p += '`),_1&&(It+=`' +
|
|
|
336
336
|
function print() { __p += __j.call(arguments, '') }
|
|
337
337
|
`:`;
|
|
338
338
|
`)+It+`return __p
|
|
339
|
-
}`;var i1=nv(function(){return h1(me,Ln+"return "+It).apply(n,Oe)});if(i1.source=It,hd(i1))throw i1;return i1}function PV(g){return z1(g).toLowerCase()}function NV(g){return z1(g).toUpperCase()}function TV(g,y,I){if(g=z1(g),g&&(I||y===n))return x9(g);if(!g||!(y=br(y)))return g;var Q=J0(g),te=J0(y),me=S2(Q,te),Oe=Ur(Q,te)+1;return ka(Q,me,Oe).join("")}function FV(g,y,I){if(g=z1(g),g&&(I||y===n))return g.slice(0,ti(g)+1);if(!g||!(y=br(y)))return g;var Q=J0(g),te=Ur(Q,J0(y))+1;return ka(Q,0,te).join("")}function VV(g,y,I){if(g=z1(g),g&&(I||y===n))return g.replace(pt,"");if(!g||!(y=br(y)))return g;var Q=J0(g),te=S2(Q,J0(y));return ka(Q,te).join("")}function jV(g,y){var I=D,Q=N;if(b0(y)){var te="separator"in y?y.separator:te;I="length"in y?r1(y.length):I,Q="omission"in y?br(y.omission):Q}g=z1(g);var me=g.length;if(Co(g)){var Oe=J0(g);me=Oe.length}if(I>=me)return g;var Pe=I-Z0(Q);if(Pe<1)return Q;var Ke=Oe?ka(Oe,0,Pe).join(""):g.slice(0,Pe);if(te===n)return Ke+Q;if(Oe&&(Pe+=Ke.length-Pe),Cd(te)){if(g.slice(Pe).search(te)){var St,Mt=Ke;for(te.global||(te=mo(te.source,z1(Et.exec(te))+"g")),te.lastIndex=0;St=te.exec(Mt);)var It=St.index;Ke=Ke.slice(0,It===n?Pe:It)}}else if(g.indexOf(br(te),Pe)!=Pe){var ln=Ke.lastIndexOf(te);ln>-1&&(Ke=Ke.slice(0,ln))}return Ke+Q}function zV(g){return g=z1(g),g&&Gt.test(g)?g.replace(an,ki):g}var ZV=N3(function(g,y,I){return g+(I?" ":"")+y.toUpperCase()}),pd=rA("toUpperCase");function tv(g,y,I){return g=z1(g),y=I?n:y,y===n?$r(g)?Di(g):Qo(g):g.match(y)||[]}var nv=d1(function(g,y){try{return s0(g,n,y)}catch(I){return hd(I)?I:new Un(I)}}),UV=Zi(function(g,y){return g0(y,function(I){I=li(I),ji(g,I,dd(g[I],g))}),g});function $V(g){var y=g==null?0:g.length,I=Vn();return g=y?G1(g,function(Q){if(typeof Q[1]!="function")throw new x0(a);return[I(Q[0]),Q[1]]}):[],d1(function(Q){for(var te=-1;++te<y;){var me=g[te];if(s0(me[0],this,Q))return s0(me[1],this,Q)}})}function KV(g){return pP(Xr(g,h))}function Ad(g){return function(){return g}}function WV(g,y){return g==null||g!==g?y:g}var QV=iA(),GV=iA(!0);function ar(g){return g}function vd(g){return Dp(typeof g=="function"?g:Xr(g,h))}function YV(g){return Np(Xr(g,h))}function qV(g,y){return Tp(g,Xr(y,h))}var XV=d1(function(g,y){return function(I){return f4(I,g,y)}}),JV=d1(function(g,y){return function(I){return f4(g,I,y)}});function bd(g,y,I){var Q=r2(y),te=Vl(y,Q);I==null&&!(b0(y)&&(te.length||!Q.length))&&(I=y,y=g,g=this,te=Vl(y,r2(y)));var me=!(b0(I)&&"chain"in I)||!!I.chain,Oe=$i(g);return g0(te,function(Pe){var Ke=y[Pe];g[Pe]=Ke,Oe&&(g.prototype[Pe]=function(){var St=this.__chain__;if(me||St){var Mt=g(this.__wrapped__),It=Mt.__actions__=rr(this.__actions__);return It.push({func:Ke,args:arguments,thisArg:g}),Mt.__chain__=St,Mt}return Ke.apply(g,d2([this.value()],arguments))})}),g}function ej(){return L0._===this&&(L0._=Ma),this}function yd(){}function tj(g){return g=r1(g),d1(function(y){return Fp(y,g)})}var nj=Xu(G1),rj=Xu(Zo),oj=Xu(Ko);function rv(g){return id(g)?Yo(li(g)):kP(g)}function ij(g){return function(y){return g==null?n:H9(g,y)}}var aj=sA(),sj=sA(!0);function wd(){return[]}function xd(){return!1}function lj(){return{}}function cj(){return""}function uj(){return!0}function dj(g,y){if(g=r1(g),g<1||g>K)return[];var I=U,Q=ie(g,U);y=Vn(y),g-=U;for(var te=w9(Q,y);++I<g;)y(I);return te}function fj(g){return Yn(g)?G1(g,li):yr(g)?[g]:rr(xA(z1(g)))}function hj(g){var y=++l4;return z1(g)+y}var Cj=Kl(function(g,y){return g+y},0),gj=Ju("ceil"),mj=Kl(function(g,y){return g/y},1),pj=Ju("floor");function Aj(g){return g&&g.length?Fl(g,ar,Tu):n}function vj(g,y){return g&&g.length?Fl(g,Vn(y,2),Tu):n}function bj(g){return Oi(g,ar)}function yj(g,y){return Oi(g,Vn(y,2))}function wj(g){return g&&g.length?Fl(g,ar,zu):n}function xj(g,y){return g&&g.length?Fl(g,Vn(y,2),zu):n}var _j=Kl(function(g,y){return g*y},1),Ej=Ju("round"),Sj=Kl(function(g,y){return g-y},0);function Mj(g){return g&&g.length?E2(g,ar):0}function Hj(g,y){return g&&g.length?E2(g,Vn(y,2)):0}return ce.after=YT,ce.ary=kA,ce.assign=NF,ce.assignIn=QA,ce.assignInWith=i6,ce.assignWith=TF,ce.at=FF,ce.before=DA,ce.bind=dd,ce.bindAll=UV,ce.bindKey=PA,ce.castArray=lF,ce.chain=OA,ce.chunk=pN,ce.compact=AN,ce.concat=vN,ce.cond=$V,ce.conforms=KV,ce.constant=Ad,ce.countBy=MT,ce.create=VF,ce.curry=NA,ce.curryRight=TA,ce.debounce=FA,ce.defaults=jF,ce.defaultsDeep=zF,ce.defer=qT,ce.delay=XT,ce.difference=bN,ce.differenceBy=yN,ce.differenceWith=wN,ce.drop=xN,ce.dropRight=_N,ce.dropRightWhile=EN,ce.dropWhile=SN,ce.fill=MN,ce.filter=LT,ce.flatMap=RT,ce.flatMapDeep=IT,ce.flatMapDepth=kT,ce.flatten=MA,ce.flattenDeep=HN,ce.flattenDepth=LN,ce.flip=JT,ce.flow=QV,ce.flowRight=GV,ce.fromPairs=BN,ce.functions=GF,ce.functionsIn=YF,ce.groupBy=DT,ce.initial=RN,ce.intersection=IN,ce.intersectionBy=kN,ce.intersectionWith=DN,ce.invert=XF,ce.invertBy=JF,ce.invokeMap=NT,ce.iteratee=vd,ce.keyBy=TT,ce.keys=r2,ce.keysIn=ir,ce.map=Jl,ce.mapKeys=tV,ce.mapValues=nV,ce.matches=YV,ce.matchesProperty=qV,ce.memoize=t6,ce.merge=rV,ce.mergeWith=GA,ce.method=XV,ce.methodOf=JV,ce.mixin=bd,ce.negate=n6,ce.nthArg=tj,ce.omit=oV,ce.omitBy=iV,ce.once=eF,ce.orderBy=FT,ce.over=nj,ce.overArgs=tF,ce.overEvery=rj,ce.overSome=oj,ce.partial=fd,ce.partialRight=VA,ce.partition=VT,ce.pick=aV,ce.pickBy=YA,ce.property=rv,ce.propertyOf=ij,ce.pull=FN,ce.pullAll=LA,ce.pullAllBy=VN,ce.pullAllWith=jN,ce.pullAt=zN,ce.range=aj,ce.rangeRight=sj,ce.rearg=nF,ce.reject=ZT,ce.remove=ZN,ce.rest=rF,ce.reverse=cd,ce.sampleSize=$T,ce.set=lV,ce.setWith=cV,ce.shuffle=KT,ce.slice=UN,ce.sortBy=GT,ce.sortedUniq=qN,ce.sortedUniqBy=XN,ce.split=RV,ce.spread=oF,ce.tail=JN,ce.take=eT,ce.takeRight=tT,ce.takeRightWhile=nT,ce.takeWhile=rT,ce.tap=AT,ce.throttle=iF,ce.thru=Xl,ce.toArray=$A,ce.toPairs=qA,ce.toPairsIn=XA,ce.toPath=fj,ce.toPlainObject=WA,ce.transform=uV,ce.unary=aF,ce.union=oT,ce.unionBy=iT,ce.unionWith=aT,ce.uniq=sT,ce.uniqBy=lT,ce.uniqWith=cT,ce.unset=dV,ce.unzip=ud,ce.unzipWith=BA,ce.update=fV,ce.updateWith=hV,ce.values=V3,ce.valuesIn=CV,ce.without=uT,ce.words=tv,ce.wrap=sF,ce.xor=dT,ce.xorBy=fT,ce.xorWith=hT,ce.zip=CT,ce.zipObject=gT,ce.zipObjectDeep=mT,ce.zipWith=pT,ce.entries=qA,ce.entriesIn=XA,ce.extend=QA,ce.extendWith=i6,bd(ce,ce),ce.add=Cj,ce.attempt=nv,ce.camelCase=AV,ce.capitalize=JA,ce.ceil=gj,ce.clamp=gV,ce.clone=cF,ce.cloneDeep=dF,ce.cloneDeepWith=fF,ce.cloneWith=uF,ce.conformsTo=hF,ce.deburr=ev,ce.defaultTo=WV,ce.divide=mj,ce.endsWith=vV,ce.eq=xo,ce.escape=bV,ce.escapeRegExp=yV,ce.every=HT,ce.find=BT,ce.findIndex=EA,ce.findKey=ZF,ce.findLast=OT,ce.findLastIndex=SA,ce.findLastKey=UF,ce.floor=pj,ce.forEach=RA,ce.forEachRight=IA,ce.forIn=$F,ce.forInRight=KF,ce.forOwn=WF,ce.forOwnRight=QF,ce.get=gd,ce.gt=CF,ce.gte=gF,ce.has=qF,ce.hasIn=md,ce.head=HA,ce.identity=ar,ce.includes=PT,ce.indexOf=ON,ce.inRange=mV,ce.invoke=eV,ce.isArguments=O9,ce.isArray=Yn,ce.isArrayBuffer=mF,ce.isArrayLike=or,ce.isArrayLikeObject=O0,ce.isBoolean=pF,ce.isBuffer=Da,ce.isDate=AF,ce.isElement=vF,ce.isEmpty=bF,ce.isEqual=yF,ce.isEqualWith=wF,ce.isError=hd,ce.isFinite=xF,ce.isFunction=$i,ce.isInteger=jA,ce.isLength=r6,ce.isMap=zA,ce.isMatch=_F,ce.isMatchWith=EF,ce.isNaN=SF,ce.isNative=MF,ce.isNil=LF,ce.isNull=HF,ce.isNumber=ZA,ce.isObject=b0,ce.isObjectLike=E0,ce.isPlainObject=A4,ce.isRegExp=Cd,ce.isSafeInteger=BF,ce.isSet=UA,ce.isString=o6,ce.isSymbol=yr,ce.isTypedArray=F3,ce.isUndefined=OF,ce.isWeakMap=RF,ce.isWeakSet=IF,ce.join=PN,ce.kebabCase=wV,ce.last=eo,ce.lastIndexOf=NN,ce.lowerCase=xV,ce.lowerFirst=_V,ce.lt=kF,ce.lte=DF,ce.max=Aj,ce.maxBy=vj,ce.mean=bj,ce.meanBy=yj,ce.min=wj,ce.minBy=xj,ce.stubArray=wd,ce.stubFalse=xd,ce.stubObject=lj,ce.stubString=cj,ce.stubTrue=uj,ce.multiply=_j,ce.nth=TN,ce.noConflict=ej,ce.noop=yd,ce.now=e6,ce.pad=EV,ce.padEnd=SV,ce.padStart=MV,ce.parseInt=HV,ce.random=pV,ce.reduce=jT,ce.reduceRight=zT,ce.repeat=LV,ce.replace=BV,ce.result=sV,ce.round=Ej,ce.runInContext=Ze,ce.sample=UT,ce.size=WT,ce.snakeCase=OV,ce.some=QT,ce.sortedIndex=$N,ce.sortedIndexBy=KN,ce.sortedIndexOf=WN,ce.sortedLastIndex=QN,ce.sortedLastIndexBy=GN,ce.sortedLastIndexOf=YN,ce.startCase=IV,ce.startsWith=kV,ce.subtract=Sj,ce.sum=Mj,ce.sumBy=Hj,ce.template=DV,ce.times=dj,ce.toFinite=Ki,ce.toInteger=r1,ce.toLength=KA,ce.toLower=PV,ce.toNumber=to,ce.toSafeInteger=PF,ce.toString=z1,ce.toUpper=NV,ce.trim=TV,ce.trimEnd=FV,ce.trimStart=VV,ce.truncate=jV,ce.unescape=zV,ce.uniqueId=hj,ce.upperCase=ZV,ce.upperFirst=pd,ce.each=RA,ce.eachRight=IA,ce.first=HA,bd(ce,function(){var g={};return ai(ce,function(y,I){u1.call(ce.prototype,I)||(g[I]=y)}),g}(),{chain:!1}),ce.VERSION=r,g0(["bind","bindKey","curry","curryRight","partial","partialRight"],function(g){ce[g].placeholder=ce}),g0(["drop","take"],function(g,y){rn.prototype[g]=function(I){I=I===n?1:X(r1(I),0);var Q=this.__filtered__&&!y?new rn(this):this.clone();return Q.__filtered__?Q.__takeCount__=ie(I,Q.__takeCount__):Q.__views__.push({size:ie(I,U),type:g+(Q.__dir__<0?"Right":"")}),Q},rn.prototype[g+"Right"]=function(I){return this.reverse()[g](I).reverse()}}),g0(["filter","map","takeWhile"],function(g,y){var I=y+1,Q=I==j||I==T;rn.prototype[g]=function(te){var me=this.clone();return me.__iteratees__.push({iteratee:Vn(te,3),type:I}),me.__filtered__=me.__filtered__||Q,me}}),g0(["head","last"],function(g,y){var I="take"+(y?"Right":"");rn.prototype[g]=function(){return this[I](1).value()[0]}}),g0(["initial","tail"],function(g,y){var I="drop"+(y?"":"Right");rn.prototype[g]=function(){return this.__filtered__?new rn(this):this[I](1)}}),rn.prototype.compact=function(){return this.filter(ar)},rn.prototype.find=function(g){return this.filter(g).head()},rn.prototype.findLast=function(g){return this.reverse().find(g)},rn.prototype.invokeMap=d1(function(g,y){return typeof g=="function"?new rn(this):this.map(function(I){return f4(I,g,y)})}),rn.prototype.reject=function(g){return this.filter(n6(Vn(g)))},rn.prototype.slice=function(g,y){g=r1(g);var I=this;return I.__filtered__&&(g>0||y<0)?new rn(I):(g<0?I=I.takeRight(-g):g&&(I=I.drop(g)),y!==n&&(y=r1(y),I=y<0?I.dropRight(-y):I.take(y-g)),I)},rn.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},rn.prototype.toArray=function(){return this.take(U)},ai(rn.prototype,function(g,y){var I=/^(?:filter|find|map|reject)|While$/.test(y),Q=/^(?:head|last)$/.test(y),te=ce[Q?"take"+(y=="last"?"Right":""):y],me=Q||/^find/.test(y);te&&(ce.prototype[y]=function(){var Oe=this.__wrapped__,Pe=Q?[1]:arguments,Ke=Oe instanceof rn,St=Pe[0],Mt=Ke||Yn(Oe),It=function(p1){var _1=te.apply(ce,d2([p1],Pe));return Q&&ln?_1[0]:_1};Mt&&I&&typeof St=="function"&&St.length!=1&&(Ke=Mt=!1);var ln=this.__chain__,Ln=!!this.__actions__.length,zn=me&&!ln,i1=Ke&&!Ln;if(!me&&Mt){Oe=i1?Oe:new rn(this);var Zn=g.apply(Oe,Pe);return Zn.__actions__.push({func:Xl,args:[It],thisArg:n}),new m1(Zn,ln)}return zn&&i1?g.apply(this,Pe):(Zn=this.thru(It),zn?Q?Zn.value()[0]:Zn.value():Zn)})}),g0(["pop","push","shift","sort","splice","unshift"],function(g){var y=po[g],I=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",Q=/^(?:pop|shift)$/.test(g);ce.prototype[g]=function(){var te=arguments;if(Q&&!this.__chain__){var me=this.value();return y.apply(Yn(me)?me:[],te)}return this[I](function(Oe){return y.apply(Yn(Oe)?Oe:[],te)})}}),ai(rn.prototype,function(g,y){var I=ce[y];if(I){var Q=I.name+"";u1.call(Te,Q)||(Te[Q]=[]),Te[Q].push({name:y,func:I})}}),Te[$l(n,_).name]=[{name:"wrapper",func:n}],rn.prototype.clone=_0,rn.prototype.reverse=t2,rn.prototype.value=j2,ce.prototype.at=vT,ce.prototype.chain=bT,ce.prototype.commit=yT,ce.prototype.next=wT,ce.prototype.plant=_T,ce.prototype.reverse=ET,ce.prototype.toJSON=ce.prototype.valueOf=ce.prototype.value=ST,ce.prototype.first=ce.prototype.head,Gr&&(ce.prototype[Gr]=xT),ce},F2=ni();w2?((w2.exports=F2)._=F2,u2._=F2):L0._=F2}).call(aae)}(W4,W4.exports)),W4.exports}var cl=sae();const bi=uo(cl),Fd="/not_available.svg",lae="/big_size_image.svg",Vd="/user.png",ZM={HARDCODED_FALL_BACK_IMAGE:Fd,HARDCODED_FALL_BACK_BIG_IMAGE:lae,DEFAULT_AVATAR_IMAGE:Vd,generateImageUrl:(e,t=!1)=>e||Fd,getImageKitUrl:(e,t=300,n=300,r=40)=>e||Fd,getUserAvatar:e=>{var t;return!e||!((t=e.awi_personal_info)!=null&&t.awi_avatar)?Vd:e.awi_personal_info.awi_avatar||Vd}};var U3=ug();const jd=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function zd(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function M4(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function UM(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function $M(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function cae(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let i=0;i<n.length;i++)r.indexOf(n[i])===-1&&(o=!1);return o}const Ms={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":jd?173:189,"=":jd?61:187,";":jd?59:186,"'":222,"[":219,"]":221,"\\":220},Io={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Q4={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},m2={16:!1,18:!1,17:!1,91:!1},y0={};for(let e=1;e<20;e++)Ms["f".concat(e)]=111+e;let p0=[],us=null,KM="all";const na=new Map,ul=e=>Ms[e.toLowerCase()]||Io[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),uae=e=>Object.keys(Ms).find(t=>Ms[t]===e),dae=e=>Object.keys(Io).find(t=>Io[t]===e);function WM(e){KM=e||"all"}function Hs(){return KM||"all"}function fae(){return p0.slice(0)}function hae(){return p0.map(e=>uae(e)||dae(e)||String.fromCharCode(e))}function Cae(){const e=[];return Object.keys(y0).forEach(t=>{y0[t].forEach(n=>{let{key:r,scope:o,mods:i,shortcut:a}=n;e.push({scope:o,shortcut:a,mods:i,keys:r.split("+").map(s=>ul(s))})})}),e}function gae(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function mae(e){return typeof e=="string"&&(e=ul(e)),p0.indexOf(e)!==-1}function pae(e,t){let n,r;e||(e=Hs());for(const o in y0)if(Object.prototype.hasOwnProperty.call(y0,o))for(n=y0[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(a=>{let{element:s}=a;return Mg(s)}):r++;Hs()===e&&WM(t||"all")}function Aae(e){let t=e.keyCode||e.which||e.charCode;const n=p0.indexOf(t);if(n>=0&&p0.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&p0.splice(0,p0.length),(t===93||t===224)&&(t=91),t in m2){m2[t]=!1;for(const r in Io)Io[r]===t&&(ao[r]=!1)}}function QM(e){if(typeof e>"u")Object.keys(y0).forEach(o=>{Array.isArray(y0[o])&&y0[o].forEach(i=>h6(i)),delete y0[o]}),Mg(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&h6(o)});else if(typeof e=="object")e.key&&h6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,i]=n;typeof o=="function"&&(i=o,o=""),h6({key:e,scope:o,method:i,splitKey:"+"})}}const h6=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;$M(t).forEach(a=>{const s=a.split(o),c=s.length,u=s[c-1],d=u==="*"?"*":ul(u);if(!y0[d])return;n||(n=Hs());const h=c>1?UM(Io,s):[],C=[];y0[d]=y0[d].filter(m=>{const v=(r?m.method===r:!0)&&m.scope===n&&cae(m.mods,h);return v&&C.push(m.element),!v}),C.forEach(m=>Mg(m))})};function Kb(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const i in m2)Object.prototype.hasOwnProperty.call(m2,i)&&(!m2[i]&&t.mods.indexOf(+i)>-1||m2[i]&&t.mods.indexOf(+i)===-1)&&(o=!1);(t.mods.length===0&&!m2[16]&&!m2[18]&&!m2[17]&&!m2[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(p0),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Wb(e,t){const n=y0["*"];let r=e.keyCode||e.which||e.charCode;if(!ao.filter.call(this,e))return;if((r===93||r===224)&&(r=91),p0.indexOf(r)===-1&&r!==229&&p0.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const c=Q4[s];e[s]&&p0.indexOf(c)===-1?p0.push(c):!e[s]&&p0.indexOf(c)>-1?p0.splice(p0.indexOf(c),1):s==="metaKey"&&e[s]&&(p0=p0.filter(u=>u in Q4||u===r))}),r in m2){m2[r]=!0;for(const s in Io)if(Object.prototype.hasOwnProperty.call(Io,s)){const c=Q4[Io[s]];ao[s]=e[c]}if(!n)return}for(const s in m2)Object.prototype.hasOwnProperty.call(m2,s)&&(m2[s]=e[Q4[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(p0.indexOf(17)===-1&&p0.push(17),p0.indexOf(18)===-1&&p0.push(18),m2[17]=!0,m2[18]=!0);const o=Hs();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&Kb(e,n[s],o,t);if(!(r in y0))return;const i=y0[r],a=i.length;for(let s=0;s<a;s++)if((e.type==="keydown"&&i[s].keydown||e.type==="keyup"&&i[s].keyup)&&i[s].key){const c=i[s],{splitKey:u}=c,d=c.key.split(u),h=[];for(let C=0;C<d.length;C++)h.push(ul(d[C]));h.sort().join("")===p0.sort().join("")&&Kb(e,c,o,t)}}function ao(e,t,n){p0=[];const r=$M(e);let o=[],i="all",a=document,s=0,c=!1,u=!0,d="+",h=!1,C=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(c=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(h=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(C=!0)),typeof t=="string"&&(i=t),C&&QM(e,i);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=UM(Io,e)),e=e[e.length-1],e=e==="*"?"*":ul(e),e in y0||(y0[e]=[]),y0[e].push({keyup:c,keydown:u,scope:i,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!na.has(a)){const m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Wb(v,a)},A=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Wb(v,a),Aae(v)};na.set(a,{keydownListener:m,keyupListenr:A,capture:h}),zd(a,"keydown",m,h),zd(a,"keyup",A,h)}if(!us){const m=()=>{p0=[]};us={listener:m,capture:h},zd(window,"focus",m,h)}}}function vae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(y0).forEach(n=>{y0[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function Mg(e){const t=Object.values(y0).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:i}=na.get(e)||{};r&&o&&(M4(e,"keyup",o,i),M4(e,"keydown",r,i),na.delete(e))}if((t.length<=0||na.size<=0)&&(Object.keys(na).forEach(o=>{const{keydownListener:i,keyupListenr:a,capture:s}=na.get(o)||{};i&&a&&(M4(o,"keyup",a,s),M4(o,"keydown",i,s),na.delete(o))}),na.clear(),Object.keys(y0).forEach(o=>delete y0[o]),us)){const{listener:o,capture:i}=us;M4(window,"focus",o,i),us=null}}const Zd={getPressedKeyString:hae,setScope:WM,getScope:Hs,deleteScope:pae,getPressedKeyCodes:fae,getAllKeyCodes:Cae,isPressed:mae,filter:gae,trigger:vae,unbind:QM,keyMap:Ms,modifier:Io,modifierMap:Q4};for(const e in Zd)Object.prototype.hasOwnProperty.call(Zd,e)&&(ao[e]=Zd[e]);if(typeof window<"u"){const e=window.hotkeys;ao.noConflict=t=>(t&&window.hotkeys===ao&&(window.hotkeys=e),ao),window.hotkeys=ao}class Y1 extends R.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(ao.filter=t),ao.unbind(this.props.keyName),ao(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){ao.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:i}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!i&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Y1.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}};Y1.propTypes={keyName:U3.string,filter:U3.func,onKeyDown:U3.func,onKeyUp:U3.func,disabled:U3.bool,splitKey:U3.string};const GM=["shift","alt","meta","mod","ctrl","control"],bae={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function e9(e){return(bae[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function YM(e){return GM.includes(e)}function Ud(e,t=","){return e.toLowerCase().split(t)}function $d(e,t="+",n=">",r=!1,o){let i=[],a=!1;e.includes(n)?(a=!0,i=e.toLocaleLowerCase().split(n).map(u=>e9(u))):i=e.toLocaleLowerCase().split(t).map(u=>e9(u));const s={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod"),useKey:r},c=i.filter(u=>!GM.includes(u));return{...s,keys:c,description:o,isSequence:a}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&qM([e9(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&XM([e9(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{aa.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{aa.clear()},0)}));const aa=new Set;function Hg(e){return Array.isArray(e)}function yae(e,t=","){return(Hg(e)?e:e.split(t)).every(n=>aa.has(n.trim().toLowerCase()))}function qM(e){const t=Array.isArray(e)?e:[e];aa.has("meta")&&aa.forEach(n=>!YM(n)&&aa.delete(n.toLowerCase())),t.forEach(n=>aa.add(n.toLowerCase()))}function XM(e){const t=Array.isArray(e)?e:[e];e==="meta"?aa.clear():t.forEach(n=>aa.delete(n.toLowerCase()))}function wae(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function xae(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function _ae(e){return JM(e,["input","textarea","select"])}function JM(e,t=!1){const{target:n,composed:r}=e;let o;return Eae(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,Hg(t)?!!(o&&t&&t.some(i=>i.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function Eae(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Sae(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const Mae=(e,t,n=!1)=>{const{alt:r,meta:o,mod:i,shift:a,ctrl:s,keys:c,useKey:u}=t,{code:d,key:h,ctrlKey:C,metaKey:m,shiftKey:A,altKey:v}=e,p=e9(d);if(u&&(c==null?void 0:c.length)===1&&c.includes(h))return!0;if(!(c!=null&&c.includes(p))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(p))return!1;if(!n){if(r!==v&&p!=="alt"||a!==A&&p!=="shift")return!1;if(i){if(!m&&!C)return!1}else if(o!==m&&p!=="meta"&&p!=="os"||s!==C&&p!=="ctrl"&&p!=="control")return!1}return c&&c.length===1&&c.includes(p)?!0:c?yae(c):!c},Hae=R.createContext(void 0),Lae=()=>R.useContext(Hae);function eH(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&eH(e[r],t[r]),!0):e===t}const Bae=R.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Oae=()=>R.useContext(Bae);function Rae(e){const t=R.useRef(void 0);return eH(t.current,e)||(t.current=e),t.current}const Qb=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Iae=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Gb(e,t,n,r){const o=R.useRef(null),i=R.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=Hg(e)?e.join(a==null?void 0:a.delimiter):e,c=n instanceof Array?n:r instanceof Array?r:void 0,u=R.useCallback(t,c??[]),d=R.useRef(u);c?d.current=u:d.current=t;const h=Rae(a),{activeScopes:C}=Oae(),m=Lae();return Iae(()=>{if((h==null?void 0:h.enabled)===!1||!Sae(C,h==null?void 0:h.scopes))return;let A=[],v;const p=(E,S=!1)=>{var M;if(!(_ae(E)&&!JM(E,h==null?void 0:h.enableOnFormTags))){if(o.current!==null){const H=o.current.getRootNode();if((H instanceof Document||H instanceof ShadowRoot)&&H.activeElement!==o.current&&!o.current.contains(H.activeElement)){Qb(E);return}}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||Ud(s,h==null?void 0:h.delimiter).forEach(H=>{var O,k,D,N;if(H.includes((h==null?void 0:h.splitKey)??"+")&&H.includes((h==null?void 0:h.sequenceSplitKey)??">")){console.warn(`Hotkey ${H} contains both ${(h==null?void 0:h.splitKey)??"+"} and ${(h==null?void 0:h.sequenceSplitKey)??">"} which is not supported.`);return}const P=$d(H,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description);if(P.isSequence){v=setTimeout(()=>{A=[]},(h==null?void 0:h.sequenceTimeoutMs)??1e3);const F=P.useKey?E.key:e9(E.code);if(YM(F.toLowerCase()))return;A.push(F);const j=(O=P.keys)==null?void 0:O[A.length-1];if(F!==j){A=[],v&&clearTimeout(v);return}A.length===((k=P.keys)==null?void 0:k.length)&&(d.current(E,P),v&&clearTimeout(v),A=[])}else if(Mae(E,P,h==null?void 0:h.ignoreModifiers)||(D=P.keys)!=null&&D.includes("*")){if((N=h==null?void 0:h.ignoreEventWhen)!=null&&N.call(h,E)||S&&i.current)return;if(wae(E,P,h==null?void 0:h.preventDefault),!xae(E,P,h==null?void 0:h.enabled)){Qb(E);return}d.current(E,P),S||(i.current=!0)}})}},_=E=>{E.code!==void 0&&(qM(e9(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&p(E))},w=E=>{E.code!==void 0&&(XM(e9(E.code)),i.current=!1,h!=null&&h.keyup&&p(E,!0))},x=o.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",w,a==null?void 0:a.eventListenerOptions),x.addEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),m&&Ud(s,h==null?void 0:h.delimiter).forEach(E=>m.addHotkey($d(E,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description))),()=>{x.removeEventListener("keyup",w,a==null?void 0:a.eventListenerOptions),x.removeEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),m&&Ud(s,h==null?void 0:h.delimiter).forEach(E=>m.removeHotkey($d(E,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description))),A=[],v&&clearTimeout(v)}},[s,h,C]),o}const kae="_table_q0jcp_1",Dae="_table__header_q0jcp_18",Pae="_table__header__th_q0jcp_24",Nae="_table__row_q0jcp_38",Tae="_table__row__row_selected_q0jcp_44",Fae="_table__row__td_q0jcp_47",Vae="_clickable_q0jcp_68",jae="_loadMoreButton_q0jcp_73",zae="_loadMoreButtonDiv_q0jcp_78",Zae="_table_container_q0jcp_84",Uae="_scrollable_table_q0jcp_92",$ae="_pagination_container_q0jcp_104",Kae="_pagination_btn_q0jcp_113",Wae="_active_q0jcp_130",Qae="_pagination_dots_q0jcp_135",Gae="_pagination_input_q0jcp_140",Yae="_nextPrevArrow_q0jcp_165",qae="_pagination_left_q0jcp_179",Xae="_pagination_right_q0jcp_191",Jae="_pagination_loading_q0jcp_204",p2={table:kae,table__header:Dae,table__header__th:Pae,table__row:Nae,table__row__row_selected:Tae,table__row__td:Fae,clickable:Vae,loadMoreButton:jae,loadMoreButtonDiv:zae,table_container:Zae,scrollable_table:Uae,pagination_container:$ae,pagination_btn:Kae,active:Wae,pagination_dots:Qae,pagination_input:Gae,nextPrevArrow:Yae,pagination_left:qae,pagination_right:Xae,pagination_loading:Jae},tH=({children:e,disableOverflowY:t=!1,tableClass:n="",disableFixHeight:r,isPagination:o=!0})=>Z.jsx("div",{className:qn(p2.table_container,n),style:{overflowY:t?"unset":"auto",height:r?"unset":o?"70vh":"78vh",maxHeight:o?"70vh":"85vh"},children:Z.jsx("table",{id:"resizeMe",className:qn(p2.table,p2.scrollable_table),children:e})}),nH=({children:e})=>Z.jsx("tbody",{className:p2.table__body,children:e}),Lg=({children:e,className:t="",title:n="",onclick:r})=>Z.jsx("tr",{className:qn(p2.table__row,{[t]:!!t}),title:n,...r&&{onClick:r},children:e}),G4=({children:e,className:t="",extraClass:n="",title:r="",...o})=>{const i=qn(p2.table__row__td,t,(n==null?void 0:n.length)>0&&p2.clickable);return Z.jsx("td",{className:i,title:r,children:Z.jsx("span",{...o,style:{textAlign:"left"},children:e})})},rH=({children:e,className:t="",title:n=""})=>Z.jsx("th",{className:qn(p2.table__header__th,{[t]:t}),title:n,children:Z.jsxs("span",{children:[e," "]})}),oH=({children:e,className:t=""})=>Z.jsx("thead",{className:qn(p2.table__header,{[t]:!!t}),children:e}),iH=({list:e,headerClass:t="",type:n=""})=>(console.log("AWIHEADER List,",e),Z.jsx(oH,{className:t,children:Z.jsx(Lg,{children:e.map(r=>Z.jsx(rH,{children:r},r))},`row_${n}`)},n)),Ch=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:i=()=>{console.log("Not available")},handleZoomOutClick:a=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:c=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:h=()=>{console.log("Not available")},switchToAutoAnnotations:C=()=>{console.log("Not available")},openShortCutRequestDetails:m=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:A=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:p,request:_,switchToEditMode:w=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:E=()=>{console.log("Not available")},goToPreviousImage:S=()=>{console.log("Not available")},loggedUser:M,handleGoToPendingAnnotations:H=()=>{console.log("Not available")},handleCopyByCtrlC:O=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:k=()=>{console.log("Not available")},openShortCutKeyModal:D,setOpenShortCutKeyModal:N=()=>{console.log("Not available")},setIsAltViaToolPressHandle:P=()=>{console.log("Not available")},isCarousel:F=!1,selectedTool:j="",setCrossHairHandle:V=()=>{console.log("Not available")},controlMinusHotkey:T=()=>{console.log("Not available")},controlPlusHotkey:$=()=>{console.log("Not available")}})=>{const K=Br.isSAMAllowed(_==null?void 0:_.awi_annotation_type,_==null?void 0:_.awi_request_for)&&!p,q=["awi_annotator","awi_verifier","awi_developer"].includes(M.userObj.awi_level),W=()=>{const J=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],Y=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],ee=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return M.userObj.awi_level==="awi_verifier"?[...J,...ee,...Y]:M.userObj.awi_level==="awi_supervisor"?J:[...J,...ee]},U=J=>{switch(J){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return i();case"zoom_out":return a();case"complete":return s();case"undo":return c();case"reload":return u();case"toggle_pagination":return d(Y=>!Y);case"fullscreen":return h();case"auto_annotations":return C();case"open_shortcut_details":return m();case"recent_verified":return A();case"send_to_sam":if(K)return j!="SAM"&&C(),v();W1.error("SAM is not allowed");return;case"edit_mode":if(w)return w();break;case"create_mode":if(x)return x();break;case"next_image":if(E)return E();break;case"prev_image":if(S)return S();break;case"pending_annotations":if(H)return H();break;case"copy":if(O)return O();break;case"paste":if(k)return k();break;case"pan_mode":P();break;case"cross_hair":V&&typeof V=="function"&&V();break;default:console.warn(`Unhandled hotkey action: ${J}`)}},G=(J,Y)=>{U(J),Y&&N(!1)};return Gb("ctrl+=",J=>{J.preventDefault(),$()}),Gb("ctrl+-, ctrl+subtract, ctrl+minus",J=>{J.preventDefault(),T()}),Z.jsxs(Z.Fragment,{children:[Z.jsx(Y1,{allowRepeat:!0,keyName:"t",onKeyDown:()=>U("select_forward")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"u",onKeyDown:()=>U("select_backward")}),Z.jsx(Y1,{allowRepeat:!1,keyName:"l",onKeyDown:()=>U("select_last_update")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"left",onKeyDown:()=>U("move_left")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"right",onKeyDown:()=>U("move_right")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"up",onKeyDown:()=>U("move_up")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"down",onKeyDown:()=>U("move_down")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"i",onKeyDown:()=>U("zoom_in")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"o",onKeyDown:()=>U("zoom_out")}),Z.jsx(Y1,{keyName:"enter",onKeyDown:()=>U("complete")}),Z.jsx(Y1,{keyName:"ctrl+z",onKeyDown:()=>U("undo")}),Z.jsx(Y1,{keyName:"r",onKeyDown:()=>U("reload")}),Z.jsx(Y1,{keyName:"h",onKeyDown:()=>U("toggle_pagination")}),Z.jsx(Y1,{keyName:"f",onKeyDown:()=>U("fullscreen")}),Z.jsx(Y1,{keyName:"s",onKeyDown:()=>U("auto_annotations")}),Z.jsx(Y1,{keyName:"v",onKeyDown:()=>U("open_shortcut_details")}),Z.jsx(Y1,{keyName:"alt+r",onKeyDown:()=>U("recent_verified")}),K&&Z.jsx(Y1,{keyName:"x",onKeyDown:()=>U("send_to_sam")}),q&&Z.jsxs(Z.Fragment,{children:[Z.jsx(Y1,{keyName:"e",onKeyDown:()=>U("edit_mode")}),Z.jsx(Y1,{keyName:"q",onKeyDown:()=>U("create_mode")})]}),Z.jsx(Y1,{keyName:"d",onKeyDown:()=>U("next_image")}),Z.jsx(Y1,{keyName:"a",onKeyDown:()=>U("prev_image")}),M.userObj.awi_level==="awi_verifier"&&Z.jsx(Y1,{keyName:"p",onKeyDown:()=>U("pending_annotations")}),Z.jsx(Y1,{keyName:"ctrl+c",onKeyDown:()=>U("copy")}),Z.jsx(Y1,{keyName:"ctrl+v",onKeyDown:()=>U("paste")}),Z.jsx(Y1,{keyName:"m",onKeyDown:()=>U("pan_mode")}),Z.jsx(Y1,{keyName:"w",onKeyDown:()=>U("cross_hair")}),D&&!F&&Z.jsx(Z.Fragment,{children:Z.jsxs(v7,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>N(!1),className:"noPadding",children:[Z.jsx(y7,{title:"Shortcut keys",onClose:()=>N(!1)}),Z.jsx(b7,{children:Z.jsxs(tH,{children:[Z.jsx(iH,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),Z.jsx(nH,{children:(W()||[]).map((J,Y)=>{var ee;return Z.jsxs(Lg,{title:J.title,children:[Z.jsx(G4,{children:Y+1}),Z.jsx(G4,{children:J.action}),Z.jsx(G4,{children:Z.jsxs("div",{className:"shortcutKey",children:[" ",J.displayKey," "]})}),Z.jsx(G4,{children:((ee=J==null?void 0:J.key)==null?void 0:ee.length)>0&&Z.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>G(J.key,J.isClose),children:"Press"})})]})})})]})}),Z.jsx(x7,{})]})})]})},e9e=10,t9e=12,Yb=e=>{switch(e){case"rectangle":return X1.rectangleIcon.IconComponent;case"circle":return X1.circleIcon.IconComponent;case"polygon":return X1.polygonIcon.IconComponent;case"dot":return X1.dotIcon.IconComponent;default:return X1.rectangleIcon.IconComponent}},Tc=({isEditing:e,handleSelectTool:t=()=>{console.log("handleSelectTool function is not provided")},handleSAMToggle:n=()=>{console.log("handleSAMToggle function is not provided")},hasAnnotation:r=!1,currentSelectedSAMTool:o="Normal",handleCopyAnnotations:i,setOpenRequestDetails:a=()=>{console.log("setOpenRequestDetails function is not provided")},openRequestDetails:s,show_guidelines_first:c,handleZoomInClick:u,zoomProperties:d,handleReset:h,handleZoomOutClick:C,handleCompleteAnnotation:m,toggleFullscreen:A,selectAnnotationId:v,selectedAnnotationInfo:p,undoLastStateAnnotation:_,usingSamFunction:w,samAPIactive:x,handleSendToSamFunction:E,coordinates:S,handleSendToSamFunctionPrompt:M,reLoadAndReDrawAnnotations:H,showGuidelinesFirst:O,isMobile:k,toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,undoAnnotationPoint:V,togglePagination:T,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,showPagination:Y=!1,loggedUser:ee,isControlViaToolPress:re,isAltViaToolPress:ue,setIsControlViaToolPress:se,setIsAltViaToolPress:_e,isCarousel:xe=!1,allowedToCopyPreview:Ae,classColorMapToSend:he,request:le,parentReqData:ae,RequestInfoModal:ye,setCrossHair:Re,isCrossHair:Ie,annotationViewType:Ce="atom",REACT_APP_SAM_ENABLED:et="no",controlPlusHotkey:fe,controlMinusHotkey:ne,Carousel:pe})=>{var Gt,An,bn,Qt,Ot,Ht,_t,Zt,Cn,mt;(a==null||typeof a!="function")&&(a=pt=>{console.log("setOpenRequestDetails function is not provided",pt)}),t||(t=pt=>{console.log("handleSelectTool function is not provided",pt)}),n||(n=pt=>{console.log("handleSAMToggle function is not provided",pt)});const[Ee,Le]=R.useState(!1),[Be,je]=R.useState(!1),[We,lt]=R.useState(""),[tt,Qe]=R.useState(!1),[Fe,ot]=R.useState(o),Ue=()=>{lt(""),a(!1),je(!1),Le(!0)},Ve=(pt="annotated")=>{lt(pt),a(!1),Le(!1),je(!0)},Ge=()=>{le!=null&&le.total_verified_images_count?Ve("verified"):Ve("annotated")},dt=pt=>{t("annotate"),n(pt),ot(pt)},qe=pt=>{typeof t=="function"&&t("edit"),typeof n=="function"&&n("Normal"),typeof ot=="function"&&ot("Normal")},ft=()=>{if(Fe=="Normal"){if(!Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for))return;dt("SAM")}else dt("Normal")},Pt=()=>{O&&s||typeof a=="function"&&a(pt=>!pt)};R.useEffect(()=>{o&&ot(o)},[o]);const Wt=pt=>{i&&typeof i=="function"&&i(pt,!0)},an=()=>{_e(!ue)},Dn=()=>{Re(!Ie)};return Ae&&xe?null:xe?Z.jsx(Z.Fragment,{children:Z.jsx(Ch,{toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,handleZoomInClick:u,handleZoomOutClick:C,handleCompleteAnnotation:m,undoAnnotationPoint:V,reLoadAndReDrawAnnotations:H,togglePagination:T,toggleFullscreen:A,switchToAutoAnnotations:ft,openShortCutRequestDetails:Pt,handleRecentAnnotatedVerifiedImages:Ge,samAPIactive:x,request:le,handleSendToSamFunctionPrompt:M,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,openShortCutKeyModal:tt,setOpenShortCutKeyModal:Qe,setIsAltViaToolPressHandle:an,isCarousel:xe,selectedTool:Fe,setCrossHairHandle:Dn,loggedUser:ee,controlMinusHotkey:ne,controlPlusHotkey:fe})}):Z.jsxs("div",{style:{...k||Ce==="library"?{width:"100%",height:"40px"}:{height:"100%",width:"100%",maxHeight:"100%"},overflow:"auto"},children:[Z.jsx(Z.Fragment,{children:Z.jsx(Ch,{toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,handleZoomInClick:u,handleZoomOutClick:C,handleCompleteAnnotation:m,undoAnnotationPoint:V,reLoadAndReDrawAnnotations:H,togglePagination:T,toggleFullscreen:A,switchToAutoAnnotations:ft,openShortCutRequestDetails:Pt,handleRecentAnnotatedVerifiedImages:Ge,samAPIactive:x,request:le,handleSendToSamFunctionPrompt:M,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,openShortCutKeyModal:tt,setOpenShortCutKeyModal:Qe,setIsAltViaToolPressHandle:an,selectedTool:Fe,setCrossHairHandle:Dn,loggedUser:ee,isCarousel:xe,controlMinusHotkey:ne,controlPlusHotkey:fe})}),Z.jsxs("div",{className:Sn.annotation__tool__icons,style:{display:"flex",justifyContent:k?"center":"space-between",flexDirection:k?"row":"column",backgroundColor:"#fff",width:k?"100%":"auto",...k||Ce=="library"?{maxWidth:"100%",overflowX:"auto",gap:"20px"}:{height:"100%"}},children:[Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[(le==null?void 0:le.awi_request_for)!="attributes"?Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:!e},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>{typeof t=="function"&&t("annotate")},title:e?"Create to change from edit to create mode":"Create to start create mode",children:(le==null?void 0:le.awi_annotation_type)&&((Gt=le==null?void 0:le.awi_annotation_type)==null?void 0:Gt.length)>0&&Z.jsx("img",{src:Yb(le==null?void 0:le.awi_annotation_type),alt:"annotation tool",title:"Annotate - keyboard(Q)",className:Sn.annotationIcon})}):Z.jsx("div",{className:Sn.annotationIconDiv,children:(le==null?void 0:le.awi_annotation_type)&&((An=le==null?void 0:le.awi_annotation_type)==null?void 0:An.length)>0&&Z.jsx("img",{src:Yb(le==null?void 0:le.awi_annotation_type),alt:"annotation tool",title:"Annotate - keyboard(Q)",className:Sn.annotationIcon})}),r&&Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:e},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>qe(),title:"Edit - keyboard(E)",children:Z.jsx("img",{src:X1.editIcon.IconComponent,alt:"Edit",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:re},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>se(!re),title:"Control",children:Z.jsx("img",{src:X1.controlIcon.IconComponent,alt:"Control",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:ue},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>_e(!ue),title:"Alt press / Panning mode",children:Z.jsx("img",{src:X1.moveIcon.IconComponent,alt:"Alt",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:Ie},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>Re(!Ie),title:"Cross Hair",children:Z.jsx("img",{src:X1.crosshairIcon.IconComponent,alt:"Cross Hair",className:Sn.annotationIcon})}),!e&&(le==null?void 0:le.awi_annotation_type)==="polygon"&&(le==null?void 0:le.awi_request_for)!="attributes"&&S.length>2?Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:m,title:"Click to complete your polygon annotation",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.filledTickIcon.IconComponent,className:Sn.annotationIcon})})}):Z.jsx(Z.Fragment,{children:(le==null?void 0:le.awi_annotation_type)==="polygon"&&Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{title:"Works for create mode with minimum 3 coordinates",className:Sn.annotationIconDiv,style:{cursor:"not-allowed !important",opacity:"0.5"},children:Z.jsx("img",{src:X1.filledTickIcon.IconComponent,className:qn(Sn.annotationIcon,"not-allowed-pointer")})})})}),Z.jsx("div",{className:Sn.partitionLine})]}),Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsxs("div",{onClick:((bn=p==null?void 0:p.past_coords)==null?void 0:bn.length)>0&&e&&v!=="-1"?_:void 0,title:((Qt=p==null?void 0:p.past_coords)==null?void 0:Qt.length)>0&&e&&v!=="-1"?"Click to revert annotation":"No undo available",style:{width:"1.8rem",height:"1.8rem",position:"relative",cursor:((Ot=p==null?void 0:p.past_coords)==null?void 0:Ot.length)>0&&e&&v!=="-1"?"pointer":"not-allowed",opacity:((Ht=p==null?void 0:p.past_coords)==null?void 0:Ht.length)>0&&e&&v!=="-1"?1:.5,pointerEvents:((_t=p==null?void 0:p.past_coords)==null?void 0:_t.length)>0&&e&&v!=="-1"?"auto":"none"},children:[Z.jsx("img",{src:X1.undoAnnotationIcon.IconComponent,alt:"Undo",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"0.25rem"}}),((Zt=p==null?void 0:p.past_coords)==null?void 0:Zt.length)>0&&e&&v!=="-1"&&Z.jsx("div",{className:Sn.undoAnnotationCount,children:p.past_coords.length})]})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("img",{onClick:u,src:X1.zoomInIcon.IconComponent,className:`cursor-pointer ${d.scale===t9e?"cursor-pointer-disable":""} ${Sn.annotationIcon}`,title:"Zoom in - Keyboard(I)"})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("div",{onClick:h,title:`Click to Reset Zoom ${d.scale.toFixed(1)} to default`,className:Sn.annotationIcon,style:{fontSize:"12px",justifyContent:"center",display:"flex"},children:d.scale.toFixed(1)})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("img",{onClick:C,src:X1.zoomOutIcon.IconComponent,className:`cursor-pointer ${d.scale===1?"cursor-pointer-disable":""} ${Sn.annotationIcon}`,title:"Zoom out - Keyboard(O)"})}),Z.jsx("div",{onClick:()=>A(),className:Sn.annotationIconDiv,style:{display:"flex",alignItems:"center",justifyContent:"center"},title:"Toggle Fullscreen - Keyboard(F)",id:"toggle_full_screen",children:Z.jsx("img",{src:X1.toggleFullscreenIcon.IconComponent,className:Sn.annotationIcon})}),Z.jsx("div",{className:Sn.partitionLine})]}),Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[et=="yes"&&Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for)&&Z.jsx("div",{style:{display:"flex",alignItems:"center"},title:"AI tools - keyboard(S)",children:Z.jsxs("label",{className:Sn.switch,style:{marginLeft:"4px",width:"30px important"},children:[Z.jsx("input",{type:"checkbox",checked:Fe==="SAM",onChange:()=>{dt(Fe==="SAM"?"Normal":"SAM")}}),Z.jsx("span",{className:qn(Sn.slider,Sn.round)})]})}),Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for)&&Z.jsxs("div",{className:qn({"disabled-class":!w}),style:{justifyContent:"space-between",display:"flex",flexDirection:k?"row":"column",gap:"15px"},children:[(le==null?void 0:le.awi_annotation_type)&&(le==null?void 0:le.awi_annotation_type)!="dot"&&Z.jsx("div",{onClick:()=>{!x&&(S!=null&&S.length)&&E()},className:qn({"disabled-class":!w||x||!(S!=null&&S.length)},Sn.annotationIconDiv,"cursor-pointer"),style:{pointerEvents:x||!w?"none":"auto",opacity:x||!w?.5:1},children:Z.jsx("img",{src:X1.pointAnnotationIcon.IconComponent,title:"Mark some points and then click here and get the power of AI auto annotation",className:Sn.annotationIcon})}),Z.jsx("div",{onClick:x?void 0:M,style:{pointerEvents:x||!w?"none":"auto",opacity:x||!w?.5:1},title:"Give your prompt and get the power of AI auto annotation",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.promptAnnotationIcon.IconComponent,title:"auto annotation prompt - keyboard(X)",className:Sn.annotationIcon})})]}),Z.jsx("div",{onClick:H,title:"Click to refetch saved annotations, hard reset",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.refetchAnnotationIcon.IconComponent,title:"Refetch annotations (Hard Reset) - keyboard(R)",className:Sn.annotationIcon})}),Z.jsx("div",{style:{width:"53%",height:"2px",backgroundColor:"#e4e0e6",margin:"8px auto"}})]}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:()=>{typeof a=="function"&&a(pt=>!pt)},title:"View details - keyboard(V)",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.guidelinesIcon.IconComponent,alt:"info",style:{height:"30px !important",width:"30px !important",cursor:"pointer"}})})}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{children:Z.jsx("img",{src:X1.keyboardShortcutsIcon.IconComponent,title:"See short-cut keys",className:"cursor-pointer",width:"30px",onClick:()=>Qe(pt=>!pt)})})}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:T,children:Z.jsx("img",{src:X1.transparentBlackIcon.IconComponent,style:{height:"24px",width:" 24px",cursor:"pointer"},alt:"Previous",title:Y?"Hide Pagination":"Show Pagination"})})})]}),s&&ye&&Z.jsx(ye,{request:le,handleReferenceImageClick:Ue,handleRecentAnnotatedImages:Ve,show_guidelines_first:c,setOpenRequestDetails:a,classColorMapToSend:he}),s&&ye&&Z.jsx("div",{className:qn(Sn.backdrop),onClick:()=>{c||typeof a=="function"&&a(!1)}}),s&&Z.jsx("div",{className:qn(Sn.backdrop),onClick:()=>{O||typeof a=="function"&&a(!1)}}),pe&&Ee&&Z.jsx(Z.Fragment,{children:Z.jsx(pe,{handleToggleCarousel:()=>Le(!1),requestName:(le==null?void 0:le.awi_label)||"",showAnnotationType:"all",requestId:(ae==null?void 0:ae.awi_id)||(le==null?void 0:le.awi_id),imageKeys:((Cn=ae==null?void 0:ae.awi_reference_images)==null?void 0:Cn.awi_ids)||((mt=le==null?void 0:le.awi_reference_images)==null?void 0:mt.awi_ids)||[],awi_reference_image:!0,defaultAnnotationMode:"display_annotations",allowedToCopy:!0,copyCallBack:Wt})}),Ee&&Z.jsx("div",{className:qn(Sn.backdrop,Sn.backdrop__transparent),onClick:()=>Le(!1)}),pe&&Be&&Z.jsx(Z.Fragment,{children:Z.jsx(pe,{handleToggleCarousel:()=>je(!1),requestName:(le==null?void 0:le.awi_label)||"",showAnnotationType:"all",requestId:(ae==null?void 0:ae.awi_id)||(le==null?void 0:le.awi_id),awi_reference_image:!1,contentAnnotationType:We||"annotated",primaryLimit:e9e,defaultAnnotationMode:"display_annotations",allowedToCopy:!0,copyCallBack:Wt})})]})},n9e="_canvas_145op_1",r9e="_canvasContainer_145op_9",o9e="_canvasSubContainer_145op_18",C6={canvas:n9e,canvasContainer:r9e,canvasSubContainer:o9e},Fc=({canvasDimensions:e,zoomProperties:t,isEditing:n,canvasRef:r,bgCanvasRef:o,overlayCanvasRef:i,handleMouseDown:a,handleMouseUp:s,handleMouseMove:c,handleMouseMoveOut:u,handleOnMouseLeave:d,handleWheel:h,handleTouchStart:C,handleTouchMove:m,handleTouchEnd:A,handleTouchCancel:v})=>Z.jsxs("div",{className:C6.canvasSubContainer,style:{display:"flex",flexDirection:"row",width:e.width,height:e.height,position:"relative"},children:[Z.jsx("canvas",{ref:o,className:C6.bgCanvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,zIndex:0,pointerEvents:"none"}}),Z.jsx("canvas",{ref:r,className:C6.canvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,cursor:n?"default":"crosshair",transformOrigin:"top left",transform:`translate(${t.x}px, ${t.y}px)`},onMouseDown:a,onMouseUp:s,onMouseMove:c,onMouseOut:u,onMouseLeave:d,onWheel:h,onTouchStart:C,onTouchMove:m,onTouchEnd:A,onTouchCancel:v}),Z.jsx("canvas",{ref:i,className:C6.overlayCanvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,pointerEvents:"none",zIndex:2,transformOrigin:"top left",transform:`translate(${t.x}px, ${t.y}px)`}})]}),i9e=1e-5,a9e=.99999,s9e=.001,l9e=.005,B8=(e,t)=>e/(t||1),aH=(e,t,n,r)=>Math.sqrt(Math.pow(Math.abs(n-e),2)+Math.pow(Math.abs(r-t),2)),gh=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y),c9e=e=>{let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach(({x:i,y:a})=>{t=Math.min(t,i),n=Math.min(n,a),r=Math.max(r,i),o=Math.max(o,a)}),{minX:t,minY:n,maxX:r,maxY:o}},mh=(e,t,n=0)=>{let r=0;for(let o=0;o<(t==null?void 0:t.length)-1;o++){const i=t[o],a=t[o+1];i.y<=e.y+n?a.y>e.y+n&&gh(i,a,e)>0&&r++:a.y<=e.y-n&&gh(i,a,e)<0&&r--}return r},Bg=e=>(e==null?void 0:e.length)<2?0:Math.sqrt(Math.pow(Math.abs(e[0].x-e[1].x),2)+Math.pow(Math.abs(e[0].y-e[1].y),2));function u9e(e,t,n=0){const r=Math.min(...t.map(u=>u.x)),o=Math.max(...t.map(u=>u.x)),i=Math.min(...t.map(u=>u.y)),a=Math.max(...t.map(u=>u.y)),{x:s,y:c}=e;return s>=r-n&&s<=o+n&&c>=i-n&&c<=a+n}const d9e=(e,t,n,r,o,i,a=1)=>{if(!(n!=null&&n.length))return!1;let s,c,u,d,h=!1;switch(i==null?void 0:i.awi_annotation_type){case"rectangle":h=u9e({x:e,y:t},n,r);break;case"polygon":h=mh({x:e,y:t},n,r)!==0;break;case"circle":s=Bg(n)/2,c=(n[0].x+r+(n[1].x-o))/2,u=(n[0].y+n[1].y)/2,d=(e-c)*(e-c)+(t-u)*(t-u),d<s*s?h=!0:h=!1;break;case"dot":s=B8(.015,a),c=(n[0].x+r+(n[0].x-o))/2,u=(n[0].y+n[0].y)/2,d=(e-c)*(e-c)+(t-u)*(t-u),d<s*s?h=!0:h=!1;break;default:h=mh({x:e,y:t},n,r)!==0}return h},f9e=e=>!(!e||e.x>1||e.x<0||e.y1>1||e.y<0),h9e=e=>{if((e==null?void 0:e.length)<3)return!1;for(let t=0;t<e.length;t++)if(!f9e(e[t]))return!1;return!0},C9e=(e,t,n=!1,r=1)=>{var a,s,c,u;const o=e==null?void 0:e.awi_annotation_type;let i=!1;switch(o){case"rectangle":const d=B8(s9e,r);(t==null?void 0:t.length)>3&&Math.abs(((a=t[0])==null?void 0:a.x)-((s=t[1])==null?void 0:s.x))>d&&Math.abs(((c=t[1])==null?void 0:c.y)-((u=t[3])==null?void 0:u.y))>d&&(i=!0);break;case"circle":const h=B8(l9e,r);Bg(t)>h&&(i=!0);break;case"polygon":i=h9e(t);break;case"dot":i=!0;break;default:n&&(i=!0);break}return i},sH=(e,t,n,r,o,i)=>{const a=e-n,s=t-r,c=o-n,u=i-r,d=a*c+s*u,h=c*c+u*u,C=h!==0?d/h:-1;let m,A;C<0?(m=n,A=r):C>1?(m=o,A=i):(m=n+C*c,A=r+C*u);const v=e-m,p=t-A;return Math.sqrt(v*v+p*p)},g9e=(e,t,n)=>{let r=1/0,o=-1;for(let i=0;i<(e==null?void 0:e.length);i++){const a=(i+1)%e.length,{x:s,y:c}=e[i],{x:u,y:d}=e[a],h=sH(t,n,s,c,u,d);h<r&&(r=h,o=a)}return{insertIndex:o,minDistance:r}},lH=(e,t)=>t===0?e:lH(t,e%t),m9e=(e,t,n,r)=>(e>0&&(e=0),Math.abs(e)>n&&(e=-1*n),Math.abs(t)>r&&(t=-1*r),t>0&&(t=0),{newXTransform:e,newYTransform:t}),p9e=function(e){console.log("getBoundingBox called");const t=Math.min(...e.map(i=>i.x)),n=Math.max(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y)),o=Math.max(...e.map(i=>i.y));return[{x:t,y:r},{x:n,y:r},{x:n,y:o},{x:t,y:o}]};function A9e(e,t,n){return Math.min(n,Math.max(t,e))}function v9e(e,t=.05,n=null){const r=Math.min(...e.map(h=>h.x)),o=Math.max(...e.map(h=>h.x)),i=Math.min(...e.map(h=>h.y)),a=Math.max(...e.map(h=>h.y)),s=o-r,c=a-i;let u,d;if(n&&(n==null?void 0:n.x)>=0&&(n==null?void 0:n.y)>=0){const h=n.x,C=n.y;u=Math.max(-r,Math.min(1-o,h-(r+s/2))),d=Math.max(-i,Math.min(1-a,C-(i+c/2)))}else u=Math.max(-r,Math.min(1-o,(Math.random()*2-1)*t)),d=Math.max(-i,Math.min(1-a,(Math.random()*2-1)*t));return e.map(h=>({x:h.x+u,y:h.y+d}))}function b9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.max(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.y));return cH([{x:t,y:r},{x:n,y:o}])}function y9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.max(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.y)),i=(t+n)/2,a=(r+o)/2;return[{x:i,y:a}]}const Kd=(e,t)=>(e.x-t.x)**2+(e.y-t.y)**2,w9e=(e,t,n)=>{const r=Kd(t,n);if(r===0)return Kd(e,t);let o=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;o=Math.max(0,Math.min(1,o));const i={x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)};return Kd(e,i)},x9e=(e,t)=>{let n=1/0;for(let r=0;r<(t==null?void 0:t.length);r++){const o=t[r],i=t[(r+1)%t.length],a=w9e(e,o,i);n=Math.min(n,a)}return Math.sqrt(n)},_9e=(e,t)=>{let n=1/0,r=-1;for(let o=0;o<(t==null?void 0:t.length);o++){const i=t[o],a=aH(e.x,e.y,i.x,i.y);if(a<n){const s=o%t.length;n=a,r=s}}return{minDistance:n,insertIndex:r}},ph=(e=0)=>(e<=0?e=i9e:e>=1&&(e=a9e),e),E9e=e=>e.map(n=>({x:ph(n.x),y:ph(n.y)})),S9e=e=>{const t=new Set,n=[];for(let r=0;r<e.length;r++){const o=`${e[r].x},${e[r].y}`;t.has(o)||(t.add(o),n.push(e[r]))}return n.length>0&&n.push(n[0]),n},M9e=e=>{let t=0;for(let n=0;n<e.length;n++)if(e[n].x<=0){t=t+1;continue}else if(e[n].y<=0){t=t+1;continue}else if(e[n].x>=1){t=t+1;continue}else if(e[n].y>=1){t=t+1;continue}return t};function H9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),r=Math.max(...e.map(s=>s.x)),o=Math.max(...e.map(s=>s.y)),i=t<0?-t:r>1?1-r:0,a=n<0?-n:o>1?1-o:0;return e.map(({x:s,y:c})=>({x:s+i,y:c+a}))}const L9e=(e,t)=>{const n=(e.x+t.x)/2,r=(e.y+t.y)/2,o=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)/2,i=Math.min(n,1-n),a=Math.min(r,1-r),s=Math.min(o,i,a),c=Math.atan2(t.y-e.y,t.x-e.x),u={x:n-s*Math.cos(c),y:r-s*Math.sin(c)},d={x:n+s*Math.cos(c),y:r+s*Math.sin(c)};return[u,d]},B9e=(e,t)=>{const n=(e[0].x+e[1].x)/2,r=t,i=Math.sqrt(Math.pow(e[1].x-e[0].x,2))/2;let a=0;return n-i<0?a=i-n:n+i>1&&(a=1-(n+i)),e[0].x+=a,e[1].x+=a,e[0].y=r,e[1].y=r,e},cH=e=>{e=L9e(e[0],e[1]);const t=(e[0].x+e[1].x)/2,n=(e[0].y+e[1].y)/2,o=Math.sqrt(Math.pow(e[1].x-e[0].x,2)+Math.pow(e[1].y-e[0].y,2))/2;let i=0;t-o<0?i=o-t:t+o>1&&(i=1-(t+o));let a=0;return n-o<0?a=o-n:n+o>1&&(a=1-(n+o)),e[0].x+=i,e[0].y+=a,e[1].x+=i,e[1].y+=a,B9e(e,n)},O9e=(e,t,n)=>{let{x:r,y:o}=uH(e.current,t);const i=n;r=Math.min(r,1),o=Math.min(o,1);const a=r-i.x,s=o-i.y;let c=[];return a===0||s===0?c=[{x:i.x,y:i.y},{x:i.x,y:i.y},{x:i.x,y:i.y},{x:i.x,y:i.y}]:a>0&&s>0?c=[{x:i.x,y:i.y},{x:r,y:i.y},{x:r,y:o},{x:i.x,y:o}]:a>0&&s<0?c=[{x:i.x,y:o},{x:r,y:o},{x:r,y:i.y},{x:i.x,y:i.y}]:a<0&&s>0?c=[{x:r,y:i.y},{x:i.x,y:i.y},{x:i.x,y:o},{x:r,y:o}]:c=[{x:r,y:o},{x:i.x,y:o},{x:i.x,y:i.y},{x:r,y:i.y}],c},uH=(e,t)=>{if(!e)return{x:0,y:0};const n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/(n.right-n.left),y:(t.clientY-n.top)/(n.bottom-n.top)}},R9e=(e,t)=>{if(!e)return{x:0,y:0};const n=e.getBoundingClientRect(),r={x:(t.clientX-n.left)/(n.right-n.left),y:(t.clientY-n.top)/(n.bottom-n.top)};return r.x<=0&&(r.x=1e-4),r.y<=0&&(r.y=1e-4),r.x>=1&&(r.x=1-1e-4),r.y>=1&&(r.y=1-1e-4),r},On={gcd:lH,getDistance:aH,isLeft:gh,windingNumber:mh,getDiameter:Bg,checkPointInsidePolygon:d9e,isAnnotationCoordinatesValid:C9e,distanceToSegment:sH,findClosestSegment:g9e,transformCoordinatesCheck:m9e,getBoundingBox:p9e,translateCoordinatesWithFixedWidth:v9e,clampValue:A9e,calculateCircleFromCoordinates:b9e,calculateCentroid:y9e,minDistanceToPolygon:x9e,closestCoordinates:_9e,fineTuneCoordinates:E9e,zoomLevelValue:B8,createPolygonLoop:S9e,breakPointCount:M9e,getBoundingBoxValues:c9e,shiftPolygon:H9e,getPerfectPointValue:ph,adjustToCircle:cH,getMousePos:uH,getMousePosAbsolute:R9e,getUpdatedCoordinates:O9e},I9e=({imageUrl:e,showAnnotations:t=!1,createAnnotation:n,handleMultipleAnnotations:r,handleUpdateAnnotationCoordinates:o,content_id:i,request_id:a,className:s="",isEditing:c=!1,selectIndex:u="-1",handleSelectAnnotationIndex:d,handleSelectTool:h,showAnnotationType:C="all",loggedUser:m,isCarousel:A=!1,classColorMap:v=null,disableAnnotation:p=!1,SAMToggle:_,imageNumber:w=0,togglePagination:x,handleSAMToggle:E,unSelectedAnnotationIDsSet:S=new Set,setMousePosition:M,allowedToCopyPreview:H=!1,copyCallBackHandler:O,annotationSession:k,SAMToggleValue:D,selectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,handleNextPage:V,handlePreviousPage:T,currentPage:$,handleUpdateImageIndex:K,requestId:q,showPagination:W,isAnnotationCreating:U,contentInfo:G,content_key:J,isAnnotationUpdating:Y,isDeleteAnnotationMutationLoading:ee,showGuidelinesFirst:re,currentImage:ue=0,selectedContent:se=null,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handlePasteAnnotationsByControlV:ae,annotationsResponse:ye,isAnnotationFetching:Re,fetchAnnotationsKey:Ie,request:Ce,parentReqData:et,clearAnnotationCache:fe,RequestInfoModal:ne,getAnnotationFromSAM:pe,getAnnotationsFromSAMPrompt:Ee,fetchAnnotations:Le,pageCount:Be=10,annotationViewType:je="atom",AnnotationPagination:We,REACT_APP_SAM_ENABLED:lt="no",ImageGenerationHelper:tt=ZM,fallbackImageUrl:Qe,activeColor:Fe,Carousel:ot,showTool:Ue=!0})=>{var oi,Ba,f,b,B,z,X,ie,ke,Je,rt,Bt,nn,In,Gn,f0;const Ve=ig().isCtrlPressedFunc,Ge=ig().isAltPressedFunc,[dt,qe]=R.useState(!1),[ft,Pt]=R.useState(!1),Wt=.007,an=.03,Dn=.01,Gt=.005,An=.005,bn=.7,Qt=.005,Ot=.005,Ht=.003,_t=.01,Zt="#40ff00",Cn="#fff",mt="#FFFF00",pt="red",Lt="rgba(0, 255, 255, 1)",Xe="rgba(0, 255, 255, 0.5)",zt="#FF3131",ve=4,it=5,$e={DEFAULT:1.5,SELECTED:4.5,CAROUSAL:2.5,CIRCLE:2},yt=R.useRef(""),Ye=R.useRef(null),Et=R.useRef(null),Rt=R.useRef(null),Vt=BS(),[En,At]=R.useState(!1),[vt,Nt]=R.useState(!1),[nt,Tt]=R.useState([]),[Ut,A1]=R.useState(),[L1,o1]=R.useState(),[Jn,$n]=R.useState({x:-1,y:-1}),[v1,j1]=R.useState(-1),[Jt,Mn]=R.useState({x:0,y:0}),[Dt,cn]=R.useState(u),[jn,D1]=R.useState("-1"),[n1,b1]=R.useState([]),[gn,$t]=R.useState(!1),[yn,Hn]=R.useState(null),[wt,kt]=R.useState({width:0,height:0}),Ft=I1.INITIAL_ZOOM_PROPERTIES,[at,mn]=R.useState(Ft),[Pn,P1]=R.useState(!1),[c1,a0]=R.useState(!1),[un,wn]=R.useState(-1),[tn,jt]=R.useState(!1),Yt=I1.INITIAL_ZOOM_LEVEL,Wn=12,Qn=wt.width*Yt,S1=R.useRef(null),[vn,y2]=R.useState(ye),[Nn,q0]=R.useState(),[pn,fn]=R.useState([]),[Bn,B1]=R.useState(null),r0=I1.SAM_MODEL_NAME,M1=I1.SAM_MODEL_CONFIDENCE,jr=I1.SAM_MODEL_MAX_RESULTS,[P2,Fn]=R.useState(!1),[e1,jo]=R.useState(-1),[A9,ya]=R.useState(null),[zr,wa]=R.useState(null),[v9,b9]=R.useState(null),[f1,L0]=R.useState({modelName:"",modelConfidence:0,modelMaxResults:0,promptMessage:""}),[u2,w2]=R.useState(null),[zo,xa]=R.useState(!1),[v0,S3]=R.useState({x:-1,y:-1}),[X2,M3]=R.useState({left:0,right:0,top:0,bottom:0}),[N2,_a]=R.useState(null),[J2,s0]=R.useState(""),H3={SELECT:2e3,NOT_SELECT:500},[g0,Zr]=R.useState(""),Zo=window.devicePixelRatio,[T1,Uo]=R.useState(window.innerWidth<768*Zo),[y9,G1]=R.useState(window.innerWidth<1200*Zo),d2=R.useRef(null),$o=R.useRef(null),[L3,Ko]=R.useState(!1);R.useEffect(()=>{const be=()=>{Uo(window.innerWidth<768*Zo),G1(window.innerWidth<1200*Zo)};return window.addEventListener("resize",be),()=>window.removeEventListener("resize",be)},[]),R.useEffect(()=>{L3&&Fi()},[L3,at,wt]),R.useEffect(()=>{if(!J2){$o.current=null,Ko(!1);return}const be=new window.Image;be.onload=()=>{$o.current=be,Ko(!0)},be.src=J2},[J2]),R.useEffect(()=>(ht(nt),Yo(),()=>{N2&&clearTimeout(N2)}),[jn]),R.useEffect(()=>{A||document.fullscreenElement||ia.getItem("full_screen")=="yes"&&tr(!1),window.addEventListener("resize",S2)},[]),R.useEffect(()=>{console.log("Change"),Tt([]),Oi(),setTimeout(()=>{ht()},50)},[c]),R.useEffect(()=>{v&&ht(nt)},[v]),R.useEffect(()=>{i&&(i==null?void 0:i.length)>0&&e0()},[i]),R.useEffect(()=>{y2(ye||null)},[ye,i]),R.useEffect(()=>{if(e){const be=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1));f2(be)}Tt([])},[e]),R.useEffect(()=>{J2&&(yt.current=J2,O1())},[J2]),R.useEffect(()=>{yt.current&&S2()},[yt.current,J2]),R.useEffect(()=>{_=="SAM"?P1(!0):P1(!1),B3()},[_]),R.useEffect(()=>{at.scale==1&&(at.x!=0||at.y!=0)&&e0()},[at.scale]),R.useEffect(()=>{if(((vn==null?void 0:vn.result)||[]).length>=0){const{x:be,y:ge}=On.getMousePos(Ye.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});O1(nt,{x:be,y:ge})}},[wt,t,at.scale,jn]),R.useEffect(()=>{Oi(),((vn==null?void 0:vn.result)||[]).length>=0&&ht()},[n1,Dt]),R.useEffect(()=>{if(Ce&&vn&&(vn!=null&&vn.result)&&((vn==null?void 0:vn.result)||[]).length>=0){ht(nt);const be={},ge={};for(let Me=0;Me<vn.result.length;Me++)be[vn.result[Me].awi_id]={...vn.result[Me],index:Me},(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&(ge[vn.result[Me].awi_id]=On.getBoundingBoxValues(vn.result[Me].awi_coords));wa(be),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&B1(ge),(Ce==null?void 0:Ce.awi_request_for)=="attributes"&&vn.result.length>0&&u=="-1"&&typeof d=="function"&&setTimeout(()=>{d(vn.result[0].awi_id)},100)}else wa(null),B1(null);x9()},[Ce,vn]),R.useEffect(()=>{x9()},[S]),R.useEffect(()=>{console.log("Filter annotation change"),O1(nt),setTimeout(()=>{O1(nt)},100)},[pn]),R.useEffect(()=>{u!=="-1"?typeof h=="function"&&(Ce==null?void 0:Ce.awi_request_for)!=="outline"&&h("edit"):b1([]),Pn&&typeof h=="function"&&cn("-1"),cn(u||"-1")},[u]),R.useEffect(()=>{A||w==0&&Pn!==void 0&&(Pn?W1.success("Switched to Auto Annotation mode"):Ce!=null&&Ce.awi_annotation_type&&W1.success(`Switched to ${Ce==null?void 0:Ce.awi_annotation_type} Annotation mode`))},[Pn]),R.useEffect(()=>{if(!M||typeof M!="function")return;qo();const be=setTimeout(()=>{const{x:ge,y:Me}=On.getMousePosAbsolute(Ye.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});M({x:ge,y:Me})},30);return()=>clearTimeout(be)},[Ut]),R.useEffect(()=>{c1?qo():ei(-1,-1)},[c1]),R.useEffect(()=>{u!="-1"&&zr&&q0(zr[u])},[u,zr]),R.useEffect(()=>{Go(),qo()},[at,wt]);const a4=be=>{const ge=be.message;Zr(ge)};R.useEffect(()=>{let be="";U?be="Creating Annotation...":ee?be="Deleting Annotation...":Y?be="Updating Annotation...":Re?be="Fetching Annotations...":tn&&(be="Generating AI Annotations..."),a4({message:be})},[U,Y,ee,Re,tn]),R.useEffect(()=>{S2()},[W]);const Wo=pe&&typeof pe=="function"?ob(pe):null,Qo=Ee&&typeof Ee=="function"?ob(Ee):null,x2=()=>!!(dt||Ve()),X0=()=>!!(ft||Ge()),Go=()=>{const be=wt.width*at.scale,ge=wt.height*at.scale;M3({left:Math.abs(at.x),right:Math.max(0,be-wt.width+at.x),top:Math.abs(at.y),bottom:Math.max(0,ge-wt.height+at.y)})},Bi=R.useMemo(()=>{const be=(vn==null?void 0:vn.result)||[];if(be.length>0&&Dt!=="-1"){let ge=null,Me=null;const Te=be.reduce((De,ut)=>{const{awi_id:xt}=ut;return xt===Dt?ge=ut:xt===jn?Me=ut:S.has(xt)||De.push(ut),De},[]);return Me&&Te.push(Me),ge&&Te.push(ge),Te}else return pn},[Dt,jn,pn]),f2=async be=>{pS.checkImageValidity(be,s0,i,je,Qe)},Oi=()=>{jn!="-1"&&(N2&&clearTimeout(N2),D1("-1"))},Yo=()=>{if(jn!=="-1")if(Dt=="-1"||I1.HOVER_TO_SELECT_ON_ALREADY_SELECTED){const be=Dt=="-1"?H3.NOT_SELECT:H3.SELECT;N2&&clearTimeout(N2);const ge=setTimeout(()=>{c&&jn!="-1"&&Dt!=jn&&(Dt=="-1"&&gn?Yo():typeof d=="function"&&(d(jn),W1.success("Annotation selected successfully",jn)))},be);_a(ge)}else N2&&clearTimeout(N2);else N2&&clearTimeout(N2)},qo=()=>{const be=Et.current;if(!be)return;const ge=wt.width*at.scale,Me=wt.height*at.scale;if(be.width=ge,be.height=Me,c1){const{x:Te,y:De}=On.getMousePosAbsolute(Et.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});ei(Te,De)}},_2=()=>{Tt([])},Xo=(be=!1)=>{Vt.invalidateQueries(Ie),be&&Tt([])},E2=be=>{var ge;if(zr&&zr[be])if(c){const Me=zr[be].index,Te=vn==null?void 0:vn.result[Me];return Te||((ge=vn==null?void 0:vn.result)==null?void 0:ge.find(De=>De.awi_id==be))}else return zr[be];else return null},w9=be=>v9&&v9[be]?v9[be].index:-1,B3=()=>{nt.length>0&&(console.log("clearCoordinate"),Tt([]),O1([],{x:0,y:0},!0))},x9=()=>{if(Ce&&((vn==null?void 0:vn.result)||[]).length>=0){let be=[];(S==null?void 0:S.size)>0?be=((vn==null?void 0:vn.result)||[]).filter(Me=>!S.has(Me.awi_id)):be=(vn==null?void 0:vn.result)||[];const ge={};for(let Me=0;Me<be.length;Me++)ge[be[Me].awi_id]={...be[Me],index:Me};b9(ge),fn(be)}else fn([])},t1=be=>(T1&&(be=be*3),On.zoomLevelValue(be,at.scale)),T2=new Map,Ri=be=>{try{if(!be)return Promise.resolve(I1.DEFAULT_CANVAS_RATION);if(T2.has(be))return T2.get(be);const ge=new Promise((Me,Te)=>{const De=new Image;De.onload=()=>{const xt={w:De.width,h:De.height};T2.set(be,Promise.resolve(xt)),Me(xt)},De.onerror=Te;const ut=tt.getImageKitUrl(be,-1,-1,1);ut&&(De.src=ut)});return T2.set(be,ge),ge}catch(ge){return console.error(ge),Promise.resolve(I1.DEFAULT_CANVAS_RATION)}},S2=async()=>{var be,ge,Me,Te,De;if(console.log("updateDimensions called"),((be=yt.current)==null?void 0:be.length)>0){console.log("Canvas true");let ut=I1.DEFAULT_CANVAS_RATION;xa(!0);try{ut=await Ri(yt.current)}catch(Kt){console.error("Error fetching image dimensions:",Kt,yt.current),ut=I1.DEFAULT_CANVAS_RATION}const xt=On.gcd(ut.w,ut.h),Xt={w:ut.w/xt,h:ut.h/xt};let hn=0,Ct=0;if(Ct=((ge=Rt.current)==null?void 0:ge.offsetHeight)||0,hn=Ct*Xt.w/Xt.h,hn>(((Me=Rt.current)==null?void 0:Me.offsetWidth)||0)&&(hn=((Te=Rt.current)==null?void 0:Te.offsetWidth)||0,Ct=hn*Xt.h/Xt.w),(Ye==null?void 0:Ye.current)!=null&&(Ye.current.width=hn,Ye.current.height=Ct,u2==null)){const Kt=(De=Ye.current)==null?void 0:De.getBoundingClientRect();w2({left:Kt==null?void 0:Kt.left,top:Kt==null?void 0:Kt.top})}kt({width:hn,height:Ct}),xa(!1),O1(nt)}},Ur=R.useCallback((be,ge,Me,Te,De,ut)=>On.checkPointInsidePolygon(be,ge,Me,Te,De,ut,at.scale),[]),mr=(be,ge=!0)=>{const{x:Me,y:Te}=On.getMousePos(Ye.current,be);let De="",ut=1/0;if(c&&Jo(Me,Te))return[Dt];const xt=pn||[];if(!ge&&(xt==null?void 0:xt.length)>I1.MAX_ANNOTATIONS_TO_HOVER)return[];switch(Ce==null?void 0:Ce.awi_annotation_type){case"circle":{xt.forEach(({awi_coords:Xt,awi_id:hn})=>{if(Ur(Me,Te,Xt,0,0,Ce)){const Ct=On.minDistanceToPolygon({x:Me,y:Te},Xt);Ct<ut&&(De=hn,ut=Ct)}});break}case"dot":{const Xt=t1(An);xt.forEach(({awi_coords:hn,awi_id:Ct})=>{if(Ur(Me,Te,hn,Xt,Xt,Ce)){const Kt=On.minDistanceToPolygon({x:Me,y:Te},hn);Kt<ut&&(De=Ct,ut=Kt)}});break}case"rectangle":{const Xt=t1(Qt)/2;for(let hn=0;hn<xt.length;hn++){const{awi_coords:Ct,awi_id:Kt}=xt[hn];if(Ur(Me,Te,Ct,Xt,0,Ce)){const x1=On.minDistanceToPolygon({x:Me,y:Te},Ct);x1<ut&&(De=Kt,ut=x1)}}break}case"polygon":{for(let Xt=0;Xt<xt.length;Xt++){const{awi_coords:hn,awi_id:Ct}=xt[Xt];if(Bn){const Kt=Bn[Ct];if(Kt){const{minX:x1,minY:ce,maxX:h0,maxY:B0}=Kt;if(Me<x1||Me>h0||Te<ce||Te>B0)continue}}if(Ur(Me,Te,hn,0,0,Ce)){const Kt=On.minDistanceToPolygon({x:Me,y:Te},hn);Kt<ut&&(De=Ct,ut=Kt)}}break}default:console.warn(`Unknown annotation type: ${Ce==null?void 0:Ce.awi_annotation_type}`);break}return De&&De.length>0?(ge&&cn(De),[De]):(ge&&(console.log("setSelectAnnotationId "),typeof d=="function"&&u!="-1"&&d("-1",!1)),[])},s4=cl.throttle(mr,50),Jo=(be,ge)=>{const Me=E2(u);if(Me){const Te=Me.awi_coords;if((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"){const De=On.minDistanceToPolygon({x:be,y:ge},Te),ut=t1(Ot);return De<=ut}else if((Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"){const{insertIndex:De,minDistance:ut}=On.closestCoordinates({x:be,y:ge},Te),xt=t1(Ot);return console.log(De),ut<=xt}}else return!1},O3=(be,ge)=>{const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=E2(ge);if(console.log("selectAnnotation",De),De){const{awi_coords:ut}=De;if(ut.length===1){const Ct=t1(Gt);Ur(Me,Te,ut,Ct,Ct,Ce)&&(Nt(!0),$t(!0),o1({x:Me,y:Te}),Tt(ut));return}if(ut.length===2){const{x:Ct,y:Kt}=ut[0],{x:x1,y:ce}=ut[1],h0=On.getDiameter([{x:Ct,y:Kt},{x:x1,y:ce}])/2,B0=(Ct+x1)/2,m1=(Kt+ce)/2;Nt(!0),$t(!0),o1({x:Me,y:Te}),$n({x:Me,y:Te}),Tt(ut);const rn=(Me-B0)*(Me-B0)+(Te-m1)*(Te-m1),_0=t1(bn);rn>_0*_0*h0*h0&&$t(!1);return}const xt=x2()?0:t1(Wt),Xt=Ur(Me,Te,ut,xt,0,Ce),hn=Jo(Me,Te);if(!Xt&&!hn)$n({x:-1,y:-1}),o1({x:0,y:0}),$t(!1);else{if(o1({x:Me,y:Te}),Nt(!0),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon")if(x2())$t(!0);else if(Ur(Me,Te,ut,xt,0,Ce)){const{minDistance:Kt}=On.findClosestSegment(ut,Me,Te),x1=t1(_t);Kt>=x1?$t(!0):$t(!1)}else $t(!1);else $t(!0);Tt(ut),$n({x:-1,y:-1}),x2()||ut.forEach((Ct,Kt)=>{if(Me<=Ct.x+xt&&Me>=Ct.x&&Te<=Ct.y+xt&&Te>=Ct.y||Me>=Ct.x-xt&&Me<=Ct.x&&Te>=Ct.y-xt&&Te<=Ct.y||Me<=Ct.x+xt&&Me>=Ct.x&&Te>=Ct.y-xt&&Te<=Ct.y||Me>=Ct.x-xt&&Me<=Ct.x&&Te<=Ct.y+xt&&Te>=Ct.y){if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon")c?($n({x:Me,y:Te}),j1(Kt)):(j1(Kt),$n(ut[Kt])),console.log("setSelectCornerCoordinates");else if((Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"&&!Pn){const x1=ut[(Kt+2)%4];$n(x1)}else if(c){const x1=ut[(Kt+2)%4];$n(x1)}else j1(Kt),$n(ut[Kt]);$t(!1),Tt([])}})}}},Ii=(be="all")=>{const ge=window.devicePixelRatio;if(be!="cross"&&Ye.current)if(at.scale==1){const Me=+getComputedStyle(Ye.current).getPropertyValue("height").slice(0,-2),Te=+getComputedStyle(Ye.current).getPropertyValue("width").slice(0,-2);Ye.current.setAttribute("height",(Me*ge).toString()),Ye.current.setAttribute("width",(Te*ge).toString())}else{const Me=wt.height*at.scale,Te=wt.width*at.scale;Ye.current.setAttribute("height",(Me*ge).toString()),Ye.current.setAttribute("width",(Te*ge).toString())}if(Et.current)if(at.scale==1){const Me=+getComputedStyle(Et.current).getPropertyValue("height").slice(0,-2),Te=+getComputedStyle(Et.current).getPropertyValue("width").slice(0,-2);Et.current.setAttribute("height",(Me*ge).toString()),Et.current.setAttribute("width",(Te*ge).toString())}else{const Me=wt.height*at.scale,Te=wt.width*at.scale;Et.current.setAttribute("height",(Me*ge).toString()),Et.current.setAttribute("width",(Te*ge).toString())}},Co=(be,ge)=>{const Me=On.getDistance(be.x,be.y,ge.x,ge.y),Te=t1(Wt),De=t1(Dn);if(Me<=De){let ut=!1;return Me<=Te?ut=!1:Me<=De&&(ut=!0),{success:!0,distance:Me,zoomClosePoint:Te,zoomPointAnnotationValue:De,isExtraPointNeeded:ut}}else return{success:!1,distance:Me,zoomClosePoint:Te,zoomPointAnnotationValue:De,isExtraPointNeeded:!1}},$r=(be=[],ge={x:0,y:0},Me=!1,Te=!1,De)=>{if((be||[]).length>0){De.beginPath();const ut=M2(be);if((Ce==null?void 0:Ce.awi_annotation_type)==="rectangle")if(Pn){if(c){De.moveTo(ut[0].x,ut[0].y);for(let xt=1;xt<ut.length;xt++)De.lineTo(ut[xt].x,ut[xt].y);De.closePath()}else if(Pn){console.log("Sam function");const xt=M2(be);De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,xt.forEach(Xt=>{De.beginPath(),De.arc(Xt.x,Xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}}else{De.moveTo(ut[0].x,ut[0].y);for(let xt=1;xt<ut.length;xt++)De.lineTo(ut[xt].x,ut[xt].y);De.closePath()}else if((Ce==null?void 0:Ce.awi_annotation_type)==="circle")if(Pn&&!c){const xt=M2(be);console.log("coordinatesVal ",xt),De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,xt.forEach(Xt=>{De.beginPath(),De.arc(Xt.x,Xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}else{const xt=On.getDiameter(ut);De.arc((ut[0].x+ut[1].x)/2,(ut[0].y+ut[1].y)/2,Math.floor(xt/2),0,I1.TWO_PIE)}De.save(),De.lineWidth=$e.DEFAULT,De.strokeStyle=Zt,De.stroke()}if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&(nt||[]).length>0&&!Me&&!c){if(!Pn){const ut=M2(nt);if(De.beginPath(),De.lineWidth=$e.DEFAULT,De.strokeStyle=Zt,ut.forEach((xt,Xt)=>{if(Xt>0){const hn=ut[Xt-1];De.moveTo(hn.x,hn.y),De.lineTo(xt.x,xt.y)}}),De.stroke(),ut.forEach((xt,Xt)=>{De.beginPath(),De.arc(xt.x,xt.y,it,0,I1.TWO_PIE,!0),De.fillStyle=Xt===0?mt:Zt,De.fill()}),!X0()&&!Te&&ge&&ge.x>0&&ge.y>0&&!(ge.x>.998||ge.y>.998||ge.x<.002||ge.y<.002)){const xt=M2([ge]);De.beginPath();const Xt=Co(nt[0],ge);Xt!=null&&Xt.success&&(nt==null?void 0:nt.length)>2?Xt.isExtraPointNeeded?(De.beginPath(),De.rect(xt[0].x-ve*3,xt[0].y-ve*3,ve*6,ve*6),De.fillStyle=pt,De.fill(),De.lineWidth=4,De.strokeStyle=pt,De.stroke()):(De.beginPath(),De.rect(xt[0].x-ve*3,xt[0].y-ve*3,ve*6,ve*6),De.fillStyle=mt,De.fill(),De.lineWidth=2,De.strokeStyle=mt,De.stroke()):De.arc(xt[0].x,xt[0].y,ve,0,I1.TWO_PIE,!0),De.fillStyle="rgba(0,0,0,0.35)",De.fill(),De.strokeStyle=Zt,De.stroke();const hn=ut[ut.length-1];De.beginPath(),De.moveTo(hn.x,hn.y),De.lineTo(xt[0].x,xt[0].y),De.strokeStyle="#ff0000",De.setLineDash([5,5]),De.lineWidth=$e.DEFAULT,De.stroke(),De.setLineDash([])}De.closePath(),De.lineWidth=$e.DEFAULT,De.stroke(),De.save()}if(Pn){const ut=M2(be);De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,ut.forEach(xt=>{De.beginPath(),De.arc(xt.x,xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}}},ei=(be,ge)=>{const Me=Et.current;if(!Me)return;const Te=Me.getContext("2d");if(!Te||(Te.clearRect(0,0,Me.width,Me.height),be==-1&&ge==-1))return;Ii("cross");const De=M2([{x:be,y:ge}])[0],ut=De.x,xt=De.y;Te.strokeStyle="#800080",Te.lineWidth=$e.CAROUSAL,Te.setLineDash([3,3]),Te.beginPath(),Te.moveTo(ut,0),Te.lineTo(ut,Me.height),Te.stroke(),Te.beginPath(),Te.moveTo(0,xt),Te.lineTo(Me.width,xt),Te.stroke(),Te.setLineDash([])},O1=(be=[],ge={x:0,y:0},Me=!1,Te=!1,De=0)=>{var ut,xt,Xt,hn;if(Ce&&!zo){const Ct=(ut=Ye.current)==null?void 0:ut.getContext("2d");if(Ii(),Ct!=null){Ct.imageSmoothingEnabled=!1,Ct.clearRect(0,0,wt.width,wt.height),!c&&(Ce==null?void 0:Ce.awi_request_for)!="attributes"&&$r(be,ge,Me,Te,Ct);const Kt=Bi||[];for(let x1=0;x1<Kt.length;x1++){const ce=Kt[x1],{awi_coords:h0,awi_id:B0,awi_status:m1}=ce;if(h0.length===0)return;const rn=M2(h0);Ct.beginPath(),Ct.lineJoin="round";let _0=!1,t2="",j2="";if(C==="all"||m1===C){ce.awi_status==="pending"?t2=ce.awi_outline_status==="approved"?"rgba(214, 204, 60, 0.3)":"rgba(0, 0, 0,0)":t2=I1.STATUS_COLOR_MAP[ce.awi_status]||"rgba(0, 0, 0,0)",j2=t2;let Yr=!1;if(B0===Dt?(Ct.lineWidth=$e.SELECTED,Ct.strokeStyle=Zt,Ct.fillStyle="rgba(0,0,0,0.40)",Yr=!0):B0===jn&&(Ct.lineWidth=$e.DEFAULT,Ct.strokeStyle=Lt,Ct.fillStyle=Xe,Yr=!0),!Yr)if(Ct.fillStyle=t2,A?Ct.lineWidth=$e.CAROUSAL:Ct.lineWidth=$e.DEFAULT,v){const n2=v[ce.awi_classes[0].awi_id];n2?(j2=n2,Ct.strokeStyle=n2):(j2=ce.awi_classes[0].awi_color,Ct.strokeStyle=ce.awi_classes[0].awi_color)}else j2=ce.awi_classes[0].awi_color,Ct.strokeStyle=ce.awi_classes[0].awi_color;switch(Ce==null?void 0:Ce.awi_annotation_type){case"circle":{const n2=(rn[0].x+rn[1].x)/2,ii=(rn[0].y+rn[1].y)/2,D3=Math.sqrt(Math.pow(rn[1].x-rn[0].x,2)+Math.pow(rn[1].y-rn[0].y,2));Ct.beginPath(),Ct.arc(n2,ii,D3/2,0,I1.TWO_PIE),Ct.stroke(),Ct.closePath(),_0=!0;break}case"dot":{Ct.beginPath(),Ct.moveTo(rn[0].x,rn[0].y),Ct.arc(rn[0].x,rn[0].y,ve,0,I1.TWO_PIE,!0),Ct.stroke(),Ct.closePath(),_0=!0;break}case"rectangle":{Ct.beginPath(),Ct.moveTo((xt=rn[0])==null?void 0:xt.x,(Xt=rn[0])==null?void 0:Xt.y);for(let n2=1;n2<rn.length;n2++)Ct.lineTo(rn[n2].x,rn[n2].y);Ct.closePath(),Ct.stroke(),_0=!0;break}case"polygon":{_0=!0,Ct.moveTo(rn[0].x,rn[0].y);const n2=rn.length;for(let ii=0;ii<n2;ii++)Ct.lineTo(rn[ii].x,rn[ii].y);break}}if(Ct.fill(),Ct.save(),Ct.stroke(),_0){Ct.save();const n2=B0===Dt,ii=B0===jn,D3=ce.sam_status==="yes";rn.forEach((Nl,c4)=>{Ct.beginPath();let H2=ve,qr="";n2?rn.length==1&&(Ce==null?void 0:Ce.awi_annotation_type)=="dot"||Te&&c4%(rn.length-1)==De?(H2=ve*2,qr=Zt):(qr=Zt,H2=ve):ii?(qr=Lt,H2=ve):(qr=j2,H2=ve),(Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?c4%(rn.length-1)==0&&(D3?qr=zt:qr=mt):c4==0&&rn.length>1&&D3&&(qr=zt),Ct.arc(Nl.x,Nl.y,H2,0,2*Math.PI,!0),Ct.fillStyle=qr,Ct.strokeStyle=qr,Ct.fill(),Ct.stroke(),Ct.restore()})}else console.log("Error")}}}qo()}if(at.scale==1&&(Ye!=null&&Ye.current)){const Ct=(hn=Ye==null?void 0:Ye.current)==null?void 0:hn.getBoundingClientRect();w2({top:Ct==null?void 0:Ct.top,left:Ct==null?void 0:Ct.left})}},M2=be=>be.map(Me=>({x:Me.x*Ye.current.width,y:Me.y*Ye.current.height})),Kr=be=>{const{x:ge,y:Me}=On.getMousePos(Ye.current,be);Tt(Te=>{const De=[...Te];return De[1].x=ge,De[1].y=Me,On.adjustToCircle(De)})},l0=be=>{if(be.length===0)return!1;const ge=On.isAnnotationCoordinatesValid(Ce,be,Pn,at.scale);return ge||O1(),ge},R3=(be,ge)=>(console.log("Has Moved checking"),Math.abs(be.x-ge.x)>0||Math.abs(be.y-ge.y)>0),go=()=>{if((nt==null?void 0:nt.length)>1){const be=nt[nt.length-1],ge=[];let Me=!1;for(let Te=0;Te<nt.length-1;Te++){const De=nt[Te],ut=t1(Gt);if(Math.abs(be.x-De.x)<=ut&&Math.abs(be.y-De.y)<=ut){Me=!0;continue}else ge.push({x:De.x,y:De.y})}return Me||ge.push(nt[nt.length-1]),Tt(ge),ge}else return nt},I3=()=>{if(typeof n=="function")if(nt.length>3){const be=Co(nt[0],nt[nt.length-1]);let ge=[];be.success&&(be.isExtraPointNeeded==!1?(nt[nt.length-1].x=nt[0].x,nt[nt.length-1].y=nt[0].y,ge=nt):be.isExtraPointNeeded&&(ge=[...nt,{x:nt[0].x,y:nt[0].y}])),(ge==null?void 0:ge.length)>0?(Tt([]),n(ge,null,!1,()=>{_2()})):O1(nt)}else O1(nt)},Z0=(be,ge)=>{console.log("deletePolygonPoint"),console.log("selectIndex ",ge);const Me=[];for(let Te=0;Te<be.length;Te++)Te!=ge&&Me.push(be[Te]);ge==0&&(Me[Me.length-1]=Me[0]),Tt(Me),(Me==null?void 0:Me.length)>3?(O1(Me),typeof o=="function"&&l0(Me)&&!p&&(W1.success("Point deleted successfully"),o(Me,u,()=>{_2()}))):W1.error("Point can not be deleted, as polygon need minimum of three points"),jo(-1),ya(null)};function J0(be,ge){console.log("handleAddAnnotationPoint");const Me=be.target;if(!(Me!=null&&Me.getBoundingClientRect))return;const Te=Me.getBoundingClientRect(),De=(be.clientX-Te.left)/Te.width,ut=(be.clientY-Te.top)/Te.height,{insertIndex:xt,minDistance:Xt}=On.closestCoordinates({x:De,y:ut},ge),hn=t1(Wt);if(Xt<hn){console.log("Very close point to insert"),console.log("minDistanceMin",Xt);const ce=t1(an);if(Xt<ce&&x2())console.log("We can remove this"),(ge==null?void 0:ge.length)>3&&(ya(ge),I1.POLYGON_POINT_REMOVE_CONFIRM_PROMPT?jo(xt):Z0(ge,xt));else{if(Xt<ce)W1.error("Press CTRL and then click to prompt for point deletion");else{const h0=(Xt*100).toFixed(1);W1.error("Very close point to draw "+h0+" it should be more than "+Wt*100)}jo(-1),ya(null)}return}if(x2())return;jo(-1),ya(null);const{insertIndex:Ct,minDistance:Kt}=On.findClosestSegment(ge,De,ut),x1=t1(_t);Kt>=x1||(ge.splice(Ct,0,{x:De,y:ut}),Tt(ge),O1(ge),typeof o=="function"&&l0(nt)&&!p&&o(nt,u,()=>{_2()}))}const ti=be=>{M&&typeof M<"u"&&typeof M=="function"&&(M({x:-1,y:-1}),ei(-1,-1)),Di(be,!0),jn!="-1"?Oi():(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&!c&&!A&&!Pn&&nt.length>0&&setTimeout(()=>{O1(nt)},200)},ki=be=>{if(!Pn){if((gn||vt&&Jn.x!==-1&&Jn.y!==-1)&&R3(L1,On.getMousePos(Ye.current,be))){const ge=E2(u);if(ge){const Me=l0(ge.awi_coords);if(typeof o=="function"&&Me)if(Jn.x!==-1&&Jn.y!==-1)if((Ce==null?void 0:Ce.awi_annotation_type)=="polygon")o(ge.awi_coords,Dt);else{const Te=On.getUpdatedCoordinates(Ye,be,Jn);o(Te,Dt)}else o(ge.awi_coords,Dt);else Me||((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&F2(ge.awi_coords,be),Xo(!0))}}En?(At(!1),typeof n=="function"&&l0(nt)&&((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?I3():n(nt,null,!1,()=>{_2()}))):vt&&(Nt(!1),cn("-1"),b1([]),typeof d=="function"&&d("-1"))}},Ea=be=>{if(!(Ye!=null&&Ye.current))return;const ge=s4(be,!1);(ge==null?void 0:ge.length)>0&&ge[0]!=Dt?(Yo(),D1(ge[0]),Ye.current.style.cursor="pointer"):jn!="-1"&&(D1("-1"),Dt=="-1"&&(Ye.current.style.cursor="default"))},_9=(be,ge=!1)=>{if(ge){ht(nt);return}const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=E2(u);if(De){const ut=De.awi_coords,{minDistance:xt,insertIndex:Xt}=On.closestCoordinates({x:Me,y:Te},ut),hn=t1(Qt);if(xt<=hn&&Ye.current){const Ct=Ye.current.getContext("2d");if(!Ct||Xt==un)return;Ye.current.style.cursor="pointer",wn(Xt),Ye.current.title="Point "+(Xt+1);const Kt=M2([ut[Xt]])[0];Ct.fillStyle=Cn,Ct.beginPath(),Ct.arc(Kt.x,Kt.y,ve*2.5,0,I1.TWO_PIE),Ct.strokeStyle="black",Ct.lineWidth=$e.SELECTED,Ct.stroke(),Ct.fill()}else if(Ye.current){if(!Ye.current.getContext("2d"))return;const Kt=t1(Ht);un!==-1&&(ht(),wn(-1)),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&On.findClosestSegment(ut,Me,Te).minDistance<=Kt?(Ye.current.style.cursor="pointer",Ye.current.title="Add point"):(Ye.current.style.cursor="default",Ye.current.title="")}}},Di=Br.useThrottle(_9,100),ni=Br.useThrottle(Ea,100),F2=(be,ge)=>{if(On.breakPointCount(be)>0){console.log("================================BREAK================================"),$t(!1),ge&&ge.stopPropagation&&(ge==null||ge.stopPropagation());const Te=On.shiftPolygon(be);if(typeof o=="function"&&l0(Te)){const De=u;o(Te,u,()=>{Dt!=De&&cn(De),_2()})}}},Ze=()=>pn.length>I1.MAX_ANNOTATIONS_TO_RUN_FAST?ht:O1,ht=Br.useThrottle((be,ge,Me=!1,Te=!1,De=-1)=>{O1(be,ge,Me,Te,De)},50),st=(be="forward")=>{if((pn||[]).length!=0)if(be=="last_update"){const ge=pn==null?void 0:pn.reduce((Me,Te)=>{const De=new Date(Me.awi_last_updation).getTime();return new Date(Te.awi_last_updation).getTime()>De?Te:Me});ge&&(cn(ge.awi_id),typeof d=="function"&&d(ge.awi_id))}else if(u==="-1")(pn||[]).length>0&&(cn(pn[0].awi_id),typeof d=="function"&&d(pn[0].awi_id));else{const ge=w9(u);be=="backward"?ge!==-1?ge>0?(cn(pn[ge-1].awi_id),typeof d=="function"&&d(pn[ge-1].awi_id)):(cn(pn[pn.length-1].awi_id),typeof d=="function"&&d(pn[pn.length-1].awi_id)):(pn||[]).length>0&&(cn(pn[pn.length-1].awi_id),typeof d=="function"&&d(pn[pn.length-1].awi_id)):ge!==-1?(pn||[]).length>ge+1?(cn((pn||[])[ge+1].awi_id),typeof d=="function"&&d((pn||[])[ge+1].awi_id)):(cn((pn||[])[0].awi_id),typeof d=="function"&&d((pn||[])[0].awi_id)):(pn||[]).length>0&&(cn(pn[0].awi_id),typeof d=="function"&&d(pn[0].awi_id))}},sn=()=>{if(console.log("handleCompleteAnnotation"),!(!Ce||c))if(_==="SAM"){vo();return}else{if((Ce==null?void 0:Ce.awi_annotation_type)!="polygon")return;if(typeof n=="function"&&l0(nt))if((nt==null?void 0:nt.length)>2){const be=[...nt,{x:nt[0].x,y:nt[0].y}];Tt([]),n(be,null,!1,()=>{_2()})}else{W1.error("Polygon requires minimum of three coordinates");return}else W1.error("Invalid coordinates, please create valid coordinates")}},Un=be=>{console.log("handle Complete Multiple Annotation SAM");const ge=[];for(let Me=0;Me<(be==null?void 0:be.length);Me++){const Te=be[Me].outline,De=be[Me].classId;if(l0(Te)){const xt={coords:(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?On.createPolygonLoop(Te):Te,classId:De,isSam:!0};ge.push(xt)}}(ge==null?void 0:ge.length)>0&&typeof r=="function"&&(Tt([]),r(ge,()=>{(ge==null?void 0:ge.length)>0&&Xo()}))},h1=()=>{if(console.log("undoAnnotationPoint"),console.log("coordinates ------>",nt),u!="-1"){Ma();return}if(nt.length>0&&(Ce==null?void 0:Ce.awi_annotation_type)==="polygon")nt.pop(),Tt([...nt]),O1(nt);else if(nt.length>0&&Pn)nt.pop(),Tt([...nt]),O1(nt);else return},e0=()=>{mn(Ft)},R1=(be,ge="zoom-in")=>{if(Ye.current&&Ye)if(ge=="zoom-in"){const Me=Yt,Te=at.scale+Me,De=Ye.current.getBoundingClientRect(),ut=be.clientX-De.left,xt=be.clientY-De.top,Xt=Te/at.scale,hn=at.x-ut*(Xt-1),Ct=at.y-xt*(Xt-1),Kt={scale:+Te.toFixed(2),x:hn,y:Ct};mn(Kt),S3({x:be.clientX,y:be.clientY})}else{const Me=Yt,Te=at.scale-Me;if(Te==1)e0();else{const De=Ye.current.getBoundingClientRect();(v0.x==-1||v0.y==-1)&&console.log("zoomTimeMousePoint");const ut=v0.x!=-1?v0.x:be.clientX,xt=v0.y!=-1?v0.y:be.clientY,Xt=ut-De.left,hn=xt-De.top,Ct=Te/at.scale,Kt=-Math.abs(at.x+Xt*(1-Ct)),x1=-Math.abs(at.y+hn*(1-Ct)),ce=wt.width*(at.scale+Yt-1),h0=wt.height*(at.scale+Yt-1),{newXTransform:B0,newYTransform:m1}=On.transformCoordinatesCheck(Kt,x1,ce,h0),rn={scale:+Te.toFixed(2),x:B0,y:m1};mn(rn)}}},mo=(be=null)=>{if(at.scale!==Wn&&Ye.current)if(!be||!be.clientX||!be.clientY||be.type=="click"){const ge=wt.width*(at.scale+Yt-1),Me=wt.height*(at.scale+Yt-1),Te=at.x-wt.width*Yt/2,De=at.y-wt.height*Yt/2,{newXTransform:ut,newYTransform:xt}=On.transformCoordinatesCheck(Te,De,ge,Me),Xt={scale:+(at.scale+Yt).toFixed(2),x:ut,y:xt};mn(Xt)}else R1(be,"zoom-in")},e2=(be=null)=>{if(at.scale!==1&&Ye.current)if(!be||!be.clientX||!be.clientY||be.type=="click"){const ge=wt.width*(at.scale-Yt-1),Me=wt.height*(at.scale-Yt-1),Te=at.x+wt.width*Yt/2,De=at.y+wt.height*Yt/2,{newXTransform:ut,newYTransform:xt}=On.transformCoordinatesCheck(Te,De,ge,Me);mn({scale:+(at.scale-Yt).toFixed(2),x:ut,y:xt})}else R1(be,"zoom-out")},x0=be=>{be.deltaY<0?mo(be):e2(be)},po=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x+Qn,Te=at.y,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},Ao=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x-Qn,Te=at.y,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},pr=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x,Te=at.y+Qn,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},Wr=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x,Te=at.y-Qn,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})};if(!e||!i)return null;const vo=()=>{if(tn){W1.error("Request already in progress");return}if(!(nt!=null&&nt.length)){W1.error("No points to send");return}const be={};be.image_url=e,be.coords=nt,console.log("Sent to SAM",be),Pi(),typeof h=="function"&&h("annotate")},u1=()=>{if(P2?Fn(!1):P2||Fn(!0),tn){W1.error("Request already in progress");return}typeof h=="function"&&h("annotate")},l4=be=>{console.log("Submitted data from SAMModal:",be),bo(be),typeof h=="function"&&h("annotate")},bo=be=>{if(!Qo||!(Qo!=null&&Qo.mutate)){W1.error("SAM Prompt is not available");return}console.log("getSAMAnnotationsPrompt");const ge=be.awi_annotation_prompt,Me=be.model_confidence,Te=be.model_name,De=be.model_max_results;L0({modelName:Te,modelConfidence:Me,modelMaxResults:De,promptMessage:ge});const ut=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1)),Xt={requestId:a||0,contents:[{url:J2||ut,contentKey:i,directPrompt:ge||""}],confidence:Me||M1,modelName:Te||r0,modelMaxResults:De||jr};jt(!0),Qo.mutate(Xt,{onSuccess:hn=>{var Ct,Kt,x1,ce,h0;if(jt(!1),!hn.success)W1.error(hn.message);else{Fn(!1);const B0=((x1=(Kt=(Ct=hn.data)==null?void 0:Ct[0])==null?void 0:Kt.contours)==null?void 0:x1[0])??null;if(B0){const m1=B0.coordinates;if((m1==null?void 0:m1.length)==0||!((h0=(ce=m1[0])==null?void 0:ce.box)!=null&&h0.length))W1.error("No auto annotation is possible to create");else{const rn=[];(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?(console.log("coordinates",m1),m1.forEach(_0=>{var t2;(t2=_0==null?void 0:_0.mask_polygon)==null||t2.forEach(j2=>{const n2={outline:j2.outline,classId:m1.classId};rn.push(n2)})})):(Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"?m1.forEach(_0=>{const t2=On.getBoundingBox(_0.box);Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}):(Ce==null?void 0:Ce.awi_annotation_type)=="circle"?m1.forEach(_0=>{const t2=On.calculateCircleFromCoordinates(On.getBoundingBox(_0.box));Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}):(Ce==null?void 0:Ce.awi_annotation_type)=="dot"&&m1.forEach(_0=>{const t2=On.calculateCentroid(_0.box);Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}),Un(rn),typeof E=="function"&&E("Normal")}}else W1.error("No Auto Annotation found")}},onError:hn=>{W1.exception(hn),jt(!1)}})},Pi=()=>{if(!Wo||!(Wo!=null&&Wo.mutate)){W1.error("SAM is not available");return}const be=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1)),ge=J2||be,Me=Br.chunkArray(nt),Te={img_url:ge,coords:nt,coordinates:Me};jt(!0),Wo.mutate(Te,{onSuccess:De=>{var ut;if(jt(!1),!De.success)W1.error(De.message);else if(console.log("this is the SAM data",De),((ut=De==null?void 0:De.data)==null?void 0:ut.length)>0){const xt=[];(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?De.data.forEach(Xt=>{Xt.contours.forEach(hn=>{Tt(hn.outline);const Kt={outline:hn.outline,classId:null};xt.push(Kt)})}):(Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"?De.data.forEach(Xt=>{Tt(Xt.bbox),console.log("this si the bbox",Xt.bbox);const Ct={outline:Xt.bbox,classId:null};xt.push(Ct)}):(Ce==null?void 0:Ce.awi_annotation_type)=="circle"?De.data.forEach(Xt=>{const hn=On.calculateCircleFromCoordinates(Xt.bbox);Tt(hn);const Ct={outline:hn,classId:null};xt.push(Ct)}):(Ce==null?void 0:Ce.awi_annotation_type)=="dot"&&De.data.forEach(Xt=>{const hn=On.calculateCentroid(Xt.bbox);Tt(hn);const Ct={outline:hn,classId:null};xt.push(Ct)}),Un(xt)}else W1.error("No annotations found from SAM")},onError:De=>{W1.exception(De),jt(!1)}})},Sa=async()=>{if(fe&&typeof fe=="function"){W1.success("Loading Annotations...");const be=await fe();console.log("cacheRemoveAnnotationResponse ",be),be!=null&&be.success?(W1.success((be==null?void 0:be.message)+" and now loading final annotations..."),Xo(!0)):W1.error(be==null?void 0:be.message)}},Ma=()=>{var ge;console.log("Undo last state annotation");const be=E2(u);if(((ge=be.past_coords)==null?void 0:ge.length)>0){const Me=be.past_coords[be.past_coords.length-1];typeof o=="function"&&l0(Me)&&!p&&o(Me,u,()=>{_2()})}},Ar=be=>{console.log("Control p"),Ye.current&&mo(be)},Ni=be=>{console.log("Control m"),e2(be)},V2=()=>{const be={clientX:(Ut==null?void 0:Ut.x)||0,clientY:(Ut==null?void 0:Ut.y)||0};Ar(be)},er=()=>{const be={clientX:(Ut==null?void 0:Ut.x)||0,clientY:(Ut==null?void 0:Ut.y)||0};Ni(be)},k3=()=>{console.log("Copying annotations"),O&&typeof O=="function"&&O((vn==null?void 0:vn.result)||[])},tr=(be=!0)=>{try{document.fullscreenElement?(document.exitFullscreen().then(()=>{console.log("Fullscreen exited")}).catch(ge=>{console.log(ge)}),be&&ia.setItem("full_screen","no")):(document.documentElement.requestFullscreen().then(()=>{console.log("Fullscreen entered")}).catch(ge=>{console.log(ge)}),be&&ia.setItem("full_screen","yes"))}catch(ge){console.log(ge)}},vr=be=>{var ge;if(!(!A&&!["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level))){if((Ce==null?void 0:Ce.awi_request_for)=="attributes"){const Me=mr(be)||[];console.log("This is the temp annotation",Me),Me.length>0&&(b1(Me),typeof d=="function"&&d(Me[0]),O1()),gn&&$t(!1),Nt(!1);return}if(En)if(At(!1),Pn){if(nt&&(nt==null?void 0:nt.length)>0){let Me=[];T1?x2()?Me=go():Me=nt:Me=go(),O1(Me)}}else console.log("creating new annotation"),typeof n=="function"&&l0(nt)&&((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?I3():(Tt([]),n(nt,null,!1,()=>{_2()})));else if(c&&Dt!=="-1"||A){if((gn||Jn.x!==-1&&Jn.y!==-1)&&R3(L1,On.getMousePos(Ye.current,be))){const Me=E2(Dt);if(Me){const Te=[...Me.awi_coords],De=l0(Te);typeof o=="function"&&De&&!p?o(Te,u,()=>{_2()}):De||((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?F2(Te,be):Xo(!0))}}else{const Me=mr(be)||[];if(Me.length>0)if(Me.every(Te=>n1.includes(Te))&&n1.every(Te=>Me.includes(Te))){if(cn(Te=>(typeof d=="function"&&d(n1[(n1.indexOf(Te)+1)%n1.length]),ht(),n1[(n1.indexOf(Te)+1)%n1.length]==="-1"&&(o1({x:0,y:0}),$n({x:-1,y:-1})),n1[(n1.indexOf(Te)+1)%n1.length])),(!gn||x2())&&(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"){const Te=(ge=E2(u))==null?void 0:ge.awi_coords;J0(be,Te)}}else console.log("Selecting first temp"),cn(Me[0]),typeof d=="function"&&d(Me[0]),O1();else cn("-1"),O1();b1(Me)}gn&&$t(!1),Nt(!1)}else if(c){const Me=mr(be)||[];console.log("This is the temp annotation",Me),Me.length>0&&(b1(Me),typeof d=="function"&&d(Me[0]),O1()),Nt(!1)}}},ri=be=>{if(console.log("Handle Mouse Down"),be.button==0&&!X0()){if(!["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level))return;if(!c&&!A){At(!0),console.log("Mouse down");const{x:ge,y:Me}=On.getMousePosAbsolute(Ye.current,be);Mn({x:ge,y:Me}),Pn?T1&&x2()||Tt(Te=>[...Te||[],{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"?Tt([{x:ge,y:Me},{x:ge,y:Me},{x:ge,y:Me},{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="circle"?Tt([{x:ge,y:Me},{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="dot"?Tt([{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&Tt(Te=>[...Te,{x:ge,y:Me}])}else A||(O3(be,Dt),Nt(!0))}else if(be.button===1||be.button==0){const{clientX:ge,clientY:Me}=be,{x:Te,y:De}=at,ut=Xt=>{console.log("PANNING!!!!!");const hn=Xt.clientX-ge,Ct=Xt.clientY-Me,Kt=Te+hn,x1=De+Ct,ce=Math.max(Math.min(Kt,0),wt.width-wt.width*at.scale),h0=Math.max(Math.min(x1,0),wt.height-wt.height*at.scale);mn({scale:at.scale,x:ce,y:h0})},xt=()=>{window.removeEventListener("mousemove",ut),window.removeEventListener("mouseup",xt),window.addEventListener("touchmove",ut,{passive:!1}),window.addEventListener("touchend",xt)};at.scale>1&&(window.addEventListener("mousemove",ut),window.addEventListener("touchmove",ut,{passive:!1})),window.addEventListener("mouseup",xt),window.addEventListener("touchend",xt)}},Qr=be=>{if(Ye!=null&&Ye.current&&A1({x:be.clientX,y:be.clientY}),c&&(Dt!="-1"&&(pn==null?void 0:pn.length)<=I1.MAX_ANNOTATIONS_TO_HOVER&&Di(be),!gn&&!vt?(pn==null?void 0:pn.length)<=I1.MAX_ANNOTATIONS_TO_HOVER&&ni(be):jn!="-1"&&D1("-1")),p)return;let ge=[];if(En){Pn?(ge.length==0&&(ge=[Jt]),Tt(Me=>Me.length==0?[Jt]:Me),O1(nt)):(Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"?(ge=On.getUpdatedCoordinates(Ye,be,Jt),Tt(ge),O1(ge)):(Ce==null?void 0:Ce.awi_annotation_type)==="circle"?(Kr(be),O1(nt)):(Ce==null||Ce.awi_annotation_type,O1(nt));return}else if(c&&Dt!=="-1"&&vt){if(console.log("isDrawingAnnotation",En),gn){const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=Me-(L1.x||0),ut=Te-(L1.y||0);if(u!=="-1"){ge=[...nt].map(hn=>({x:hn.x+De,y:hn.y+ut}));const xt=E2(u);if(xt)switch(xt.awi_coords=[...ge],Ce==null?void 0:Ce.awi_annotation_type){case"dot":{ge.length===1&&(ge[0].x=On.getPerfectPointValue(ge[0].x),ge[0].y=On.getPerfectPointValue(ge[0].y));break}case"circle":{ge.length===2&&(ge=[...On.adjustToCircle(ge)],xt.awi_coords=[...ge]);break}case"rectangle":{if(ge.length===4){const hn=Math.abs(ge[1].x-ge[0].x),Ct=Math.abs(ge[3].y-ge[1].y);for(let Kt=0;Kt<ge.length;Kt++)ge[Kt].x<0?(ge[1].x=hn,ge[2].x=hn,ge[0].x=1e-4,ge[3].x=1e-4):ge[Kt].y<0?(ge[2].y=Ct,ge[3].y=Ct,ge[0].y=1e-4,ge[1].y=1e-4):ge[Kt].x>1?(ge[0].x=1-hn,ge[3].x=1-hn,ge[1].x=1-1e-4,ge[2].x=1-1e-4):ge[Kt].y>1&&(ge[0].y=1-Ct,ge[1].y=1-Ct,ge[2].y=1-1e-4,ge[3].y=1-1e-4)}break}case"polygon":{ge.length>1&&F2(ge,be);break}default:{console.log("Unknown request type");break}}Ze()(ge)}}else if(Jn.x!==-1&&Jn.y!==-1&&u!=="-1"){console.log("Corner coordinates");const Me=E2(u);if((Ce==null?void 0:Ce.awi_annotation_type)==="circle"){const Te=On.getMousePos(Ye.current,be);if(Me){ge=Me.awi_coords;const De=(ge[0].x+ge[1].x)/2,ut=(ge[0].y+ge[1].y)/2,xt=On.getDistance(Te.x,Te.y,De,ut);De-xt<0?(ge[0]={x:0,y:ut},ge[1]={x:2*xt,y:ut}):De+xt>1?(ge[0]={x:1-2*xt,y:ut},ge[1]={x:1,y:ut}):ut-xt<0?(ge[0]={x:De,y:0},ge[1]={x:De,y:2*xt}):ut+xt>1?(ge[0]={x:De,y:1-2*xt},ge[1]={x:De,y:1}):(ge[0]={x:De-xt,y:ut},ge[1]={x:De+xt,y:ut}),ge=[...On.adjustToCircle(ge)]}}else if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&!Pn){const Te=On.getMousePos(Ye.current,be);Me!=null&&Me.awi_coords&&(ge=[...Me.awi_coords],v1>-1&&(v1===0||v1===ge.length-1?(ge[0]={x:Te.x,y:Te.y},ge[ge.length-1]={x:Te.x,y:Te.y}):ge[v1]={x:Te.x,y:Te.y},$n({x:Te.x,y:Te.y})))}else ge=On.getUpdatedCoordinates(Ye,be,Jn);if(l0(ge)){Tt([...ge]);const Te=E2(u);Te&&(Te.awi_coords=ge,O1(ge))}}}else if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&!c&&(nt==null?void 0:nt.length)>1){const{x:Me,y:Te}=On.getMousePos(Ye.current,be);ht(nt,{x:Me,y:Te})}},Ha=be=>{if(be.touches.length===1){const ge=be.touches[0];if(X0()){if(at.scale==1)return;S1.current||(S1.current={x:ge.clientX,y:ge.clientY})}else{const Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget,button:0};ri(Me)}}},Gr=be=>{if(be.preventDefault(),be.touches.length>=2){const[ge,Me]=[be.touches[0],be.touches[1]],Te=Me.clientX-ge.clientX,De=Me.clientY-ge.clientY,ut=Math.hypot(Te,De);if(yn!==null){const xt=ut-yn,Xt=(ge.clientX+Me.clientX)/2,hn=(ge.clientY+Me.clientY)/2;x0({deltaY:-xt,clientX:Xt,clientY:hn,currentTarget:be.currentTarget})}Hn(ut)}if(be.touches.length===1){const ge=be.touches[0];if(X0()){if(S1.current){console.log("PANNING!!!!!");const Me=ge.clientX-S1.current.x,Te=ge.clientY-S1.current.y,{x:De,y:ut}=at,xt=De+Me,Xt=ut+Te,hn=Math.max(Math.min(xt,0),wt.width-wt.width*at.scale),Ct=Math.max(Math.min(Xt,0),wt.height-wt.height*at.scale);mn({scale:at.scale,x:hn,y:Ct}),S1.current={x:ge.clientX,y:ge.clientY}}}else{S1.current&&(S1.current=null);const Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};Qr(Me)}}},nr=be=>{if(S1.current&&(S1.current=null),be.touches.length<2&&Hn(null),X0()){be.preventDefault();return}const ge=be.touches[0]||be.changedTouches[0],Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};vr(Me)},yo=be=>{const ge=be.touches[0]||be.changedTouches[0],Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};ti(Me)},Ti=(be="")=>{switch(be){case"left":po();break;case"right":Ao();break;case"top":pr();break;case"bottom":Wr();break;default:console.warn(`Unknown pan direction: ${be}`)}},La=()=>{typeof x=="function"&&x(be=>!be)},E9=()=>{if(!u||u=="-1"){W1.error("Control copy will be work only when you have a selected annotation");return}else P&&typeof P=="function"&&P(vn==null?void 0:vn.result,!1)},Fi=()=>{if(!d2.current||!$o.current)return;const be=d2.current,ge=be.getContext("2d");if(!ge)return;const Me=wt.width*at.scale,Te=wt.height*at.scale;!Me||!Te||(be.width=Me,be.height=Te,ge.clearRect(0,0,Me,Te),ge.save(),ge.setTransform(1,0,0,1,0,0),ge.clearRect(0,0,Me,Te),ge.translate(at.x,at.y),ge.scale(at.scale,at.scale),ge.drawImage($o.current,0,0,wt.width,wt.height),ge.restore())};return Z.jsxs(Z.Fragment,{children:[P2&&Z.jsx(WS,{closeSAMPromptModal:()=>Fn(!1),onSubmit:l4,directPrompt:f1,isLoading:tn,requestInfo:Ce}),A&&H&&(vn==null?void 0:vn.success)&&Z.jsx(Z.Fragment,{children:Z.jsx("div",{style:{margin:"4px",display:"flex",justifyContent:"center"},children:Z.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content"},children:Z.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:k3,children:"Copy Annotations"})})})}),A&&Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{minHeight:T1?"50vh":"unset",touchAction:"none !important",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsxs(Z.Fragment,{children:[Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((f=(Ba=(oi=k==null?void 0:k.result)==null?void 0:oi.annotatorInfo)==null?void 0:Ba.awi_personal_info)==null?void 0:f.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:T1,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i),Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})]})}),!A&&je=="atom"&&Z.jsxs("div",{style:{display:"flex",flexDirection:T1?"column":"row"},children:[Z.jsx("div",{style:{height:T1?"unset":"100%",width:T1?"100%":"5.4%",border:"1px solid #E4E0E6",backgroundColor:"white"},children:["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level)&&Z.jsx("div",{style:{width:"100%",gap:"10px",marginTop:"2px",height:"100% ",display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:T1?"row":"column"},children:Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((z=(B=(b=k==null?void 0:k.result)==null?void 0:b.annotatorInfo)==null?void 0:B.awi_personal_info)==null?void 0:z.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:T1,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i)})}),Z.jsxs("div",{style:T1?{height:"100%",width:"100%"}:{width:"94.6%"},children:[!T1&&Z.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",height:T1?"8%":"3%",border:"1px solid #E4E0E6",background:"white",justifyContent:"space-between"},children:[Z.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%",alignItems:"center"},children:[Z.jsxs("div",{className:"color-black",style:{width:"4.8rem",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:[Z.jsx("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"50%",backgroundColor:" rgba(111, 41, 169, 0.20)",height:"100%"},children:ue+1}),Z.jsx("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"50%",backgroundColor:Fe||"rgba(111, 41, 169, 0.1)",height:"100%"},children:(((X=k==null?void 0:k.result)==null?void 0:X.awi_contents)||[]).length})]}),Z.jsxs("p",{className:"color-black",style:{marginLeft:"1rem"},title:((ie=G==null?void 0:G.awi_label)==null?void 0:ie.length)>20?G.awi_label:J.length>20?J:"",children:["Image -"," ",((ke=G==null?void 0:G.awi_label)==null?void 0:ke.length)>0?G.awi_label.length>20?G.awi_label.substring(0,20)+"...":G.awi_label:J.length>20?J.substring(0,20)+"...":J]}),Z.jsx("p",{className:"color-black",style:{marginLeft:"1rem"},children:((ye==null?void 0:ye.result)||[]).length>0&&`Annotations - ${((ye==null?void 0:ye.result)||[]).length} (Recent First) ${S.size?`Selected - ${((ye==null?void 0:ye.result)||[]).length-S.size}`:""}`})]}),Z.jsx("div",{children:Z.jsxs("div",{style:{fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center"},className:"color-black",children:[Z.jsx("div",{children:g0}),(g0==null?void 0:g0.length)>0&&Z.jsx(w7,{color:"#000"})]})})]}),Z.jsx("div",{children:W&&T1&&We&&Z.jsx("div",{style:{border:"1px solid #E4E0E6"},children:Z.jsx(We,{handleNextPage:V,handlePreviousPage:T,currentPage:$,images:(Je=k==null?void 0:k.result)==null?void 0:Je.awi_contents,handleIndexUpdate:K,currentIndex:ue,request_id:q,requestFor:(rt=k==null?void 0:k.result)==null?void 0:rt.awi_request_for,imagePagination:W,showImages:!0,fetchAnnotations:Le,pageCount:Be})})}),Z.jsx("div",{style:{height:T1||y9?"25px":"3%",border:"1px solid #E4E0E6",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px",backgroundColor:"#fff"},children:T1&&(g0==null?void 0:g0.length)>0?Z.jsx(Z.Fragment,{children:Z.jsx("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"center",alignItems:"center",fontWeight:"bold"},children:g0})}):Z.jsx(Z.Fragment,{children:at.scale>1?Z.jsx(Z.Fragment,{children:Z.jsxs("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"space-between",alignItems:"center"},children:[Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("left"),children:"Left"}),Z.jsx("progress",{value:X2.left,max:wt.width,title:X2.left==0?"You can not move left more":"Showing how much you can move left more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("right"),children:"Right"}),Z.jsx("progress",{value:X2.right,max:wt.width,title:X2.right==0?"You can not move right more":"Showing how much you can move right more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("top"),children:"Top"}),Z.jsx("progress",{value:X2.top,max:wt.height,title:X2.top==0?"You can not move top more":"Showing how much you can move top more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("bottom"),children:"Bottom"}),Z.jsx("progress",{value:X2.bottom,max:wt.height,title:X2.bottom==0?"You can not move bottom more":"Showing how much you can move bottom more"})]})}):Z.jsx("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"center",alignItems:"center"},children:"Zoom in to see image pan progress"})})}),Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{height:W?"80%":"90%",width:"100%",touchAction:"none !important",minHeight:T1?"50vh":"unset",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})}),W&&!T1&&We&&Z.jsx("div",{children:W&&Z.jsx("div",{style:{border:"1px solid #E4E0E6"},children:Z.jsx(We,{handleNextPage:V,handlePreviousPage:T,currentPage:$,images:(Bt=k==null?void 0:k.result)==null?void 0:Bt.awi_contents,handleIndexUpdate:K,currentIndex:ue,request_id:q,requestFor:(nn=k==null?void 0:k.result)==null?void 0:nn.awi_request_for,imagePagination:W,showImages:!0,fetchAnnotations:Le,pageCount:Be})})})]})]}),!A&&je=="library"&&Z.jsxs(Z.Fragment,{children:[Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((f0=(Gn=(In=k==null?void 0:k.result)==null?void 0:In.annotatorInfo)==null?void 0:Gn.awi_personal_info)==null?void 0:f0.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:!0,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i),Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{height:W?"80%":"90%",width:"100%",touchAction:"none !important",minHeight:T1?"50vh":"unset",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})})]}),e1!=-1&&A9&&Z.jsx(zM,{callback:()=>Z0(A9,e1),cancelCallBack:()=>{jo(-1)},trigger:"REMOVE_POLYGON_POINT",fireOnMount:!0,children:Z.jsx(Z.Fragment,{})})]})},k9e="_message__container_u7nyp_1",D9e="_message__container__icon_u7nyp_15",P9e="_message__container__title_u7nyp_19",N9e="_message__container__title__success_u7nyp_24",T9e="_message__container__description_u7nyp_27",F9e="_message__container__loading_u7nyp_31",V9e="_pulse_u7nyp_1",_r={message__container:k9e,message__container__icon:D9e,message__container__title:P9e,message__container__title__success:N9e,message__container__description:T9e,message__container__loading:F9e,pulse:V9e},Vc=({iconUrl:e,title:t,description:n,messageType:r="information",isLoading:o=!1,textClass:i="",noPadding:a,iconName:s=""})=>{var c,u;return o?Z.jsxs("div",{className:qn(_r.message__container,_r.message__container__loading),children:[s&&(s==null?void 0:s.length)>0&&Z.jsx("img",{src:(c=X1[s])==null?void 0:c.IconComponent,className:_r.message__container__icon}),e&&(e==null?void 0:e.length)>0&&Z.jsx("img",{src:e,className:_r.message__container__icon}),Z.jsx("h1",{className:qn(_r.message__container__title,{[_r.message__container__title__success]:r==="success"}),children:t}),Z.jsx("p",{className:qn(_r.message__container__description,i),children:n})]}):Z.jsxs("div",{className:qn(_r.message__container,{noPadding:a}),children:[s&&(s==null?void 0:s.length)>0&&Z.jsx("img",{src:(u=X1[s])==null?void 0:u.IconComponent,className:_r.message__container__icon}),e&&(e==null?void 0:e.length)>0&&Z.jsx("img",{src:e,className:_r.message__container__icon}),Z.jsx("h1",{className:qn(_r.message__container__title,{[_r.message__container__title__success]:r==="success"}),children:t}),Z.jsx("p",{className:qn(_r.message__container__description,i),children:n})]})},qb={ATTRIBUTES:{labelValue:"Attributes",src:"noAttributes",description:"No attributes are available. Start by adding or configuring attributes.",messageType:"information",loadingMessage:"Loading attributes...",notFoundMessage:"No attributes found"},ORGANISATIONS:{labelValue:"Organisations",src:"noOrganisations",description:"There are no organisations available. Add a new organisation to get started.",messageType:"information",loadingMessage:"Loading organizations...",notFoundMessage:"No organisations found"},REQUESTS:{labelValue:"Requests",src:"noRequests",description:"There are no requests available. Raised requests will be displayed here.",messageType:"information",loadingMessage:"Loading requests...",notFoundMessage:"No requests found"},USERS:{labelValue:"Users",src:"noUsers",description:"No users have been added yet. Start by inviting or creating users.",messageType:"information",loadingMessage:"Loading users...",notFoundMessage:"No users found"},USERS_IN_REQUEST:{labelValue:"Users",src:"noUsers",description:"No users found.",messageType:"information",loadingMessage:"Loading users...",notFoundMessage:"No users found"},CLASSES:{labelValue:"Classes",src:"noClasses",description:"There are no classes available. Add a new class to begin.",messageType:"information",loadingMessage:"Loading classes...",notFoundMessage:"No classes found"},IMAGES:{labelValue:"Images",src:"noImages",description:"No images are currently available. Upload images to view them here.",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No images found"},ANNOTATOR_NO_SESSIONS:{labelValue:"Sessions",src:"noSessions",description:"No sessions are currently available. Annotator Sessions will be listed here.",messageType:"information",loadingMessage:"Loading sessions...",notFoundMessage:"No sessions found"},VERIFIER_NO_SESSIONS:{labelValue:"Sessions",src:"noSessions",description:"No sessions are currently available. Verifier Sessions will be listed here.",messageType:"information",loadingMessage:"Loading sessions...",notFoundMessage:"No sessions found"},MODELS:{labelValue:"Models",src:"noModels",description:"There are no models available. Run jobs and train models to get started.",messageType:"information",loadingMessage:"Loading models...",notFoundMessage:"No models found"},JOBS:{labelValue:"Jobs",src:"noJobs",description:"No jobs are currently scheduled or running. Create a job to see it listed here.",messageType:"information",loadingMessage:"Loading jobs...",notFoundMessage:"No jobs found"},MODEL_LOGS:{labelValue:"Model Logs",src:"noJobLogs",description:"There are no logs available for the models. Generate or upload logs to view them.",messageType:"information",loadingMessage:"Loading model logs...",notFoundMessage:"No model logs found"},DATASETS:{labelValue:"Datasets",src:"noDatasets",description:"No datasets are available. Upload or create datasets to start working.",messageType:"information",loadingMessage:"Loading datasets...",notFoundMessage:"No datasets found"},BILLS:{labelValue:"Bills",src:"noBills",description:"No bills are currently available. Generated bills will be listed here.",messageType:"information",loadingMessage:"Loading bills...",notFoundMessage:"No bills found"},MODEL_METRICS:{labelValue:"Model Metrics",src:"noModelMetrics",description:"No metrics are available for the models. Generated metrics for analyzing performance will be listed here.",messageType:"information",loadingMessage:"Loading model metrics...",notFoundMessage:"No model metrics found"},MODEL_DETAILS:{labelValue:"Model Details",src:"noModelDetails",description:"Details for the models are not available. Add or update model details to view them.",messageType:"information",loadingMessage:"Loading model details...",notFoundMessage:"No model details found"},MODEL_RESOURCES:{labelValue:"Model Resources",src:"noModelResources",description:"No resources are available for the models. Add resources to start utilizing them.",messageType:"information",loadingMessage:"Loading model resources...",notFoundMessage:"No model resources found"},NOTIFICATIONS:{labelValue:"Notifications",src:"noNotifications",description:"No notifications are available. New notifications will be displayed here.",messageType:"information",loadingMessage:"Loading notifications...",notFoundMessage:"No notifications found"},REQUEST_IMAGES:{labelValue:"Request Images",src:"noRequestImages",description:"No request images are currently available.",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No request images found"},REQUEST_PRICING:{labelValue:"Request Pricing",src:"noPrices",description:"No request pricing are currently available.",messageType:"information",loadingMessage:"Loading pricing...",notFoundMessage:"No request pricing found"},ANNOTATION_GRAPH:{labelValue:"Annotation Graph",src:"noAnnotationGraph",description:"No annotation analytics are available for the given date",messageType:"information",loadingMessage:"Loading annotation graph...",notFoundMessage:"No annotations"},LOADING_CAROUSAL:{labelValue:"Images",src:"noImages",description:"No images is available to load",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No images found"},TAGS:{labelValue:"Tags",src:"noTags",description:"No tags are available. Start by adding or configuring tags.",messageType:"information",loadingMessage:"Loading tags...",notFoundMessage:"No tags found"},NO_CSV_REQUESTS:{labelValue:"Requests",src:"noRequests",description:"There are no requests available in sheet, kindly add and upload.",messageType:"information",loadingMessage:"Loading requests...",notFoundMessage:"No requests found"},NO_CSV_CLASS:{labelValue:"Classes",src:"noClasses",description:"There are no classes available in sheet, kindly add and upload.",messageType:"information",loadingMessage:"Loading classes...",notFoundMessage:"No classes found"},CLASS_PROPORTION:{labelValue:"Class proportion",src:"noClasses",description:"No class proportion available.",messageType:"information",loadingMessage:"Loading class proportion...",notFoundMessage:"No class proportion found"},SINGLE_CLASS:{labelValue:"Class",src:"noClasses",description:"No class available.",messageType:"information",loadingMessage:"Loading class...",notFoundMessage:"No classes found"},LOADING_FILTER:{labelValue:"Filter",src:"noClasses",description:"No filter configuration.",messageType:"information",loadingMessage:"Loading filter information...",notFoundMessage:"No filter configuration found"},LOADING_ANNOTATION:{labelValue:"Annotation Loading",src:"noImages",description:"No annotation found",messageType:"information",loadingMessage:"Please wait, loading annotation...",notFoundMessage:"No annotations"},LOADING_REQUEST:{labelValue:"Request Loading",src:"noRequests",description:"No request found",messageType:"information",loadingMessage:"Please wait, loading request info...",notFoundMessage:"No request"},NOT_FOUND_GENERAL:{labelValue:"Data Loading",src:"notFoundGeneral",description:"No data found",messageType:"information",loadingMessage:"Please wait, loading data...",notFoundMessage:"No data"}},j9e=({stateKey:e="NOT_FOUND_GENERAL",loadState:t=!1,stateDescription:n=null,stateLoadDescription:r=null,showImage:o=!1,textClass:i="",noPadding:a=!1,stateTitle:s=""})=>{const c=qb[e]||qb.NOT_FOUND_GENERAL;if(!c)return Z.jsx(Z.Fragment,{});const{labelValue:u,src:d,messageType:h,description:C,notFoundMessage:m}=c;if(t)return Z.jsxs("div",{style:{width:"100%"},children:[o&&Z.jsx(Vc,{title:c.loadingMessage,iconName:d,description:r||"",isLoading:!0,noPadding:a}),!o&&Z.jsx(Vc,{title:c.loadingMessage,description:r||"",isLoading:!0,noPadding:a})]});{const A=(s==null?void 0:s.length)>0?s:m?m||`No ${u} Found`:"",v=n||C;return Z.jsx("div",{style:{width:"100%"},children:Z.jsx(Vc,{title:A,iconName:d,description:v,messageType:h,textClass:i,noPadding:a})})}},z9e="_tableBar_103oy_1",Z9e="_buttonGroup_103oy_13",U9e="_btnIcon_103oy_34",$9e="_searchBar_103oy_41",K9e="_searchInput_103oy_53",W9e="_searchIcon_103oy_58",Q9e="_removeBorder_103oy_63",G9e="_button_103oy_13",Y9e="_isSelected_103oy_74",q9e="_isDisabled_103oy_80",X9e="_isActive_103oy_85",J9e="_isText_103oy_92",sr={tableBar:z9e,buttonGroup:Z9e,btnIcon:U9e,searchBar:$9e,searchInput:K9e,searchIcon:W9e,removeBorder:Q9e,button:G9e,isSelected:Y9e,isDisabled:q9e,isActive:X9e,isText:J9e},e3e=({showSearch:e=!1,leftButtons:t=[],rightButtons:n=[],searchFunction:r,searchDelay:o=300,onSearchClick:i,searchPlaceHolder:a="Search...",showSearchEye:s=!0,borderRequired:c=!0,borderColor:u})=>{const d=R.useCallback(cl.debounce((A,v)=>{typeof v=="function"&&v(A)},o),[o]),h=A=>{const v=A.currentTarget.value.trim();d(v,r)},C=()=>{typeof i=="function"&&i()};if(!t.length&&!n.length&&!e)return null;const m=(A,v)=>{const p=A.type==="text";return Z.jsxs("button",{onClick:!p&&!A.isDisabled?A.onClick:void 0,title:A.title||"",disabled:A.isDisabled,className:qn(sr.button,{[sr.isText]:p,[sr.isSelected]:A.isSelected,[sr.isDisabled]:A.isDisabled,[sr.isActive]:A.isActive&&!A.isSelected}),children:[A.icon&&Z.jsx("img",{src:A.icon,alt:A.name,className:sr.btnIcon}),Z.jsx("div",{children:A.name})]},v)};return Z.jsxs("div",{className:qn(sr.tableBar,!c&&sr.removeBorder),style:{borderColor:c?u||"#909090":void 0},children:[Z.jsxs("div",{className:sr.buttonGroup,children:[t.map(m)," "]}),Z.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px"},children:[Z.jsx("div",{className:sr.buttonGroup,children:n.map(m)}),e&&Z.jsx("div",{className:sr.searchBar,title:a,children:Z.jsxs("form",{autoComplete:"off",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",position:"relative"},children:[Z.jsx("input",{type:"text",name:"userSearchInput",autoComplete:"off",placeholder:a,className:sr.searchInput,onKeyUp:h}),s&&Z.jsx("img",{src:X1.searchUrl.IconComponent,alt:a,className:qn(sr.btnIcon,"cursor-pointer",sr.searchIcon),onClick:C})]})})]})]})},dH=({currentPage:e,totalPages:t,onPageChange:n,isLoading:r=!1})=>{const[o,i]=R.useState(`${e}`);R.useEffect(()=>{i(`${e}`)},[e]);const a=()=>{const s=Number(o);s>=1&&s<=t&&n(s),i("")};return Z.jsx(Z.Fragment,{children:Z.jsxs("div",{className:p2.pagination_container,children:[Z.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",maxHeight:"2vh"},children:r?Z.jsx(Z.Fragment,{children:Z.jsx("div",{className:p2.pagination_loading,children:"Loading..."})}):Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:p2.pagination_left,children:Z.jsx("input",{type:"number",min:"1",max:t,value:o,onChange:s=>{i(s.target.value)},onBlur:()=>{if(o==""){i(`${e}`);return}const s=parseInt(o,10);if(!isNaN(s)){let c=Math.max(1,Math.min(t,s)).toString();c!=null&&c.length||(c="1"),i(c),a()}},onKeyDown:s=>{if(s.key==="Enter"){s==null||s.preventDefault(),s==null||s.stopPropagation();const c=parseInt(o,10);if(!isNaN(c)){const u=Math.max(1,Math.min(t,c)).toString();i(u),a()}}},placeholder:o,style:{background:"transparent",border:"0",width:"100%",height:"100%"}})}),Z.jsx("div",{className:p2.pagination_right,children:t})]})}),Z.jsxs("div",{style:{gap:"20px",display:"flex"},children:[Z.jsx("img",{src:X1.backArrow.IconComponent,onClick:()=>e>1&&n(e-1),style:{cursor:e>1?"pointer":"not-allowed"},className:p2.nextPrevArrow,title:e>1?`Go to page number ${e-1} `:"Go to previous page is not allowed"}),Z.jsx("img",{src:X1.forwardArrow.IconComponent,onClick:()=>e<t&&n(e+1),style:{cursor:e<t?"pointer":"not-allowed"},className:p2.nextPrevArrow,title:e<t?`Go to page number ${e+1}`:"Go to next page is not allowed"})]})]})})},t3e=({hasNextPage:e,isFetchingNextPage:t=!1,fetchNextPage:n,isLoading:r=!1,totalResults:o=0,totalFetchedResults:i=0,currentPage:a=1,totalPages:s=10,onPageChange:c,isPagination:u=!1,loadText:d=""})=>{let h="Load More";return i+1===o?h="Load last results":r||t?u?a==1?h="Loading...":h=`Loading page number ${a}`:o===0?h="Loading...":i+1===o?h="Loading last results...":h=`Loading ${i+1} to ${o}`:i===0?(d==null?void 0:d.length)==0?h="Load":h=d:h=`Load ${i+1} to ${o}`,u&&c?Z.jsx(dH,{currentPage:a,totalPages:s,onPageChange:c,isLoading:r||t}):Z.jsx("div",{className:p2.loadMoreButtonDiv,style:{display:"flex",justifyContent:"center",marginTop:"16px"},children:e&&!t&&Z.jsx("div",{className:p2.loadMoreButtonContainer,children:Z.jsx("button",{onClick:()=>n?n():void 0,className:"modalButton modalButton__purpleColor",disabled:r||t,children:h})})})},n3e=({items:e,listType:t="ul",maxHeight:n="100px"})=>{const r=t;return!e||e.length===0?Z.jsx("div",{style:{minWidth:"30px"},children:"N/A"}):Z.jsx(r,{style:{maxHeight:n,overflow:"auto",paddingLeft:"20px"},children:e.map((o,i)=>Z.jsx("li",{style:{minWidth:"10vw"},children:o},i))})};var fH=(e=>(e.LARGE="l",e.MEDIUM="m",e))(fH||{});const r3e=({badgeContent:e,variant:t=fH.LARGE,backgroundColor:n,textColor:r,className:o,style:i,...a})=>Z.jsx("span",{className:`badge badge_${t} ${o} ${e?"":"badge_dot"}`,style:{"--c_background":n,"--c_text":r,...i},...a,children:e}),o3e=({items:e,value:t,onChange:n=()=>{},color:r,width:o,gap:i})=>Z.jsx("div",{className:"button_group",style:{gap:i},children:e==null?void 0:e.map((a,s)=>Z.jsx(i2,{variant:"primary",content:a==null?void 0:a.label,icon:a==null?void 0:a.icon,iconPosition:(a==null?void 0:a.iconPosition)??"before",textColor:a==null?void 0:a.contentColor,iconColor:a==null?void 0:a.contentColor,onClick:()=>n(a.value),width:o,className:`button_group_button ${s==0?"first":""} ${s==e.length-1?"last":""} ${a.value==t?"active":""}`,backgroundColor:r,borderColor:r},a.value))});/*!
|
|
339
|
+
}`;var i1=nv(function(){return h1(me,Ln+"return "+It).apply(n,Oe)});if(i1.source=It,hd(i1))throw i1;return i1}function PV(g){return z1(g).toLowerCase()}function NV(g){return z1(g).toUpperCase()}function TV(g,y,I){if(g=z1(g),g&&(I||y===n))return x9(g);if(!g||!(y=br(y)))return g;var Q=J0(g),te=J0(y),me=S2(Q,te),Oe=Ur(Q,te)+1;return ka(Q,me,Oe).join("")}function FV(g,y,I){if(g=z1(g),g&&(I||y===n))return g.slice(0,ti(g)+1);if(!g||!(y=br(y)))return g;var Q=J0(g),te=Ur(Q,J0(y))+1;return ka(Q,0,te).join("")}function VV(g,y,I){if(g=z1(g),g&&(I||y===n))return g.replace(pt,"");if(!g||!(y=br(y)))return g;var Q=J0(g),te=S2(Q,J0(y));return ka(Q,te).join("")}function jV(g,y){var I=D,Q=N;if(b0(y)){var te="separator"in y?y.separator:te;I="length"in y?r1(y.length):I,Q="omission"in y?br(y.omission):Q}g=z1(g);var me=g.length;if(Co(g)){var Oe=J0(g);me=Oe.length}if(I>=me)return g;var Pe=I-Z0(Q);if(Pe<1)return Q;var Ke=Oe?ka(Oe,0,Pe).join(""):g.slice(0,Pe);if(te===n)return Ke+Q;if(Oe&&(Pe+=Ke.length-Pe),Cd(te)){if(g.slice(Pe).search(te)){var St,Mt=Ke;for(te.global||(te=mo(te.source,z1(Et.exec(te))+"g")),te.lastIndex=0;St=te.exec(Mt);)var It=St.index;Ke=Ke.slice(0,It===n?Pe:It)}}else if(g.indexOf(br(te),Pe)!=Pe){var ln=Ke.lastIndexOf(te);ln>-1&&(Ke=Ke.slice(0,ln))}return Ke+Q}function zV(g){return g=z1(g),g&&Gt.test(g)?g.replace(an,ki):g}var ZV=N3(function(g,y,I){return g+(I?" ":"")+y.toUpperCase()}),pd=rA("toUpperCase");function tv(g,y,I){return g=z1(g),y=I?n:y,y===n?$r(g)?Di(g):Qo(g):g.match(y)||[]}var nv=d1(function(g,y){try{return s0(g,n,y)}catch(I){return hd(I)?I:new Un(I)}}),UV=Zi(function(g,y){return g0(y,function(I){I=li(I),ji(g,I,dd(g[I],g))}),g});function $V(g){var y=g==null?0:g.length,I=Vn();return g=y?G1(g,function(Q){if(typeof Q[1]!="function")throw new x0(a);return[I(Q[0]),Q[1]]}):[],d1(function(Q){for(var te=-1;++te<y;){var me=g[te];if(s0(me[0],this,Q))return s0(me[1],this,Q)}})}function KV(g){return pP(Xr(g,h))}function Ad(g){return function(){return g}}function WV(g,y){return g==null||g!==g?y:g}var QV=iA(),GV=iA(!0);function ar(g){return g}function vd(g){return Dp(typeof g=="function"?g:Xr(g,h))}function YV(g){return Np(Xr(g,h))}function qV(g,y){return Tp(g,Xr(y,h))}var XV=d1(function(g,y){return function(I){return f4(I,g,y)}}),JV=d1(function(g,y){return function(I){return f4(g,I,y)}});function bd(g,y,I){var Q=r2(y),te=Vl(y,Q);I==null&&!(b0(y)&&(te.length||!Q.length))&&(I=y,y=g,g=this,te=Vl(y,r2(y)));var me=!(b0(I)&&"chain"in I)||!!I.chain,Oe=$i(g);return g0(te,function(Pe){var Ke=y[Pe];g[Pe]=Ke,Oe&&(g.prototype[Pe]=function(){var St=this.__chain__;if(me||St){var Mt=g(this.__wrapped__),It=Mt.__actions__=rr(this.__actions__);return It.push({func:Ke,args:arguments,thisArg:g}),Mt.__chain__=St,Mt}return Ke.apply(g,d2([this.value()],arguments))})}),g}function ej(){return L0._===this&&(L0._=Ma),this}function yd(){}function tj(g){return g=r1(g),d1(function(y){return Fp(y,g)})}var nj=Xu(G1),rj=Xu(Zo),oj=Xu(Ko);function rv(g){return id(g)?Yo(li(g)):kP(g)}function ij(g){return function(y){return g==null?n:H9(g,y)}}var aj=sA(),sj=sA(!0);function wd(){return[]}function xd(){return!1}function lj(){return{}}function cj(){return""}function uj(){return!0}function dj(g,y){if(g=r1(g),g<1||g>K)return[];var I=U,Q=ie(g,U);y=Vn(y),g-=U;for(var te=w9(Q,y);++I<g;)y(I);return te}function fj(g){return Yn(g)?G1(g,li):yr(g)?[g]:rr(xA(z1(g)))}function hj(g){var y=++l4;return z1(g)+y}var Cj=Kl(function(g,y){return g+y},0),gj=Ju("ceil"),mj=Kl(function(g,y){return g/y},1),pj=Ju("floor");function Aj(g){return g&&g.length?Fl(g,ar,Tu):n}function vj(g,y){return g&&g.length?Fl(g,Vn(y,2),Tu):n}function bj(g){return Oi(g,ar)}function yj(g,y){return Oi(g,Vn(y,2))}function wj(g){return g&&g.length?Fl(g,ar,zu):n}function xj(g,y){return g&&g.length?Fl(g,Vn(y,2),zu):n}var _j=Kl(function(g,y){return g*y},1),Ej=Ju("round"),Sj=Kl(function(g,y){return g-y},0);function Mj(g){return g&&g.length?E2(g,ar):0}function Hj(g,y){return g&&g.length?E2(g,Vn(y,2)):0}return ce.after=YT,ce.ary=kA,ce.assign=NF,ce.assignIn=QA,ce.assignInWith=i6,ce.assignWith=TF,ce.at=FF,ce.before=DA,ce.bind=dd,ce.bindAll=UV,ce.bindKey=PA,ce.castArray=lF,ce.chain=OA,ce.chunk=pN,ce.compact=AN,ce.concat=vN,ce.cond=$V,ce.conforms=KV,ce.constant=Ad,ce.countBy=MT,ce.create=VF,ce.curry=NA,ce.curryRight=TA,ce.debounce=FA,ce.defaults=jF,ce.defaultsDeep=zF,ce.defer=qT,ce.delay=XT,ce.difference=bN,ce.differenceBy=yN,ce.differenceWith=wN,ce.drop=xN,ce.dropRight=_N,ce.dropRightWhile=EN,ce.dropWhile=SN,ce.fill=MN,ce.filter=LT,ce.flatMap=RT,ce.flatMapDeep=IT,ce.flatMapDepth=kT,ce.flatten=MA,ce.flattenDeep=HN,ce.flattenDepth=LN,ce.flip=JT,ce.flow=QV,ce.flowRight=GV,ce.fromPairs=BN,ce.functions=GF,ce.functionsIn=YF,ce.groupBy=DT,ce.initial=RN,ce.intersection=IN,ce.intersectionBy=kN,ce.intersectionWith=DN,ce.invert=XF,ce.invertBy=JF,ce.invokeMap=NT,ce.iteratee=vd,ce.keyBy=TT,ce.keys=r2,ce.keysIn=ir,ce.map=Jl,ce.mapKeys=tV,ce.mapValues=nV,ce.matches=YV,ce.matchesProperty=qV,ce.memoize=t6,ce.merge=rV,ce.mergeWith=GA,ce.method=XV,ce.methodOf=JV,ce.mixin=bd,ce.negate=n6,ce.nthArg=tj,ce.omit=oV,ce.omitBy=iV,ce.once=eF,ce.orderBy=FT,ce.over=nj,ce.overArgs=tF,ce.overEvery=rj,ce.overSome=oj,ce.partial=fd,ce.partialRight=VA,ce.partition=VT,ce.pick=aV,ce.pickBy=YA,ce.property=rv,ce.propertyOf=ij,ce.pull=FN,ce.pullAll=LA,ce.pullAllBy=VN,ce.pullAllWith=jN,ce.pullAt=zN,ce.range=aj,ce.rangeRight=sj,ce.rearg=nF,ce.reject=ZT,ce.remove=ZN,ce.rest=rF,ce.reverse=cd,ce.sampleSize=$T,ce.set=lV,ce.setWith=cV,ce.shuffle=KT,ce.slice=UN,ce.sortBy=GT,ce.sortedUniq=qN,ce.sortedUniqBy=XN,ce.split=RV,ce.spread=oF,ce.tail=JN,ce.take=eT,ce.takeRight=tT,ce.takeRightWhile=nT,ce.takeWhile=rT,ce.tap=AT,ce.throttle=iF,ce.thru=Xl,ce.toArray=$A,ce.toPairs=qA,ce.toPairsIn=XA,ce.toPath=fj,ce.toPlainObject=WA,ce.transform=uV,ce.unary=aF,ce.union=oT,ce.unionBy=iT,ce.unionWith=aT,ce.uniq=sT,ce.uniqBy=lT,ce.uniqWith=cT,ce.unset=dV,ce.unzip=ud,ce.unzipWith=BA,ce.update=fV,ce.updateWith=hV,ce.values=V3,ce.valuesIn=CV,ce.without=uT,ce.words=tv,ce.wrap=sF,ce.xor=dT,ce.xorBy=fT,ce.xorWith=hT,ce.zip=CT,ce.zipObject=gT,ce.zipObjectDeep=mT,ce.zipWith=pT,ce.entries=qA,ce.entriesIn=XA,ce.extend=QA,ce.extendWith=i6,bd(ce,ce),ce.add=Cj,ce.attempt=nv,ce.camelCase=AV,ce.capitalize=JA,ce.ceil=gj,ce.clamp=gV,ce.clone=cF,ce.cloneDeep=dF,ce.cloneDeepWith=fF,ce.cloneWith=uF,ce.conformsTo=hF,ce.deburr=ev,ce.defaultTo=WV,ce.divide=mj,ce.endsWith=vV,ce.eq=xo,ce.escape=bV,ce.escapeRegExp=yV,ce.every=HT,ce.find=BT,ce.findIndex=EA,ce.findKey=ZF,ce.findLast=OT,ce.findLastIndex=SA,ce.findLastKey=UF,ce.floor=pj,ce.forEach=RA,ce.forEachRight=IA,ce.forIn=$F,ce.forInRight=KF,ce.forOwn=WF,ce.forOwnRight=QF,ce.get=gd,ce.gt=CF,ce.gte=gF,ce.has=qF,ce.hasIn=md,ce.head=HA,ce.identity=ar,ce.includes=PT,ce.indexOf=ON,ce.inRange=mV,ce.invoke=eV,ce.isArguments=O9,ce.isArray=Yn,ce.isArrayBuffer=mF,ce.isArrayLike=or,ce.isArrayLikeObject=O0,ce.isBoolean=pF,ce.isBuffer=Da,ce.isDate=AF,ce.isElement=vF,ce.isEmpty=bF,ce.isEqual=yF,ce.isEqualWith=wF,ce.isError=hd,ce.isFinite=xF,ce.isFunction=$i,ce.isInteger=jA,ce.isLength=r6,ce.isMap=zA,ce.isMatch=_F,ce.isMatchWith=EF,ce.isNaN=SF,ce.isNative=MF,ce.isNil=LF,ce.isNull=HF,ce.isNumber=ZA,ce.isObject=b0,ce.isObjectLike=E0,ce.isPlainObject=A4,ce.isRegExp=Cd,ce.isSafeInteger=BF,ce.isSet=UA,ce.isString=o6,ce.isSymbol=yr,ce.isTypedArray=F3,ce.isUndefined=OF,ce.isWeakMap=RF,ce.isWeakSet=IF,ce.join=PN,ce.kebabCase=wV,ce.last=eo,ce.lastIndexOf=NN,ce.lowerCase=xV,ce.lowerFirst=_V,ce.lt=kF,ce.lte=DF,ce.max=Aj,ce.maxBy=vj,ce.mean=bj,ce.meanBy=yj,ce.min=wj,ce.minBy=xj,ce.stubArray=wd,ce.stubFalse=xd,ce.stubObject=lj,ce.stubString=cj,ce.stubTrue=uj,ce.multiply=_j,ce.nth=TN,ce.noConflict=ej,ce.noop=yd,ce.now=e6,ce.pad=EV,ce.padEnd=SV,ce.padStart=MV,ce.parseInt=HV,ce.random=pV,ce.reduce=jT,ce.reduceRight=zT,ce.repeat=LV,ce.replace=BV,ce.result=sV,ce.round=Ej,ce.runInContext=Ze,ce.sample=UT,ce.size=WT,ce.snakeCase=OV,ce.some=QT,ce.sortedIndex=$N,ce.sortedIndexBy=KN,ce.sortedIndexOf=WN,ce.sortedLastIndex=QN,ce.sortedLastIndexBy=GN,ce.sortedLastIndexOf=YN,ce.startCase=IV,ce.startsWith=kV,ce.subtract=Sj,ce.sum=Mj,ce.sumBy=Hj,ce.template=DV,ce.times=dj,ce.toFinite=Ki,ce.toInteger=r1,ce.toLength=KA,ce.toLower=PV,ce.toNumber=to,ce.toSafeInteger=PF,ce.toString=z1,ce.toUpper=NV,ce.trim=TV,ce.trimEnd=FV,ce.trimStart=VV,ce.truncate=jV,ce.unescape=zV,ce.uniqueId=hj,ce.upperCase=ZV,ce.upperFirst=pd,ce.each=RA,ce.eachRight=IA,ce.first=HA,bd(ce,function(){var g={};return ai(ce,function(y,I){u1.call(ce.prototype,I)||(g[I]=y)}),g}(),{chain:!1}),ce.VERSION=r,g0(["bind","bindKey","curry","curryRight","partial","partialRight"],function(g){ce[g].placeholder=ce}),g0(["drop","take"],function(g,y){rn.prototype[g]=function(I){I=I===n?1:X(r1(I),0);var Q=this.__filtered__&&!y?new rn(this):this.clone();return Q.__filtered__?Q.__takeCount__=ie(I,Q.__takeCount__):Q.__views__.push({size:ie(I,U),type:g+(Q.__dir__<0?"Right":"")}),Q},rn.prototype[g+"Right"]=function(I){return this.reverse()[g](I).reverse()}}),g0(["filter","map","takeWhile"],function(g,y){var I=y+1,Q=I==j||I==T;rn.prototype[g]=function(te){var me=this.clone();return me.__iteratees__.push({iteratee:Vn(te,3),type:I}),me.__filtered__=me.__filtered__||Q,me}}),g0(["head","last"],function(g,y){var I="take"+(y?"Right":"");rn.prototype[g]=function(){return this[I](1).value()[0]}}),g0(["initial","tail"],function(g,y){var I="drop"+(y?"":"Right");rn.prototype[g]=function(){return this.__filtered__?new rn(this):this[I](1)}}),rn.prototype.compact=function(){return this.filter(ar)},rn.prototype.find=function(g){return this.filter(g).head()},rn.prototype.findLast=function(g){return this.reverse().find(g)},rn.prototype.invokeMap=d1(function(g,y){return typeof g=="function"?new rn(this):this.map(function(I){return f4(I,g,y)})}),rn.prototype.reject=function(g){return this.filter(n6(Vn(g)))},rn.prototype.slice=function(g,y){g=r1(g);var I=this;return I.__filtered__&&(g>0||y<0)?new rn(I):(g<0?I=I.takeRight(-g):g&&(I=I.drop(g)),y!==n&&(y=r1(y),I=y<0?I.dropRight(-y):I.take(y-g)),I)},rn.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},rn.prototype.toArray=function(){return this.take(U)},ai(rn.prototype,function(g,y){var I=/^(?:filter|find|map|reject)|While$/.test(y),Q=/^(?:head|last)$/.test(y),te=ce[Q?"take"+(y=="last"?"Right":""):y],me=Q||/^find/.test(y);te&&(ce.prototype[y]=function(){var Oe=this.__wrapped__,Pe=Q?[1]:arguments,Ke=Oe instanceof rn,St=Pe[0],Mt=Ke||Yn(Oe),It=function(p1){var _1=te.apply(ce,d2([p1],Pe));return Q&&ln?_1[0]:_1};Mt&&I&&typeof St=="function"&&St.length!=1&&(Ke=Mt=!1);var ln=this.__chain__,Ln=!!this.__actions__.length,zn=me&&!ln,i1=Ke&&!Ln;if(!me&&Mt){Oe=i1?Oe:new rn(this);var Zn=g.apply(Oe,Pe);return Zn.__actions__.push({func:Xl,args:[It],thisArg:n}),new m1(Zn,ln)}return zn&&i1?g.apply(this,Pe):(Zn=this.thru(It),zn?Q?Zn.value()[0]:Zn.value():Zn)})}),g0(["pop","push","shift","sort","splice","unshift"],function(g){var y=po[g],I=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",Q=/^(?:pop|shift)$/.test(g);ce.prototype[g]=function(){var te=arguments;if(Q&&!this.__chain__){var me=this.value();return y.apply(Yn(me)?me:[],te)}return this[I](function(Oe){return y.apply(Yn(Oe)?Oe:[],te)})}}),ai(rn.prototype,function(g,y){var I=ce[y];if(I){var Q=I.name+"";u1.call(Te,Q)||(Te[Q]=[]),Te[Q].push({name:y,func:I})}}),Te[$l(n,_).name]=[{name:"wrapper",func:n}],rn.prototype.clone=_0,rn.prototype.reverse=t2,rn.prototype.value=j2,ce.prototype.at=vT,ce.prototype.chain=bT,ce.prototype.commit=yT,ce.prototype.next=wT,ce.prototype.plant=_T,ce.prototype.reverse=ET,ce.prototype.toJSON=ce.prototype.valueOf=ce.prototype.value=ST,ce.prototype.first=ce.prototype.head,Gr&&(ce.prototype[Gr]=xT),ce},F2=ni();w2?((w2.exports=F2)._=F2,u2._=F2):L0._=F2}).call(aae)}(W4,W4.exports)),W4.exports}var cl=sae();const bi=uo(cl),Fd="/not_available.svg",lae="/big_size_image.svg",Vd="/user.png",ZM={HARDCODED_FALL_BACK_IMAGE:Fd,HARDCODED_FALL_BACK_BIG_IMAGE:lae,DEFAULT_AVATAR_IMAGE:Vd,generateImageUrl:(e,t=!1)=>e||Fd,getImageKitUrl:(e,t=300,n=300,r=40)=>e||Fd,getUserAvatar:e=>{var t;return!e||!((t=e.awi_personal_info)!=null&&t.awi_avatar)?Vd:e.awi_personal_info.awi_avatar||Vd}};var U3=ug();const jd=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function zd(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function M4(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function UM(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function $M(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function cae(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let i=0;i<n.length;i++)r.indexOf(n[i])===-1&&(o=!1);return o}const Ms={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":jd?173:189,"=":jd?61:187,";":jd?59:186,"'":222,"[":219,"]":221,"\\":220},Io={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Q4={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},m2={16:!1,18:!1,17:!1,91:!1},y0={};for(let e=1;e<20;e++)Ms["f".concat(e)]=111+e;let p0=[],us=null,KM="all";const na=new Map,ul=e=>Ms[e.toLowerCase()]||Io[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),uae=e=>Object.keys(Ms).find(t=>Ms[t]===e),dae=e=>Object.keys(Io).find(t=>Io[t]===e);function WM(e){KM=e||"all"}function Hs(){return KM||"all"}function fae(){return p0.slice(0)}function hae(){return p0.map(e=>uae(e)||dae(e)||String.fromCharCode(e))}function Cae(){const e=[];return Object.keys(y0).forEach(t=>{y0[t].forEach(n=>{let{key:r,scope:o,mods:i,shortcut:a}=n;e.push({scope:o,shortcut:a,mods:i,keys:r.split("+").map(s=>ul(s))})})}),e}function gae(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function mae(e){return typeof e=="string"&&(e=ul(e)),p0.indexOf(e)!==-1}function pae(e,t){let n,r;e||(e=Hs());for(const o in y0)if(Object.prototype.hasOwnProperty.call(y0,o))for(n=y0[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(a=>{let{element:s}=a;return Mg(s)}):r++;Hs()===e&&WM(t||"all")}function Aae(e){let t=e.keyCode||e.which||e.charCode;const n=p0.indexOf(t);if(n>=0&&p0.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&p0.splice(0,p0.length),(t===93||t===224)&&(t=91),t in m2){m2[t]=!1;for(const r in Io)Io[r]===t&&(ao[r]=!1)}}function QM(e){if(typeof e>"u")Object.keys(y0).forEach(o=>{Array.isArray(y0[o])&&y0[o].forEach(i=>h6(i)),delete y0[o]}),Mg(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&h6(o)});else if(typeof e=="object")e.key&&h6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,i]=n;typeof o=="function"&&(i=o,o=""),h6({key:e,scope:o,method:i,splitKey:"+"})}}const h6=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;$M(t).forEach(a=>{const s=a.split(o),c=s.length,u=s[c-1],d=u==="*"?"*":ul(u);if(!y0[d])return;n||(n=Hs());const h=c>1?UM(Io,s):[],C=[];y0[d]=y0[d].filter(m=>{const v=(r?m.method===r:!0)&&m.scope===n&&cae(m.mods,h);return v&&C.push(m.element),!v}),C.forEach(m=>Mg(m))})};function Kb(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const i in m2)Object.prototype.hasOwnProperty.call(m2,i)&&(!m2[i]&&t.mods.indexOf(+i)>-1||m2[i]&&t.mods.indexOf(+i)===-1)&&(o=!1);(t.mods.length===0&&!m2[16]&&!m2[18]&&!m2[17]&&!m2[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(p0),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Wb(e,t){const n=y0["*"];let r=e.keyCode||e.which||e.charCode;if(!ao.filter.call(this,e))return;if((r===93||r===224)&&(r=91),p0.indexOf(r)===-1&&r!==229&&p0.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const c=Q4[s];e[s]&&p0.indexOf(c)===-1?p0.push(c):!e[s]&&p0.indexOf(c)>-1?p0.splice(p0.indexOf(c),1):s==="metaKey"&&e[s]&&(p0=p0.filter(u=>u in Q4||u===r))}),r in m2){m2[r]=!0;for(const s in Io)if(Object.prototype.hasOwnProperty.call(Io,s)){const c=Q4[Io[s]];ao[s]=e[c]}if(!n)return}for(const s in m2)Object.prototype.hasOwnProperty.call(m2,s)&&(m2[s]=e[Q4[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(p0.indexOf(17)===-1&&p0.push(17),p0.indexOf(18)===-1&&p0.push(18),m2[17]=!0,m2[18]=!0);const o=Hs();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&Kb(e,n[s],o,t);if(!(r in y0))return;const i=y0[r],a=i.length;for(let s=0;s<a;s++)if((e.type==="keydown"&&i[s].keydown||e.type==="keyup"&&i[s].keyup)&&i[s].key){const c=i[s],{splitKey:u}=c,d=c.key.split(u),h=[];for(let C=0;C<d.length;C++)h.push(ul(d[C]));h.sort().join("")===p0.sort().join("")&&Kb(e,c,o,t)}}function ao(e,t,n){p0=[];const r=$M(e);let o=[],i="all",a=document,s=0,c=!1,u=!0,d="+",h=!1,C=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(c=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(h=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(C=!0)),typeof t=="string"&&(i=t),C&&QM(e,i);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=UM(Io,e)),e=e[e.length-1],e=e==="*"?"*":ul(e),e in y0||(y0[e]=[]),y0[e].push({keyup:c,keydown:u,scope:i,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!na.has(a)){const m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Wb(v,a)},A=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Wb(v,a),Aae(v)};na.set(a,{keydownListener:m,keyupListenr:A,capture:h}),zd(a,"keydown",m,h),zd(a,"keyup",A,h)}if(!us){const m=()=>{p0=[]};us={listener:m,capture:h},zd(window,"focus",m,h)}}}function vae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(y0).forEach(n=>{y0[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function Mg(e){const t=Object.values(y0).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:i}=na.get(e)||{};r&&o&&(M4(e,"keyup",o,i),M4(e,"keydown",r,i),na.delete(e))}if((t.length<=0||na.size<=0)&&(Object.keys(na).forEach(o=>{const{keydownListener:i,keyupListenr:a,capture:s}=na.get(o)||{};i&&a&&(M4(o,"keyup",a,s),M4(o,"keydown",i,s),na.delete(o))}),na.clear(),Object.keys(y0).forEach(o=>delete y0[o]),us)){const{listener:o,capture:i}=us;M4(window,"focus",o,i),us=null}}const Zd={getPressedKeyString:hae,setScope:WM,getScope:Hs,deleteScope:pae,getPressedKeyCodes:fae,getAllKeyCodes:Cae,isPressed:mae,filter:gae,trigger:vae,unbind:QM,keyMap:Ms,modifier:Io,modifierMap:Q4};for(const e in Zd)Object.prototype.hasOwnProperty.call(Zd,e)&&(ao[e]=Zd[e]);if(typeof window<"u"){const e=window.hotkeys;ao.noConflict=t=>(t&&window.hotkeys===ao&&(window.hotkeys=e),ao),window.hotkeys=ao}class Y1 extends R.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(ao.filter=t),ao.unbind(this.props.keyName),ao(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){ao.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:i}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!i&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Y1.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}};Y1.propTypes={keyName:U3.string,filter:U3.func,onKeyDown:U3.func,onKeyUp:U3.func,disabled:U3.bool,splitKey:U3.string};const GM=["shift","alt","meta","mod","ctrl","control"],bae={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function e9(e){return(bae[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function YM(e){return GM.includes(e)}function Ud(e,t=","){return e.toLowerCase().split(t)}function $d(e,t="+",n=">",r=!1,o){let i=[],a=!1;e.includes(n)?(a=!0,i=e.toLocaleLowerCase().split(n).map(u=>e9(u))):i=e.toLocaleLowerCase().split(t).map(u=>e9(u));const s={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod"),useKey:r},c=i.filter(u=>!GM.includes(u));return{...s,keys:c,description:o,isSequence:a}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&qM([e9(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&XM([e9(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{aa.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{aa.clear()},0)}));const aa=new Set;function Hg(e){return Array.isArray(e)}function yae(e,t=","){return(Hg(e)?e:e.split(t)).every(n=>aa.has(n.trim().toLowerCase()))}function qM(e){const t=Array.isArray(e)?e:[e];aa.has("meta")&&aa.forEach(n=>!YM(n)&&aa.delete(n.toLowerCase())),t.forEach(n=>aa.add(n.toLowerCase()))}function XM(e){const t=Array.isArray(e)?e:[e];e==="meta"?aa.clear():t.forEach(n=>aa.delete(n.toLowerCase()))}function wae(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function xae(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function _ae(e){return JM(e,["input","textarea","select"])}function JM(e,t=!1){const{target:n,composed:r}=e;let o;return Eae(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,Hg(t)?!!(o&&t&&t.some(i=>i.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function Eae(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Sae(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const Mae=(e,t,n=!1)=>{const{alt:r,meta:o,mod:i,shift:a,ctrl:s,keys:c,useKey:u}=t,{code:d,key:h,ctrlKey:C,metaKey:m,shiftKey:A,altKey:v}=e,p=e9(d);if(u&&(c==null?void 0:c.length)===1&&c.includes(h))return!0;if(!(c!=null&&c.includes(p))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(p))return!1;if(!n){if(r!==v&&p!=="alt"||a!==A&&p!=="shift")return!1;if(i){if(!m&&!C)return!1}else if(o!==m&&p!=="meta"&&p!=="os"||s!==C&&p!=="ctrl"&&p!=="control")return!1}return c&&c.length===1&&c.includes(p)?!0:c?yae(c):!c},Hae=R.createContext(void 0),Lae=()=>R.useContext(Hae);function eH(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&eH(e[r],t[r]),!0):e===t}const Bae=R.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Oae=()=>R.useContext(Bae);function Rae(e){const t=R.useRef(void 0);return eH(t.current,e)||(t.current=e),t.current}const Qb=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Iae=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Gb(e,t,n,r){const o=R.useRef(null),i=R.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=Hg(e)?e.join(a==null?void 0:a.delimiter):e,c=n instanceof Array?n:r instanceof Array?r:void 0,u=R.useCallback(t,c??[]),d=R.useRef(u);c?d.current=u:d.current=t;const h=Rae(a),{activeScopes:C}=Oae(),m=Lae();return Iae(()=>{if((h==null?void 0:h.enabled)===!1||!Sae(C,h==null?void 0:h.scopes))return;let A=[],v;const p=(E,S=!1)=>{var M;if(!(_ae(E)&&!JM(E,h==null?void 0:h.enableOnFormTags))){if(o.current!==null){const H=o.current.getRootNode();if((H instanceof Document||H instanceof ShadowRoot)&&H.activeElement!==o.current&&!o.current.contains(H.activeElement)){Qb(E);return}}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||Ud(s,h==null?void 0:h.delimiter).forEach(H=>{var O,k,D,N;if(H.includes((h==null?void 0:h.splitKey)??"+")&&H.includes((h==null?void 0:h.sequenceSplitKey)??">")){console.warn(`Hotkey ${H} contains both ${(h==null?void 0:h.splitKey)??"+"} and ${(h==null?void 0:h.sequenceSplitKey)??">"} which is not supported.`);return}const P=$d(H,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description);if(P.isSequence){v=setTimeout(()=>{A=[]},(h==null?void 0:h.sequenceTimeoutMs)??1e3);const F=P.useKey?E.key:e9(E.code);if(YM(F.toLowerCase()))return;A.push(F);const j=(O=P.keys)==null?void 0:O[A.length-1];if(F!==j){A=[],v&&clearTimeout(v);return}A.length===((k=P.keys)==null?void 0:k.length)&&(d.current(E,P),v&&clearTimeout(v),A=[])}else if(Mae(E,P,h==null?void 0:h.ignoreModifiers)||(D=P.keys)!=null&&D.includes("*")){if((N=h==null?void 0:h.ignoreEventWhen)!=null&&N.call(h,E)||S&&i.current)return;if(wae(E,P,h==null?void 0:h.preventDefault),!xae(E,P,h==null?void 0:h.enabled)){Qb(E);return}d.current(E,P),S||(i.current=!0)}})}},_=E=>{E.code!==void 0&&(qM(e9(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&p(E))},w=E=>{E.code!==void 0&&(XM(e9(E.code)),i.current=!1,h!=null&&h.keyup&&p(E,!0))},x=o.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",w,a==null?void 0:a.eventListenerOptions),x.addEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),m&&Ud(s,h==null?void 0:h.delimiter).forEach(E=>m.addHotkey($d(E,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description))),()=>{x.removeEventListener("keyup",w,a==null?void 0:a.eventListenerOptions),x.removeEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),m&&Ud(s,h==null?void 0:h.delimiter).forEach(E=>m.removeHotkey($d(E,h==null?void 0:h.splitKey,h==null?void 0:h.sequenceSplitKey,h==null?void 0:h.useKey,h==null?void 0:h.description))),A=[],v&&clearTimeout(v)}},[s,h,C]),o}const kae="_table_q0jcp_1",Dae="_table__header_q0jcp_18",Pae="_table__header__th_q0jcp_24",Nae="_table__row_q0jcp_38",Tae="_table__row__row_selected_q0jcp_44",Fae="_table__row__td_q0jcp_47",Vae="_clickable_q0jcp_68",jae="_loadMoreButton_q0jcp_73",zae="_loadMoreButtonDiv_q0jcp_78",Zae="_table_container_q0jcp_84",Uae="_scrollable_table_q0jcp_92",$ae="_pagination_container_q0jcp_104",Kae="_pagination_btn_q0jcp_113",Wae="_active_q0jcp_130",Qae="_pagination_dots_q0jcp_135",Gae="_pagination_input_q0jcp_140",Yae="_nextPrevArrow_q0jcp_165",qae="_pagination_left_q0jcp_179",Xae="_pagination_right_q0jcp_191",Jae="_pagination_loading_q0jcp_204",p2={table:kae,table__header:Dae,table__header__th:Pae,table__row:Nae,table__row__row_selected:Tae,table__row__td:Fae,clickable:Vae,loadMoreButton:jae,loadMoreButtonDiv:zae,table_container:Zae,scrollable_table:Uae,pagination_container:$ae,pagination_btn:Kae,active:Wae,pagination_dots:Qae,pagination_input:Gae,nextPrevArrow:Yae,pagination_left:qae,pagination_right:Xae,pagination_loading:Jae},tH=({children:e,disableOverflowY:t=!1,tableClass:n="",disableFixHeight:r,isPagination:o=!0})=>Z.jsx("div",{className:qn(p2.table_container,n),style:{overflowY:t?"unset":"auto",height:r?"unset":o?"70vh":"78vh",maxHeight:o?"70vh":"85vh"},children:Z.jsx("table",{id:"resizeMe",className:qn(p2.table,p2.scrollable_table),children:e})}),nH=({children:e})=>Z.jsx("tbody",{className:p2.table__body,children:e}),Lg=({children:e,className:t="",title:n="",onclick:r})=>Z.jsx("tr",{className:qn(p2.table__row,{[t]:!!t}),title:n,...r&&{onClick:r},children:e}),G4=({children:e,className:t="",extraClass:n="",title:r="",...o})=>{const i=qn(p2.table__row__td,t,(n==null?void 0:n.length)>0&&p2.clickable);return Z.jsx("td",{className:i,title:r,children:Z.jsx("span",{...o,style:{textAlign:"left"},children:e})})},rH=({children:e,className:t="",title:n=""})=>Z.jsx("th",{className:qn(p2.table__header__th,{[t]:t}),title:n,children:Z.jsxs("span",{children:[e," "]})}),oH=({children:e,className:t=""})=>Z.jsx("thead",{className:qn(p2.table__header,{[t]:!!t}),children:e}),iH=({list:e,headerClass:t="",type:n=""})=>(console.log("AWIHEADER List,",e),Z.jsx(oH,{className:t,children:Z.jsx(Lg,{children:e.map(r=>Z.jsx(rH,{children:r},r))},`row_${n}`)},n)),Ch=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:i=()=>{console.log("Not available")},handleZoomOutClick:a=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:c=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:h=()=>{console.log("Not available")},switchToAutoAnnotations:C=()=>{console.log("Not available")},openShortCutRequestDetails:m=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:A=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:p,request:_,switchToEditMode:w=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:E=()=>{console.log("Not available")},goToPreviousImage:S=()=>{console.log("Not available")},loggedUser:M,handleGoToPendingAnnotations:H=()=>{console.log("Not available")},handleCopyByCtrlC:O=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:k=()=>{console.log("Not available")},openShortCutKeyModal:D,setOpenShortCutKeyModal:N=()=>{console.log("Not available")},setIsAltViaToolPressHandle:P=()=>{console.log("Not available")},isCarousel:F=!1,selectedTool:j="",setCrossHairHandle:V=()=>{console.log("Not available")},controlMinusHotkey:T=()=>{console.log("Not available")},controlPlusHotkey:$=()=>{console.log("Not available")}})=>{const K=Br.isSAMAllowed(_==null?void 0:_.awi_annotation_type,_==null?void 0:_.awi_request_for)&&!p,q=["awi_annotator","awi_verifier","awi_developer"].includes(M.userObj.awi_level),W=()=>{const J=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],Y=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],ee=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return M.userObj.awi_level==="awi_verifier"?[...J,...ee,...Y]:M.userObj.awi_level==="awi_supervisor"?J:[...J,...ee]},U=J=>{switch(J){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return i();case"zoom_out":return a();case"complete":return s();case"undo":return c();case"reload":return u();case"toggle_pagination":return d(Y=>!Y);case"fullscreen":return h();case"auto_annotations":return C();case"open_shortcut_details":return m();case"recent_verified":return A();case"send_to_sam":if(K)return j!="SAM"&&C(),v();W1.error("SAM is not allowed");return;case"edit_mode":if(w)return w();break;case"create_mode":if(x)return x();break;case"next_image":if(E)return E();break;case"prev_image":if(S)return S();break;case"pending_annotations":if(H)return H();break;case"copy":if(O)return O();break;case"paste":if(k)return k();break;case"pan_mode":P();break;case"cross_hair":V&&typeof V=="function"&&V();break;default:console.warn(`Unhandled hotkey action: ${J}`)}},G=(J,Y)=>{U(J),Y&&N(!1)};return Gb("ctrl+=",J=>{J.preventDefault(),$()}),Gb("ctrl+-, ctrl+subtract, ctrl+minus",J=>{J.preventDefault(),T()}),Z.jsxs(Z.Fragment,{children:[Z.jsx(Y1,{allowRepeat:!0,keyName:"t",onKeyDown:()=>U("select_forward")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"u",onKeyDown:()=>U("select_backward")}),Z.jsx(Y1,{allowRepeat:!1,keyName:"l",onKeyDown:()=>U("select_last_update")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"left",onKeyDown:()=>U("move_left")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"right",onKeyDown:()=>U("move_right")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"up",onKeyDown:()=>U("move_up")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"down",onKeyDown:()=>U("move_down")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"i",onKeyDown:()=>U("zoom_in")}),Z.jsx(Y1,{allowRepeat:!0,keyName:"o",onKeyDown:()=>U("zoom_out")}),Z.jsx(Y1,{keyName:"enter",onKeyDown:()=>U("complete")}),Z.jsx(Y1,{keyName:"ctrl+z",onKeyDown:()=>U("undo")}),Z.jsx(Y1,{keyName:"r",onKeyDown:()=>U("reload")}),Z.jsx(Y1,{keyName:"h",onKeyDown:()=>U("toggle_pagination")}),Z.jsx(Y1,{keyName:"f",onKeyDown:()=>U("fullscreen")}),Z.jsx(Y1,{keyName:"s",onKeyDown:()=>U("auto_annotations")}),Z.jsx(Y1,{keyName:"v",onKeyDown:()=>U("open_shortcut_details")}),Z.jsx(Y1,{keyName:"alt+r",onKeyDown:()=>U("recent_verified")}),K&&Z.jsx(Y1,{keyName:"x",onKeyDown:()=>U("send_to_sam")}),q&&Z.jsxs(Z.Fragment,{children:[Z.jsx(Y1,{keyName:"e",onKeyDown:()=>U("edit_mode")}),Z.jsx(Y1,{keyName:"q",onKeyDown:()=>U("create_mode")})]}),Z.jsx(Y1,{keyName:"d",onKeyDown:()=>U("next_image")}),Z.jsx(Y1,{keyName:"a",onKeyDown:()=>U("prev_image")}),M.userObj.awi_level==="awi_verifier"&&Z.jsx(Y1,{keyName:"p",onKeyDown:()=>U("pending_annotations")}),Z.jsx(Y1,{keyName:"ctrl+c",onKeyDown:()=>U("copy")}),Z.jsx(Y1,{keyName:"ctrl+v",onKeyDown:()=>U("paste")}),Z.jsx(Y1,{keyName:"m",onKeyDown:()=>U("pan_mode")}),Z.jsx(Y1,{keyName:"w",onKeyDown:()=>U("cross_hair")}),D&&!F&&Z.jsx(Z.Fragment,{children:Z.jsxs(v7,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>N(!1),className:"noPadding",children:[Z.jsx(y7,{title:"Shortcut keys",onClose:()=>N(!1)}),Z.jsx(b7,{children:Z.jsxs(tH,{children:[Z.jsx(iH,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),Z.jsx(nH,{children:(W()||[]).map((J,Y)=>{var ee;return Z.jsxs(Lg,{title:J.title,children:[Z.jsx(G4,{children:Y+1}),Z.jsx(G4,{children:J.action}),Z.jsx(G4,{children:Z.jsxs("div",{className:"shortcutKey",children:[" ",J.displayKey," "]})}),Z.jsx(G4,{children:((ee=J==null?void 0:J.key)==null?void 0:ee.length)>0&&Z.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>G(J.key,J.isClose),children:"Press"})})]})})})]})}),Z.jsx(x7,{})]})})]})},e9e=10,t9e=12,Yb=e=>{switch(e){case"rectangle":return X1.rectangleIcon.IconComponent;case"circle":return X1.circleIcon.IconComponent;case"polygon":return X1.polygonIcon.IconComponent;case"dot":return X1.dotIcon.IconComponent;default:return X1.rectangleIcon.IconComponent}},Tc=({isEditing:e,handleSelectTool:t=()=>{console.log("handleSelectTool function is not provided")},handleSAMToggle:n=()=>{console.log("handleSAMToggle function is not provided")},hasAnnotation:r=!1,currentSelectedSAMTool:o="Normal",handleCopyAnnotations:i,setOpenRequestDetails:a=()=>{console.log("setOpenRequestDetails function is not provided")},openRequestDetails:s,show_guidelines_first:c,handleZoomInClick:u,zoomProperties:d,handleReset:h,handleZoomOutClick:C,handleCompleteAnnotation:m,toggleFullscreen:A,selectAnnotationId:v,selectedAnnotationInfo:p,undoLastStateAnnotation:_,usingSamFunction:w,samAPIactive:x,handleSendToSamFunction:E,coordinates:S,handleSendToSamFunctionPrompt:M,reLoadAndReDrawAnnotations:H,showGuidelinesFirst:O,isMobile:k,toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,undoAnnotationPoint:V,togglePagination:T,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,showPagination:Y=!1,loggedUser:ee,isControlViaToolPress:re,isAltViaToolPress:ue,setIsControlViaToolPress:se,setIsAltViaToolPress:_e,isCarousel:xe=!1,allowedToCopyPreview:Ae,classColorMapToSend:he,request:le,parentReqData:ae,RequestInfoModal:ye,setCrossHair:Re,isCrossHair:Ie,annotationViewType:Ce="atom",REACT_APP_SAM_ENABLED:et="no",controlPlusHotkey:fe,controlMinusHotkey:ne,Carousel:pe})=>{var Gt,An,bn,Qt,Ot,Ht,_t,Zt,Cn,mt;(a==null||typeof a!="function")&&(a=pt=>{console.log("setOpenRequestDetails function is not provided",pt)}),t||(t=pt=>{console.log("handleSelectTool function is not provided",pt)}),n||(n=pt=>{console.log("handleSAMToggle function is not provided",pt)});const[Ee,Le]=R.useState(!1),[Be,je]=R.useState(!1),[We,lt]=R.useState(""),[tt,Qe]=R.useState(!1),[Fe,ot]=R.useState(o),Ue=()=>{lt(""),a(!1),je(!1),Le(!0)},Ve=(pt="annotated")=>{lt(pt),a(!1),Le(!1),je(!0)},Ge=()=>{le!=null&&le.total_verified_images_count?Ve("verified"):Ve("annotated")},dt=pt=>{t("annotate"),n(pt),ot(pt)},qe=pt=>{typeof t=="function"&&t("edit"),typeof n=="function"&&n("Normal"),typeof ot=="function"&&ot("Normal")},ft=()=>{if(Fe=="Normal"){if(!Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for))return;dt("SAM")}else dt("Normal")},Pt=()=>{O&&s||typeof a=="function"&&a(pt=>!pt)};R.useEffect(()=>{o&&ot(o)},[o]);const Wt=pt=>{i&&typeof i=="function"&&i(pt,!0)},an=()=>{_e(!ue)},Dn=()=>{Re(!Ie)};return Ae&&xe?null:xe?Z.jsx(Z.Fragment,{children:Z.jsx(Ch,{toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,handleZoomInClick:u,handleZoomOutClick:C,handleCompleteAnnotation:m,undoAnnotationPoint:V,reLoadAndReDrawAnnotations:H,togglePagination:T,toggleFullscreen:A,switchToAutoAnnotations:ft,openShortCutRequestDetails:Pt,handleRecentAnnotatedVerifiedImages:Ge,samAPIactive:x,request:le,handleSendToSamFunctionPrompt:M,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,openShortCutKeyModal:tt,setOpenShortCutKeyModal:Qe,setIsAltViaToolPressHandle:an,isCarousel:xe,selectedTool:Fe,setCrossHairHandle:Dn,loggedUser:ee,controlMinusHotkey:ne,controlPlusHotkey:fe})}):Z.jsxs("div",{style:{...k||Ce==="library"?{width:"100%",height:"40px"}:{height:"100%",width:"100%",maxHeight:"100%"},overflow:"auto"},children:[Z.jsx(Z.Fragment,{children:Z.jsx(Ch,{toggleSelectAnnotation:D,handleLeftKeyDown:N,handleRightKeyDown:P,handleUpKeyDown:F,handleDownKeyDown:j,handleZoomInClick:u,handleZoomOutClick:C,handleCompleteAnnotation:m,undoAnnotationPoint:V,reLoadAndReDrawAnnotations:H,togglePagination:T,toggleFullscreen:A,switchToAutoAnnotations:ft,openShortCutRequestDetails:Pt,handleRecentAnnotatedVerifiedImages:Ge,samAPIactive:x,request:le,handleSendToSamFunctionPrompt:M,switchToEditMode:$,switchToCreateMode:K,goToNextImage:q,goToPreviousImage:W,handleGoToPendingAnnotations:U,handleCopyByCtrlC:G,handlePasteAnnotationsByControlV:J,openShortCutKeyModal:tt,setOpenShortCutKeyModal:Qe,setIsAltViaToolPressHandle:an,selectedTool:Fe,setCrossHairHandle:Dn,loggedUser:ee,isCarousel:xe,controlMinusHotkey:ne,controlPlusHotkey:fe})}),Z.jsxs("div",{className:Sn.annotation__tool__icons,style:{display:"flex",justifyContent:k?"center":"space-between",flexDirection:k?"row":"column",backgroundColor:"#fff",width:k?"100%":"auto",...k||Ce=="library"?{maxWidth:"100%",overflowX:"auto",gap:"20px"}:{height:"100%"}},children:[Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[(le==null?void 0:le.awi_request_for)!="attributes"?Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:!e},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>{typeof t=="function"&&t("annotate")},title:e?"Create to change from edit to create mode":"Create to start create mode",children:(le==null?void 0:le.awi_annotation_type)&&((Gt=le==null?void 0:le.awi_annotation_type)==null?void 0:Gt.length)>0&&Z.jsx("img",{src:Yb(le==null?void 0:le.awi_annotation_type),alt:"annotation tool",title:"Annotate - keyboard(Q)",className:Sn.annotationIcon})}):Z.jsx("div",{className:Sn.annotationIconDiv,children:(le==null?void 0:le.awi_annotation_type)&&((An=le==null?void 0:le.awi_annotation_type)==null?void 0:An.length)>0&&Z.jsx("img",{src:Yb(le==null?void 0:le.awi_annotation_type),alt:"annotation tool",title:"Annotate - keyboard(Q)",className:Sn.annotationIcon})}),r&&Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:e},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>qe(),title:"Edit - keyboard(E)",children:Z.jsx("img",{src:X1.editIcon.IconComponent,alt:"Edit",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:re},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>se(!re),title:"Control",children:Z.jsx("img",{src:X1.controlIcon.IconComponent,alt:"Control",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:ue},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>_e(!ue),title:"Alt press / Panning mode",children:Z.jsx("img",{src:X1.moveIcon.IconComponent,alt:"Alt",className:Sn.annotationIcon})}),Z.jsx("div",{className:qn({[Sn.annotation__tool__icons__selected]:Ie},Sn.annotationIconDiv,"cursor-pointer"),onClick:()=>Re(!Ie),title:"Cross Hair",children:Z.jsx("img",{src:X1.crosshairIcon.IconComponent,alt:"Cross Hair",className:Sn.annotationIcon})}),!e&&(le==null?void 0:le.awi_annotation_type)==="polygon"&&(le==null?void 0:le.awi_request_for)!="attributes"&&S.length>2?Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:m,title:"Click to complete your polygon annotation",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.filledTickIcon.IconComponent,className:Sn.annotationIcon})})}):Z.jsx(Z.Fragment,{children:(le==null?void 0:le.awi_annotation_type)==="polygon"&&Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{title:"Works for create mode with minimum 3 coordinates",className:Sn.annotationIconDiv,style:{cursor:"not-allowed !important",opacity:"0.5"},children:Z.jsx("img",{src:X1.filledTickIcon.IconComponent,className:qn(Sn.annotationIcon,"not-allowed-pointer")})})})}),Z.jsx("div",{className:Sn.partitionLine})]}),Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsxs("div",{onClick:((bn=p==null?void 0:p.past_coords)==null?void 0:bn.length)>0&&e&&v!=="-1"?_:void 0,title:((Qt=p==null?void 0:p.past_coords)==null?void 0:Qt.length)>0&&e&&v!=="-1"?"Click to revert annotation":"No undo available",style:{width:"1.8rem",height:"1.8rem",position:"relative",cursor:((Ot=p==null?void 0:p.past_coords)==null?void 0:Ot.length)>0&&e&&v!=="-1"?"pointer":"not-allowed",opacity:((Ht=p==null?void 0:p.past_coords)==null?void 0:Ht.length)>0&&e&&v!=="-1"?1:.5,pointerEvents:((_t=p==null?void 0:p.past_coords)==null?void 0:_t.length)>0&&e&&v!=="-1"?"auto":"none"},children:[Z.jsx("img",{src:X1.undoAnnotationIcon.IconComponent,alt:"Undo",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"0.25rem"}}),((Zt=p==null?void 0:p.past_coords)==null?void 0:Zt.length)>0&&e&&v!=="-1"&&Z.jsx("div",{className:Sn.undoAnnotationCount,children:p.past_coords.length})]})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("img",{onClick:u,src:X1.zoomInIcon.IconComponent,className:`cursor-pointer ${d.scale===t9e?"cursor-pointer-disable":""} ${Sn.annotationIcon}`,title:"Zoom in - Keyboard(I)"})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("div",{onClick:h,title:`Click to Reset Zoom ${d.scale.toFixed(1)} to default`,className:Sn.annotationIcon,style:{fontSize:"12px",justifyContent:"center",display:"flex"},children:d.scale.toFixed(1)})}),Z.jsx("div",{className:Sn.annotationIconDiv,children:Z.jsx("img",{onClick:C,src:X1.zoomOutIcon.IconComponent,className:`cursor-pointer ${d.scale===1?"cursor-pointer-disable":""} ${Sn.annotationIcon}`,title:"Zoom out - Keyboard(O)"})}),Z.jsx("div",{onClick:()=>A(),className:Sn.annotationIconDiv,style:{display:"flex",alignItems:"center",justifyContent:"center"},title:"Toggle Fullscreen - Keyboard(F)",id:"toggle_full_screen",children:Z.jsx("img",{src:X1.toggleFullscreenIcon.IconComponent,className:Sn.annotationIcon})}),Z.jsx("div",{className:Sn.partitionLine})]}),Z.jsxs("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:[et=="yes"&&Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for)&&Z.jsx("div",{style:{display:"flex",alignItems:"center"},title:"AI tools - keyboard(S)",children:Z.jsxs("label",{className:Sn.switch,style:{marginLeft:"4px",width:"30px important"},children:[Z.jsx("input",{type:"checkbox",checked:Fe==="SAM",onChange:()=>{dt(Fe==="SAM"?"Normal":"SAM")}}),Z.jsx("span",{className:qn(Sn.slider,Sn.round)})]})}),Br.isSAMAllowed(le==null?void 0:le.awi_annotation_type,le==null?void 0:le.awi_request_for)&&Z.jsxs("div",{className:qn({"disabled-class":!w}),style:{justifyContent:"space-between",display:"flex",flexDirection:k?"row":"column",gap:"15px"},children:[(le==null?void 0:le.awi_annotation_type)&&(le==null?void 0:le.awi_annotation_type)!="dot"&&Z.jsx("div",{onClick:()=>{!x&&(S!=null&&S.length)&&E()},className:qn({"disabled-class":!w||x||!(S!=null&&S.length)},Sn.annotationIconDiv,"cursor-pointer"),style:{pointerEvents:x||!w?"none":"auto",opacity:x||!w?.5:1},children:Z.jsx("img",{src:X1.pointAnnotationIcon.IconComponent,title:"Mark some points and then click here and get the power of AI auto annotation",className:Sn.annotationIcon})}),Z.jsx("div",{onClick:x?void 0:M,style:{pointerEvents:x||!w?"none":"auto",opacity:x||!w?.5:1},title:"Give your prompt and get the power of AI auto annotation",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.promptAnnotationIcon.IconComponent,title:"auto annotation prompt - keyboard(X)",className:Sn.annotationIcon})})]}),Z.jsx("div",{onClick:H,title:"Click to refetch saved annotations, hard reset",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.refetchAnnotationIcon.IconComponent,title:"Refetch annotations (Hard Reset) - keyboard(R)",className:Sn.annotationIcon})}),Z.jsx("div",{style:{width:"53%",height:"2px",backgroundColor:"#e4e0e6",margin:"8px auto"}})]}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:()=>{typeof a=="function"&&a(pt=>!pt)},title:"View details - keyboard(V)",className:Sn.annotationIconDiv,children:Z.jsx("img",{src:X1.guidelinesIcon.IconComponent,alt:"info",style:{height:"30px !important",width:"30px !important",cursor:"pointer"}})})}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{children:Z.jsx("img",{src:X1.keyboardShortcutsIcon.IconComponent,title:"See short-cut keys",className:"cursor-pointer",width:"30px",onClick:()=>Qe(pt=>!pt)})})}),Z.jsx("div",{className:Sn.annotationIconPartition,style:k?{flexDirection:"row",padding:"0"}:{flexDirection:"column"},children:Z.jsx("div",{onClick:T,children:Z.jsx("img",{src:X1.transparentBlackIcon.IconComponent,style:{height:"24px",width:" 24px",cursor:"pointer"},alt:"Previous",title:Y?"Hide Pagination":"Show Pagination"})})})]}),s&&ye&&Z.jsx(ye,{request:le,handleReferenceImageClick:Ue,handleRecentAnnotatedImages:Ve,show_guidelines_first:c,setOpenRequestDetails:a,classColorMapToSend:he}),s&&ye&&Z.jsx("div",{className:qn(Sn.backdrop),onClick:()=>{c||typeof a=="function"&&a(!1)}}),s&&Z.jsx("div",{className:qn(Sn.backdrop),onClick:()=>{O||typeof a=="function"&&a(!1)}}),pe&&Ee&&Z.jsx(Z.Fragment,{children:Z.jsx(pe,{handleToggleCarousel:()=>Le(!1),requestName:(le==null?void 0:le.awi_label)||"",showAnnotationType:"all",requestId:(ae==null?void 0:ae.awi_id)||(le==null?void 0:le.awi_id),imageKeys:((Cn=ae==null?void 0:ae.awi_reference_images)==null?void 0:Cn.awi_ids)||((mt=le==null?void 0:le.awi_reference_images)==null?void 0:mt.awi_ids)||[],awi_reference_image:!0,defaultAnnotationMode:"display_annotations",allowedToCopy:!0,copyCallBack:Wt})}),Ee&&Z.jsx("div",{className:qn(Sn.backdrop,Sn.backdrop__transparent),onClick:()=>Le(!1)}),pe&&Be&&Z.jsx(Z.Fragment,{children:Z.jsx(pe,{handleToggleCarousel:()=>je(!1),requestName:(le==null?void 0:le.awi_label)||"",showAnnotationType:"all",requestId:(ae==null?void 0:ae.awi_id)||(le==null?void 0:le.awi_id),awi_reference_image:!1,contentAnnotationType:We||"annotated",primaryLimit:e9e,defaultAnnotationMode:"display_annotations",allowedToCopy:!0,copyCallBack:Wt})})]})},n9e="_canvas_145op_1",r9e="_canvasContainer_145op_9",o9e="_canvasSubContainer_145op_18",C6={canvas:n9e,canvasContainer:r9e,canvasSubContainer:o9e},Fc=({canvasDimensions:e,zoomProperties:t,isEditing:n,canvasRef:r,bgCanvasRef:o,overlayCanvasRef:i,handleMouseDown:a,handleMouseUp:s,handleMouseMove:c,handleMouseMoveOut:u,handleOnMouseLeave:d,handleWheel:h,handleTouchStart:C,handleTouchMove:m,handleTouchEnd:A,handleTouchCancel:v})=>Z.jsxs("div",{className:C6.canvasSubContainer,style:{display:"flex",flexDirection:"row",width:e.width,height:e.height,position:"relative"},children:[Z.jsx("canvas",{ref:o,className:C6.bgCanvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,zIndex:0,pointerEvents:"none"}}),Z.jsx("canvas",{ref:r,className:C6.canvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,cursor:n?"default":"crosshair",transformOrigin:"top left",transform:`translate(${t.x}px, ${t.y}px)`},onMouseDown:a,onMouseUp:s,onMouseMove:c,onMouseOut:u,onMouseLeave:d,onWheel:h,onTouchStart:C,onTouchMove:m,onTouchEnd:A,onTouchCancel:v}),Z.jsx("canvas",{ref:i,className:C6.overlayCanvas,style:{position:"absolute",top:0,left:0,width:`${e.width*t.scale}px`,height:`${e.height*t.scale}px`,pointerEvents:"none",zIndex:2,transformOrigin:"top left",transform:`translate(${t.x}px, ${t.y}px)`}})]}),i9e=1e-5,a9e=.99999,s9e=.001,l9e=.005,B8=(e,t)=>e/(t||1),aH=(e,t,n,r)=>Math.sqrt(Math.pow(Math.abs(n-e),2)+Math.pow(Math.abs(r-t),2)),gh=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y),c9e=e=>{let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach(({x:i,y:a})=>{t=Math.min(t,i),n=Math.min(n,a),r=Math.max(r,i),o=Math.max(o,a)}),{minX:t,minY:n,maxX:r,maxY:o}},mh=(e,t,n=0)=>{let r=0;for(let o=0;o<(t==null?void 0:t.length)-1;o++){const i=t[o],a=t[o+1];i.y<=e.y+n?a.y>e.y+n&&gh(i,a,e)>0&&r++:a.y<=e.y-n&&gh(i,a,e)<0&&r--}return r},Bg=e=>(e==null?void 0:e.length)<2?0:Math.sqrt(Math.pow(Math.abs(e[0].x-e[1].x),2)+Math.pow(Math.abs(e[0].y-e[1].y),2));function u9e(e,t,n=0){const r=Math.min(...t.map(u=>u.x)),o=Math.max(...t.map(u=>u.x)),i=Math.min(...t.map(u=>u.y)),a=Math.max(...t.map(u=>u.y)),{x:s,y:c}=e;return s>=r-n&&s<=o+n&&c>=i-n&&c<=a+n}const d9e=(e,t,n,r,o,i,a=1)=>{if(!(n!=null&&n.length))return!1;let s,c,u,d,h=!1;switch(i==null?void 0:i.awi_annotation_type){case"rectangle":h=u9e({x:e,y:t},n,r);break;case"polygon":h=mh({x:e,y:t},n,r)!==0;break;case"circle":s=Bg(n)/2,c=(n[0].x+r+(n[1].x-o))/2,u=(n[0].y+n[1].y)/2,d=(e-c)*(e-c)+(t-u)*(t-u),d<s*s?h=!0:h=!1;break;case"dot":s=B8(.015,a),c=(n[0].x+r+(n[0].x-o))/2,u=(n[0].y+n[0].y)/2,d=(e-c)*(e-c)+(t-u)*(t-u),d<s*s?h=!0:h=!1;break;default:h=mh({x:e,y:t},n,r)!==0}return h},f9e=e=>!(!e||e.x>1||e.x<0||e.y1>1||e.y<0),h9e=e=>{if((e==null?void 0:e.length)<3)return!1;for(let t=0;t<e.length;t++)if(!f9e(e[t]))return!1;return!0},C9e=(e,t,n=!1,r=1)=>{var a,s,c,u;const o=e==null?void 0:e.awi_annotation_type;let i=!1;switch(o){case"rectangle":const d=B8(s9e,r);(t==null?void 0:t.length)>3&&Math.abs(((a=t[0])==null?void 0:a.x)-((s=t[1])==null?void 0:s.x))>d&&Math.abs(((c=t[1])==null?void 0:c.y)-((u=t[3])==null?void 0:u.y))>d&&(i=!0);break;case"circle":const h=B8(l9e,r);Bg(t)>h&&(i=!0);break;case"polygon":i=h9e(t);break;case"dot":i=!0;break;default:n&&(i=!0);break}return i},sH=(e,t,n,r,o,i)=>{const a=e-n,s=t-r,c=o-n,u=i-r,d=a*c+s*u,h=c*c+u*u,C=h!==0?d/h:-1;let m,A;C<0?(m=n,A=r):C>1?(m=o,A=i):(m=n+C*c,A=r+C*u);const v=e-m,p=t-A;return Math.sqrt(v*v+p*p)},g9e=(e,t,n)=>{let r=1/0,o=-1;for(let i=0;i<(e==null?void 0:e.length);i++){const a=(i+1)%e.length,{x:s,y:c}=e[i],{x:u,y:d}=e[a],h=sH(t,n,s,c,u,d);h<r&&(r=h,o=a)}return{insertIndex:o,minDistance:r}},lH=(e,t)=>t===0?e:lH(t,e%t),m9e=(e,t,n,r)=>(e>0&&(e=0),Math.abs(e)>n&&(e=-1*n),Math.abs(t)>r&&(t=-1*r),t>0&&(t=0),{newXTransform:e,newYTransform:t}),p9e=function(e){console.log("getBoundingBox called");const t=Math.min(...e.map(i=>i.x)),n=Math.max(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y)),o=Math.max(...e.map(i=>i.y));return[{x:t,y:r},{x:n,y:r},{x:n,y:o},{x:t,y:o}]};function A9e(e,t,n){return Math.min(n,Math.max(t,e))}function v9e(e,t=.05,n=null){const r=Math.min(...e.map(h=>h.x)),o=Math.max(...e.map(h=>h.x)),i=Math.min(...e.map(h=>h.y)),a=Math.max(...e.map(h=>h.y)),s=o-r,c=a-i;let u,d;if(n&&(n==null?void 0:n.x)>=0&&(n==null?void 0:n.y)>=0){const h=n.x,C=n.y;u=Math.max(-r,Math.min(1-o,h-(r+s/2))),d=Math.max(-i,Math.min(1-a,C-(i+c/2)))}else u=Math.max(-r,Math.min(1-o,(Math.random()*2-1)*t)),d=Math.max(-i,Math.min(1-a,(Math.random()*2-1)*t));return e.map(h=>({x:h.x+u,y:h.y+d}))}function b9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.max(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.y));return cH([{x:t,y:r},{x:n,y:o}])}function y9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.max(...e.map(s=>s.x)),r=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.y)),i=(t+n)/2,a=(r+o)/2;return[{x:i,y:a}]}const Kd=(e,t)=>(e.x-t.x)**2+(e.y-t.y)**2,w9e=(e,t,n)=>{const r=Kd(t,n);if(r===0)return Kd(e,t);let o=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;o=Math.max(0,Math.min(1,o));const i={x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)};return Kd(e,i)},x9e=(e,t)=>{let n=1/0;for(let r=0;r<(t==null?void 0:t.length);r++){const o=t[r],i=t[(r+1)%t.length],a=w9e(e,o,i);n=Math.min(n,a)}return Math.sqrt(n)},_9e=(e,t)=>{let n=1/0,r=-1;for(let o=0;o<(t==null?void 0:t.length);o++){const i=t[o],a=aH(e.x,e.y,i.x,i.y);if(a<n){const s=o%t.length;n=a,r=s}}return{minDistance:n,insertIndex:r}},ph=(e=0)=>(e<=0?e=i9e:e>=1&&(e=a9e),e),E9e=e=>e.map(n=>({x:ph(n.x),y:ph(n.y)})),S9e=e=>{const t=new Set,n=[];for(let r=0;r<e.length;r++){const o=`${e[r].x},${e[r].y}`;t.has(o)||(t.add(o),n.push(e[r]))}return n.length>0&&n.push(n[0]),n},M9e=e=>{let t=0;for(let n=0;n<e.length;n++)if(e[n].x<=0){t=t+1;continue}else if(e[n].y<=0){t=t+1;continue}else if(e[n].x>=1){t=t+1;continue}else if(e[n].y>=1){t=t+1;continue}return t};function H9e(e){const t=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),r=Math.max(...e.map(s=>s.x)),o=Math.max(...e.map(s=>s.y)),i=t<0?-t:r>1?1-r:0,a=n<0?-n:o>1?1-o:0;return e.map(({x:s,y:c})=>({x:s+i,y:c+a}))}const L9e=(e,t)=>{const n=(e.x+t.x)/2,r=(e.y+t.y)/2,o=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)/2,i=Math.min(n,1-n),a=Math.min(r,1-r),s=Math.min(o,i,a),c=Math.atan2(t.y-e.y,t.x-e.x),u={x:n-s*Math.cos(c),y:r-s*Math.sin(c)},d={x:n+s*Math.cos(c),y:r+s*Math.sin(c)};return[u,d]},B9e=(e,t)=>{const n=(e[0].x+e[1].x)/2,r=t,i=Math.sqrt(Math.pow(e[1].x-e[0].x,2))/2;let a=0;return n-i<0?a=i-n:n+i>1&&(a=1-(n+i)),e[0].x+=a,e[1].x+=a,e[0].y=r,e[1].y=r,e},cH=e=>{e=L9e(e[0],e[1]);const t=(e[0].x+e[1].x)/2,n=(e[0].y+e[1].y)/2,o=Math.sqrt(Math.pow(e[1].x-e[0].x,2)+Math.pow(e[1].y-e[0].y,2))/2;let i=0;t-o<0?i=o-t:t+o>1&&(i=1-(t+o));let a=0;return n-o<0?a=o-n:n+o>1&&(a=1-(n+o)),e[0].x+=i,e[0].y+=a,e[1].x+=i,e[1].y+=a,B9e(e,n)},O9e=(e,t,n)=>{let{x:r,y:o}=uH(e.current,t);const i=n;r=Math.min(r,1),o=Math.min(o,1);const a=r-i.x,s=o-i.y;let c=[];return a===0||s===0?c=[{x:i.x,y:i.y},{x:i.x,y:i.y},{x:i.x,y:i.y},{x:i.x,y:i.y}]:a>0&&s>0?c=[{x:i.x,y:i.y},{x:r,y:i.y},{x:r,y:o},{x:i.x,y:o}]:a>0&&s<0?c=[{x:i.x,y:o},{x:r,y:o},{x:r,y:i.y},{x:i.x,y:i.y}]:a<0&&s>0?c=[{x:r,y:i.y},{x:i.x,y:i.y},{x:i.x,y:o},{x:r,y:o}]:c=[{x:r,y:o},{x:i.x,y:o},{x:i.x,y:i.y},{x:r,y:i.y}],c},uH=(e,t)=>{if(!e)return{x:0,y:0};const n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/(n.right-n.left),y:(t.clientY-n.top)/(n.bottom-n.top)}},R9e=(e,t)=>{if(!e)return{x:0,y:0};const n=e.getBoundingClientRect(),r={x:(t.clientX-n.left)/(n.right-n.left),y:(t.clientY-n.top)/(n.bottom-n.top)};return r.x<=0&&(r.x=1e-4),r.y<=0&&(r.y=1e-4),r.x>=1&&(r.x=1-1e-4),r.y>=1&&(r.y=1-1e-4),r},On={gcd:lH,getDistance:aH,isLeft:gh,windingNumber:mh,getDiameter:Bg,checkPointInsidePolygon:d9e,isAnnotationCoordinatesValid:C9e,distanceToSegment:sH,findClosestSegment:g9e,transformCoordinatesCheck:m9e,getBoundingBox:p9e,translateCoordinatesWithFixedWidth:v9e,clampValue:A9e,calculateCircleFromCoordinates:b9e,calculateCentroid:y9e,minDistanceToPolygon:x9e,closestCoordinates:_9e,fineTuneCoordinates:E9e,zoomLevelValue:B8,createPolygonLoop:S9e,breakPointCount:M9e,getBoundingBoxValues:c9e,shiftPolygon:H9e,getPerfectPointValue:ph,adjustToCircle:cH,getMousePos:uH,getMousePosAbsolute:R9e,getUpdatedCoordinates:O9e},I9e=({imageUrl:e,showAnnotations:t=!1,createAnnotation:n,handleMultipleAnnotations:r,handleUpdateAnnotationCoordinates:o,content_id:i,request_id:a,className:s="",isEditing:c=!1,selectIndex:u="-1",handleSelectAnnotationIndex:d,handleSelectTool:h,showAnnotationType:C="all",loggedUser:m,isCarousel:A=!1,classColorMap:v=null,disableAnnotation:p=!1,SAMToggle:_,imageNumber:w=0,togglePagination:x,handleSAMToggle:E,unSelectedAnnotationIDsSet:S=new Set,setMousePosition:M,allowedToCopyPreview:H=!1,copyCallBackHandler:O,annotationSession:k,SAMToggleValue:D,selectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,handleNextPage:V,handlePreviousPage:T,currentPage:$,handleUpdateImageIndex:K,requestId:q,showPagination:W,isAnnotationCreating:U,contentInfo:G,content_key:J,isAnnotationUpdating:Y,isDeleteAnnotationMutationLoading:ee,showGuidelinesFirst:re,currentImage:ue=0,selectedContent:se=null,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handlePasteAnnotationsByControlV:ae,annotationsResponse:ye,isAnnotationFetching:Re,fetchAnnotationsKey:Ie,request:Ce,parentReqData:et,clearAnnotationCache:fe,RequestInfoModal:ne,getAnnotationFromSAM:pe,getAnnotationsFromSAMPrompt:Ee,fetchAnnotations:Le,pageCount:Be=10,annotationViewType:je="atom",AnnotationPagination:We,REACT_APP_SAM_ENABLED:lt="no",ImageGenerationHelper:tt=ZM,fallbackImageUrl:Qe,activeColor:Fe,Carousel:ot,showTool:Ue=!0})=>{var oi,Ba,f,b,B,z,X,ie,ke,Je,rt,Bt,nn,In,Gn,f0;const Ve=ig().isCtrlPressedFunc,Ge=ig().isAltPressedFunc,[dt,qe]=R.useState(!1),[ft,Pt]=R.useState(!1),Wt=.007,an=.03,Dn=.01,Gt=.005,An=.005,bn=.7,Qt=.005,Ot=.005,Ht=.003,_t=.01,Zt="#40ff00",Cn="#fff",mt="#FFFF00",pt="red",Lt="rgba(0, 255, 255, 1)",Xe="rgba(0, 255, 255, 0.5)",zt="#FF3131",ve=4,it=5,$e={DEFAULT:1.5,SELECTED:4.5,CAROUSAL:2.5,CIRCLE:2},yt=R.useRef(""),Ye=R.useRef(null),Et=R.useRef(null),Rt=R.useRef(null),Vt=BS(),[En,At]=R.useState(!1),[vt,Nt]=R.useState(!1),[nt,Tt]=R.useState([]),[Ut,A1]=R.useState(),[L1,o1]=R.useState(),[Jn,$n]=R.useState({x:-1,y:-1}),[v1,j1]=R.useState(-1),[Jt,Mn]=R.useState({x:0,y:0}),[Dt,cn]=R.useState(u),[jn,D1]=R.useState("-1"),[n1,b1]=R.useState([]),[gn,$t]=R.useState(!1),[yn,Hn]=R.useState(null),[wt,kt]=R.useState({width:0,height:0}),Ft=I1.INITIAL_ZOOM_PROPERTIES,[at,mn]=R.useState(Ft),[Pn,P1]=R.useState(!1),[c1,a0]=R.useState(!1),[un,wn]=R.useState(-1),[tn,jt]=R.useState(!1),Yt=I1.INITIAL_ZOOM_LEVEL,Wn=12,Qn=wt.width*Yt,S1=R.useRef(null),[vn,y2]=R.useState(ye),[Nn,q0]=R.useState(),[pn,fn]=R.useState([]),[Bn,B1]=R.useState(null),r0=I1.SAM_MODEL_NAME,M1=I1.SAM_MODEL_CONFIDENCE,jr=I1.SAM_MODEL_MAX_RESULTS,[P2,Fn]=R.useState(!1),[e1,jo]=R.useState(-1),[A9,ya]=R.useState(null),[zr,wa]=R.useState(null),[v9,b9]=R.useState(null),[f1,L0]=R.useState({modelName:"",modelConfidence:0,modelMaxResults:0,promptMessage:""}),[u2,w2]=R.useState(null),[zo,xa]=R.useState(!1),[v0,S3]=R.useState({x:-1,y:-1}),[X2,M3]=R.useState({left:0,right:0,top:0,bottom:0}),[N2,_a]=R.useState(null),[J2,s0]=R.useState(""),H3={SELECT:2e3,NOT_SELECT:500},[g0,Zr]=R.useState(""),Zo=window.devicePixelRatio,[T1,Uo]=R.useState(window.innerWidth<768*Zo),[y9,G1]=R.useState(window.innerWidth<1200*Zo),d2=R.useRef(null),$o=R.useRef(null),[L3,Ko]=R.useState(!1);R.useEffect(()=>{const be=()=>{Uo(window.innerWidth<768*Zo),G1(window.innerWidth<1200*Zo)};return window.addEventListener("resize",be),()=>window.removeEventListener("resize",be)},[]),R.useEffect(()=>{L3&&Fi()},[L3,at,wt]),R.useEffect(()=>{if(!J2){$o.current=null,Ko(!1);return}const be=new window.Image;be.onload=()=>{$o.current=be,Ko(!0)},be.src=J2},[J2]),R.useEffect(()=>(ht(nt),Yo(),()=>{N2&&clearTimeout(N2)}),[jn]),R.useEffect(()=>{A||document.fullscreenElement||ia.getItem("full_screen")=="yes"&&tr(!1),window.addEventListener("resize",S2)},[]),R.useEffect(()=>{console.log("Change"),Tt([]),Oi(),setTimeout(()=>{ht()},50)},[c]),R.useEffect(()=>{v&&ht(nt)},[v]),R.useEffect(()=>{i&&(i==null?void 0:i.length)>0&&e0()},[i]),R.useEffect(()=>{y2(ye||null)},[ye,i]),R.useEffect(()=>{if(e){const be=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1));f2(be)}Tt([])},[e]),R.useEffect(()=>{J2&&(yt.current=J2,O1())},[J2]),R.useEffect(()=>{yt.current&&S2()},[yt.current,J2]),R.useEffect(()=>{_=="SAM"?P1(!0):P1(!1),B3()},[_]),R.useEffect(()=>{at.scale==1&&(at.x!=0||at.y!=0)&&e0()},[at.scale]),R.useEffect(()=>{if(((vn==null?void 0:vn.result)||[]).length>=0){const{x:be,y:ge}=On.getMousePos(Ye.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});O1(nt,{x:be,y:ge})}},[wt,t,at.scale,jn]),R.useEffect(()=>{Oi(),((vn==null?void 0:vn.result)||[]).length>=0&&ht()},[n1,Dt]),R.useEffect(()=>{if(Ce&&vn&&(vn!=null&&vn.result)&&((vn==null?void 0:vn.result)||[]).length>=0){ht(nt);const be={},ge={};for(let Me=0;Me<vn.result.length;Me++)be[vn.result[Me].awi_id]={...vn.result[Me],index:Me},(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&(ge[vn.result[Me].awi_id]=On.getBoundingBoxValues(vn.result[Me].awi_coords));wa(be),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&B1(ge),(Ce==null?void 0:Ce.awi_request_for)=="attributes"&&vn.result.length>0&&u=="-1"&&typeof d=="function"&&setTimeout(()=>{d(vn.result[0].awi_id)},100)}else wa(null),B1(null);x9()},[Ce,vn]),R.useEffect(()=>{x9()},[S]),R.useEffect(()=>{console.log("Filter annotation change"),O1(nt),setTimeout(()=>{O1(nt)},100)},[pn]),R.useEffect(()=>{u!=="-1"?typeof h=="function"&&(Ce==null?void 0:Ce.awi_request_for)!=="outline"&&h("edit"):b1([]),Pn&&typeof h=="function"&&cn("-1"),cn(u||"-1")},[u]),R.useEffect(()=>{A||w==0&&Pn!==void 0&&(Pn?W1.success("Switched to Auto Annotation mode"):Ce!=null&&Ce.awi_annotation_type&&W1.success(`Switched to ${Ce==null?void 0:Ce.awi_annotation_type} Annotation mode`))},[Pn]),R.useEffect(()=>{if(!M||typeof M!="function")return;qo();const be=setTimeout(()=>{const{x:ge,y:Me}=On.getMousePosAbsolute(Ye.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});M({x:ge,y:Me})},30);return()=>clearTimeout(be)},[Ut]),R.useEffect(()=>{c1?qo():ei(-1,-1)},[c1]),R.useEffect(()=>{u!="-1"&&zr&&q0(zr[u])},[u,zr]),R.useEffect(()=>{Go(),qo()},[at,wt]);const a4=be=>{const ge=be.message;Zr(ge)};R.useEffect(()=>{let be="";U?be="Creating Annotation...":ee?be="Deleting Annotation...":Y?be="Updating Annotation...":Re?be="Fetching Annotations...":tn&&(be="Generating AI Annotations..."),a4({message:be})},[U,Y,ee,Re,tn]),R.useEffect(()=>{S2()},[W]);const Wo=pe&&typeof pe=="function"?ob(pe):null,Qo=Ee&&typeof Ee=="function"?ob(Ee):null,x2=()=>!!(dt||Ve()),X0=()=>!!(ft||Ge()),Go=()=>{const be=wt.width*at.scale,ge=wt.height*at.scale;M3({left:Math.abs(at.x),right:Math.max(0,be-wt.width+at.x),top:Math.abs(at.y),bottom:Math.max(0,ge-wt.height+at.y)})},Bi=R.useMemo(()=>{const be=(vn==null?void 0:vn.result)||[];if(be.length>0&&Dt!=="-1"){let ge=null,Me=null;const Te=be.reduce((De,ut)=>{const{awi_id:xt}=ut;return xt===Dt?ge=ut:xt===jn?Me=ut:S.has(xt)||De.push(ut),De},[]);return Me&&Te.push(Me),ge&&Te.push(ge),Te}else return pn},[Dt,jn,pn]),f2=async be=>{pS.checkImageValidity(be,s0,i,je,Qe)},Oi=()=>{jn!="-1"&&(N2&&clearTimeout(N2),D1("-1"))},Yo=()=>{if(jn!=="-1")if(Dt=="-1"||I1.HOVER_TO_SELECT_ON_ALREADY_SELECTED){const be=Dt=="-1"?H3.NOT_SELECT:H3.SELECT;N2&&clearTimeout(N2);const ge=setTimeout(()=>{c&&jn!="-1"&&Dt!=jn&&(Dt=="-1"&&gn?Yo():typeof d=="function"&&(d(jn),W1.success("Annotation selected successfully",jn)))},be);_a(ge)}else N2&&clearTimeout(N2);else N2&&clearTimeout(N2)},qo=()=>{const be=Et.current;if(!be)return;const ge=wt.width*at.scale,Me=wt.height*at.scale;if(be.width=ge,be.height=Me,c1){const{x:Te,y:De}=On.getMousePosAbsolute(Et.current,{clientX:Ut==null?void 0:Ut.x,clientY:Ut==null?void 0:Ut.y});ei(Te,De)}},_2=()=>{Tt([])},Xo=(be=!1)=>{Vt.invalidateQueries(Ie),be&&Tt([])},E2=be=>{var ge;if(zr&&zr[be])if(c){const Me=zr[be].index,Te=vn==null?void 0:vn.result[Me];return Te||((ge=vn==null?void 0:vn.result)==null?void 0:ge.find(De=>De.awi_id==be))}else return zr[be];else return null},w9=be=>v9&&v9[be]?v9[be].index:-1,B3=()=>{nt.length>0&&(console.log("clearCoordinate"),Tt([]),O1([],{x:0,y:0},!0))},x9=()=>{if(Ce&&((vn==null?void 0:vn.result)||[]).length>=0){let be=[];(S==null?void 0:S.size)>0?be=((vn==null?void 0:vn.result)||[]).filter(Me=>!S.has(Me.awi_id)):be=(vn==null?void 0:vn.result)||[];const ge={};for(let Me=0;Me<be.length;Me++)ge[be[Me].awi_id]={...be[Me],index:Me};b9(ge),fn(be)}else fn([])},t1=be=>(T1&&(be=be*3),On.zoomLevelValue(be,at.scale)),T2=new Map,Ri=be=>{try{if(!be)return Promise.resolve(I1.DEFAULT_CANVAS_RATION);if(T2.has(be))return T2.get(be);const ge=new Promise((Me,Te)=>{const De=new Image;De.onload=()=>{const xt={w:De.width,h:De.height};T2.set(be,Promise.resolve(xt)),Me(xt)},De.onerror=Te;const ut=tt.getImageKitUrl(be,-1,-1,1);ut&&(De.src=ut)});return T2.set(be,ge),ge}catch(ge){return console.error(ge),Promise.resolve(I1.DEFAULT_CANVAS_RATION)}},S2=async()=>{var be,ge,Me,Te,De;if(console.log("updateDimensions called"),((be=yt.current)==null?void 0:be.length)>0){console.log("Canvas true");let ut=I1.DEFAULT_CANVAS_RATION;xa(!0);try{ut=await Ri(yt.current)}catch(Kt){console.error("Error fetching image dimensions:",Kt,yt.current),ut=I1.DEFAULT_CANVAS_RATION}const xt=On.gcd(ut.w,ut.h),Xt={w:ut.w/xt,h:ut.h/xt};let hn=0,Ct=0;if(Ct=((ge=Rt.current)==null?void 0:ge.offsetHeight)||0,hn=Ct*Xt.w/Xt.h,hn>(((Me=Rt.current)==null?void 0:Me.offsetWidth)||0)&&(hn=((Te=Rt.current)==null?void 0:Te.offsetWidth)||0,Ct=hn*Xt.h/Xt.w),(Ye==null?void 0:Ye.current)!=null&&(Ye.current.width=hn,Ye.current.height=Ct,u2==null)){const Kt=(De=Ye.current)==null?void 0:De.getBoundingClientRect();w2({left:Kt==null?void 0:Kt.left,top:Kt==null?void 0:Kt.top})}kt({width:hn,height:Ct}),xa(!1),O1(nt)}},Ur=R.useCallback((be,ge,Me,Te,De,ut)=>On.checkPointInsidePolygon(be,ge,Me,Te,De,ut,at.scale),[]),mr=(be,ge=!0)=>{const{x:Me,y:Te}=On.getMousePos(Ye.current,be);let De="",ut=1/0;if(c&&Jo(Me,Te))return[Dt];const xt=pn||[];if(!ge&&(xt==null?void 0:xt.length)>I1.MAX_ANNOTATIONS_TO_HOVER)return[];switch(Ce==null?void 0:Ce.awi_annotation_type){case"circle":{xt.forEach(({awi_coords:Xt,awi_id:hn})=>{if(Ur(Me,Te,Xt,0,0,Ce)){const Ct=On.minDistanceToPolygon({x:Me,y:Te},Xt);Ct<ut&&(De=hn,ut=Ct)}});break}case"dot":{const Xt=t1(An);xt.forEach(({awi_coords:hn,awi_id:Ct})=>{if(Ur(Me,Te,hn,Xt,Xt,Ce)){const Kt=On.minDistanceToPolygon({x:Me,y:Te},hn);Kt<ut&&(De=Ct,ut=Kt)}});break}case"rectangle":{const Xt=t1(Qt)/2;for(let hn=0;hn<xt.length;hn++){const{awi_coords:Ct,awi_id:Kt}=xt[hn];if(Ur(Me,Te,Ct,Xt,0,Ce)){const x1=On.minDistanceToPolygon({x:Me,y:Te},Ct);x1<ut&&(De=Kt,ut=x1)}}break}case"polygon":{for(let Xt=0;Xt<xt.length;Xt++){const{awi_coords:hn,awi_id:Ct}=xt[Xt];if(Bn){const Kt=Bn[Ct];if(Kt){const{minX:x1,minY:ce,maxX:h0,maxY:B0}=Kt;if(Me<x1||Me>h0||Te<ce||Te>B0)continue}}if(Ur(Me,Te,hn,0,0,Ce)){const Kt=On.minDistanceToPolygon({x:Me,y:Te},hn);Kt<ut&&(De=Ct,ut=Kt)}}break}default:console.warn(`Unknown annotation type: ${Ce==null?void 0:Ce.awi_annotation_type}`);break}return De&&De.length>0?(ge&&cn(De),[De]):(ge&&(console.log("setSelectAnnotationId "),typeof d=="function"&&u!="-1"&&d("-1",!1)),[])},s4=cl.throttle(mr,50),Jo=(be,ge)=>{const Me=E2(u);if(Me){const Te=Me.awi_coords;if((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"){const De=On.minDistanceToPolygon({x:be,y:ge},Te),ut=t1(Ot);return De<=ut}else if((Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"){const{insertIndex:De,minDistance:ut}=On.closestCoordinates({x:be,y:ge},Te),xt=t1(Ot);return console.log(De),ut<=xt}}else return!1},O3=(be,ge)=>{const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=E2(ge);if(console.log("selectAnnotation",De),De){const{awi_coords:ut}=De;if(ut.length===1){const Ct=t1(Gt);Ur(Me,Te,ut,Ct,Ct,Ce)&&(Nt(!0),$t(!0),o1({x:Me,y:Te}),Tt(ut));return}if(ut.length===2){const{x:Ct,y:Kt}=ut[0],{x:x1,y:ce}=ut[1],h0=On.getDiameter([{x:Ct,y:Kt},{x:x1,y:ce}])/2,B0=(Ct+x1)/2,m1=(Kt+ce)/2;Nt(!0),$t(!0),o1({x:Me,y:Te}),$n({x:Me,y:Te}),Tt(ut);const rn=(Me-B0)*(Me-B0)+(Te-m1)*(Te-m1),_0=t1(bn);rn>_0*_0*h0*h0&&$t(!1);return}const xt=x2()?0:t1(Wt),Xt=Ur(Me,Te,ut,xt,0,Ce),hn=Jo(Me,Te);if(!Xt&&!hn)$n({x:-1,y:-1}),o1({x:0,y:0}),$t(!1);else{if(o1({x:Me,y:Te}),Nt(!0),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon")if(x2())$t(!0);else if(Ur(Me,Te,ut,xt,0,Ce)){const{minDistance:Kt}=On.findClosestSegment(ut,Me,Te),x1=t1(_t);Kt>=x1?$t(!0):$t(!1)}else $t(!1);else $t(!0);Tt(ut),$n({x:-1,y:-1}),x2()||ut.forEach((Ct,Kt)=>{if(Me<=Ct.x+xt&&Me>=Ct.x&&Te<=Ct.y+xt&&Te>=Ct.y||Me>=Ct.x-xt&&Me<=Ct.x&&Te>=Ct.y-xt&&Te<=Ct.y||Me<=Ct.x+xt&&Me>=Ct.x&&Te>=Ct.y-xt&&Te<=Ct.y||Me>=Ct.x-xt&&Me<=Ct.x&&Te<=Ct.y+xt&&Te>=Ct.y){if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon")c?($n({x:Me,y:Te}),j1(Kt)):(j1(Kt),$n(ut[Kt])),console.log("setSelectCornerCoordinates");else if((Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"&&!Pn){const x1=ut[(Kt+2)%4];$n(x1)}else if(c){const x1=ut[(Kt+2)%4];$n(x1)}else j1(Kt),$n(ut[Kt]);$t(!1),Tt([])}})}}},Ii=(be="all")=>{const ge=window.devicePixelRatio;if(be!="cross"&&Ye.current)if(at.scale==1){const Me=+getComputedStyle(Ye.current).getPropertyValue("height").slice(0,-2),Te=+getComputedStyle(Ye.current).getPropertyValue("width").slice(0,-2);Ye.current.setAttribute("height",(Me*ge).toString()),Ye.current.setAttribute("width",(Te*ge).toString())}else{const Me=wt.height*at.scale,Te=wt.width*at.scale;Ye.current.setAttribute("height",(Me*ge).toString()),Ye.current.setAttribute("width",(Te*ge).toString())}if(Et.current)if(at.scale==1){const Me=+getComputedStyle(Et.current).getPropertyValue("height").slice(0,-2),Te=+getComputedStyle(Et.current).getPropertyValue("width").slice(0,-2);Et.current.setAttribute("height",(Me*ge).toString()),Et.current.setAttribute("width",(Te*ge).toString())}else{const Me=wt.height*at.scale,Te=wt.width*at.scale;Et.current.setAttribute("height",(Me*ge).toString()),Et.current.setAttribute("width",(Te*ge).toString())}},Co=(be,ge)=>{const Me=On.getDistance(be.x,be.y,ge.x,ge.y),Te=t1(Wt),De=t1(Dn);if(Me<=De){let ut=!1;return Me<=Te?ut=!1:Me<=De&&(ut=!0),{success:!0,distance:Me,zoomClosePoint:Te,zoomPointAnnotationValue:De,isExtraPointNeeded:ut}}else return{success:!1,distance:Me,zoomClosePoint:Te,zoomPointAnnotationValue:De,isExtraPointNeeded:!1}},$r=(be=[],ge={x:0,y:0},Me=!1,Te=!1,De)=>{if((be||[]).length>0){De.beginPath();const ut=M2(be);if((Ce==null?void 0:Ce.awi_annotation_type)==="rectangle")if(Pn){if(c){De.moveTo(ut[0].x,ut[0].y);for(let xt=1;xt<ut.length;xt++)De.lineTo(ut[xt].x,ut[xt].y);De.closePath()}else if(Pn){console.log("Sam function");const xt=M2(be);De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,xt.forEach(Xt=>{De.beginPath(),De.arc(Xt.x,Xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}}else{De.moveTo(ut[0].x,ut[0].y);for(let xt=1;xt<ut.length;xt++)De.lineTo(ut[xt].x,ut[xt].y);De.closePath()}else if((Ce==null?void 0:Ce.awi_annotation_type)==="circle")if(Pn&&!c){const xt=M2(be);console.log("coordinatesVal ",xt),De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,xt.forEach(Xt=>{De.beginPath(),De.arc(Xt.x,Xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}else{const xt=On.getDiameter(ut);De.arc((ut[0].x+ut[1].x)/2,(ut[0].y+ut[1].y)/2,Math.floor(xt/2),0,I1.TWO_PIE)}De.save(),De.lineWidth=$e.DEFAULT,De.strokeStyle=Zt,De.stroke()}if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&(nt||[]).length>0&&!Me&&!c){if(!Pn){const ut=M2(nt);if(De.beginPath(),De.lineWidth=$e.DEFAULT,De.strokeStyle=Zt,ut.forEach((xt,Xt)=>{if(Xt>0){const hn=ut[Xt-1];De.moveTo(hn.x,hn.y),De.lineTo(xt.x,xt.y)}}),De.stroke(),ut.forEach((xt,Xt)=>{De.beginPath(),De.arc(xt.x,xt.y,it,0,I1.TWO_PIE,!0),De.fillStyle=Xt===0?mt:Zt,De.fill()}),!X0()&&!Te&&ge&&ge.x>0&&ge.y>0&&!(ge.x>.998||ge.y>.998||ge.x<.002||ge.y<.002)){const xt=M2([ge]);De.beginPath();const Xt=Co(nt[0],ge);Xt!=null&&Xt.success&&(nt==null?void 0:nt.length)>2?Xt.isExtraPointNeeded?(De.beginPath(),De.rect(xt[0].x-ve*3,xt[0].y-ve*3,ve*6,ve*6),De.fillStyle=pt,De.fill(),De.lineWidth=4,De.strokeStyle=pt,De.stroke()):(De.beginPath(),De.rect(xt[0].x-ve*3,xt[0].y-ve*3,ve*6,ve*6),De.fillStyle=mt,De.fill(),De.lineWidth=2,De.strokeStyle=mt,De.stroke()):De.arc(xt[0].x,xt[0].y,ve,0,I1.TWO_PIE,!0),De.fillStyle="rgba(0,0,0,0.35)",De.fill(),De.strokeStyle=Zt,De.stroke();const hn=ut[ut.length-1];De.beginPath(),De.moveTo(hn.x,hn.y),De.lineTo(xt[0].x,xt[0].y),De.strokeStyle="#ff0000",De.setLineDash([5,5]),De.lineWidth=$e.DEFAULT,De.stroke(),De.setLineDash([])}De.closePath(),De.lineWidth=$e.DEFAULT,De.stroke(),De.save()}if(Pn){const ut=M2(be);De.clearRect(0,0,De.canvas.width,De.canvas.height),De.fillStyle="rgba(0, 0, 0, 0.35)",De.strokeStyle=Zt,De.lineWidth=$e.DEFAULT,ut.forEach(xt=>{De.beginPath(),De.arc(xt.x,xt.y,it,0,I1.TWO_PIE,!0),De.fill(),De.stroke()})}}},ei=(be,ge)=>{const Me=Et.current;if(!Me)return;const Te=Me.getContext("2d");if(!Te||(Te.clearRect(0,0,Me.width,Me.height),be==-1&&ge==-1))return;Ii("cross");const De=M2([{x:be,y:ge}])[0],ut=De.x,xt=De.y;Te.strokeStyle="#800080",Te.lineWidth=$e.CAROUSAL,Te.setLineDash([3,3]),Te.beginPath(),Te.moveTo(ut,0),Te.lineTo(ut,Me.height),Te.stroke(),Te.beginPath(),Te.moveTo(0,xt),Te.lineTo(Me.width,xt),Te.stroke(),Te.setLineDash([])},O1=(be=[],ge={x:0,y:0},Me=!1,Te=!1,De=0)=>{var ut,xt,Xt,hn;if(Ce&&!zo){const Ct=(ut=Ye.current)==null?void 0:ut.getContext("2d");if(Ii(),Ct!=null){Ct.imageSmoothingEnabled=!1,Ct.clearRect(0,0,wt.width,wt.height),!c&&(Ce==null?void 0:Ce.awi_request_for)!="attributes"&&$r(be,ge,Me,Te,Ct);const Kt=Bi||[];for(let x1=0;x1<Kt.length;x1++){const ce=Kt[x1],{awi_coords:h0,awi_id:B0,awi_status:m1}=ce;if(h0.length===0)return;const rn=M2(h0);Ct.beginPath(),Ct.lineJoin="round";let _0=!1,t2="",j2="";if(C==="all"||m1===C){ce.awi_status==="pending"?t2=ce.awi_outline_status==="approved"?"rgba(214, 204, 60, 0.3)":"rgba(0, 0, 0,0)":t2=I1.STATUS_COLOR_MAP[ce.awi_status]||"rgba(0, 0, 0,0)",j2=t2;let Yr=!1;if(B0===Dt?(Ct.lineWidth=$e.SELECTED,Ct.strokeStyle=Zt,Ct.fillStyle="rgba(0,0,0,0.40)",Yr=!0):B0===jn&&(Ct.lineWidth=$e.DEFAULT,Ct.strokeStyle=Lt,Ct.fillStyle=Xe,Yr=!0),!Yr)if(Ct.fillStyle=t2,A?Ct.lineWidth=$e.CAROUSAL:Ct.lineWidth=$e.DEFAULT,v){const n2=v[ce.awi_classes[0].awi_id];n2?(j2=n2,Ct.strokeStyle=n2):(j2=ce.awi_classes[0].awi_color,Ct.strokeStyle=ce.awi_classes[0].awi_color)}else j2=ce.awi_classes[0].awi_color,Ct.strokeStyle=ce.awi_classes[0].awi_color;switch(Ce==null?void 0:Ce.awi_annotation_type){case"circle":{const n2=(rn[0].x+rn[1].x)/2,ii=(rn[0].y+rn[1].y)/2,D3=Math.sqrt(Math.pow(rn[1].x-rn[0].x,2)+Math.pow(rn[1].y-rn[0].y,2));Ct.beginPath(),Ct.arc(n2,ii,D3/2,0,I1.TWO_PIE),Ct.stroke(),Ct.closePath(),_0=!0;break}case"dot":{Ct.beginPath(),Ct.moveTo(rn[0].x,rn[0].y),Ct.arc(rn[0].x,rn[0].y,ve,0,I1.TWO_PIE,!0),Ct.stroke(),Ct.closePath(),_0=!0;break}case"rectangle":{Ct.beginPath(),Ct.moveTo((xt=rn[0])==null?void 0:xt.x,(Xt=rn[0])==null?void 0:Xt.y);for(let n2=1;n2<rn.length;n2++)Ct.lineTo(rn[n2].x,rn[n2].y);Ct.closePath(),Ct.stroke(),_0=!0;break}case"polygon":{_0=!0,Ct.moveTo(rn[0].x,rn[0].y);const n2=rn.length;for(let ii=0;ii<n2;ii++)Ct.lineTo(rn[ii].x,rn[ii].y);break}}if(Ct.fill(),Ct.save(),Ct.stroke(),_0){Ct.save();const n2=B0===Dt,ii=B0===jn,D3=ce.sam_status==="yes";rn.forEach((Nl,c4)=>{Ct.beginPath();let H2=ve,qr="";n2?rn.length==1&&(Ce==null?void 0:Ce.awi_annotation_type)=="dot"||Te&&c4%(rn.length-1)==De?(H2=ve*2,qr=Zt):(qr=Zt,H2=ve):ii?(qr=Lt,H2=ve):(qr=j2,H2=ve),(Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?c4%(rn.length-1)==0&&(D3?qr=zt:qr=mt):c4==0&&rn.length>1&&D3&&(qr=zt),Ct.arc(Nl.x,Nl.y,H2,0,2*Math.PI,!0),Ct.fillStyle=qr,Ct.strokeStyle=qr,Ct.fill(),Ct.stroke(),Ct.restore()})}else console.log("Error")}}}qo()}if(at.scale==1&&(Ye!=null&&Ye.current)){const Ct=(hn=Ye==null?void 0:Ye.current)==null?void 0:hn.getBoundingClientRect();w2({top:Ct==null?void 0:Ct.top,left:Ct==null?void 0:Ct.left})}},M2=be=>be.map(Me=>({x:Me.x*Ye.current.width,y:Me.y*Ye.current.height})),Kr=be=>{const{x:ge,y:Me}=On.getMousePos(Ye.current,be);Tt(Te=>{const De=[...Te];return De[1].x=ge,De[1].y=Me,On.adjustToCircle(De)})},l0=be=>{if(be.length===0)return!1;const ge=On.isAnnotationCoordinatesValid(Ce,be,Pn,at.scale);return ge||O1(),ge},R3=(be,ge)=>(console.log("Has Moved checking"),Math.abs(be.x-ge.x)>0||Math.abs(be.y-ge.y)>0),go=()=>{if((nt==null?void 0:nt.length)>1){const be=nt[nt.length-1],ge=[];let Me=!1;for(let Te=0;Te<nt.length-1;Te++){const De=nt[Te],ut=t1(Gt);if(Math.abs(be.x-De.x)<=ut&&Math.abs(be.y-De.y)<=ut){Me=!0;continue}else ge.push({x:De.x,y:De.y})}return Me||ge.push(nt[nt.length-1]),Tt(ge),ge}else return nt},I3=()=>{if(typeof n=="function")if(nt.length>3){const be=Co(nt[0],nt[nt.length-1]);let ge=[];be.success&&(be.isExtraPointNeeded==!1?(nt[nt.length-1].x=nt[0].x,nt[nt.length-1].y=nt[0].y,ge=nt):be.isExtraPointNeeded&&(ge=[...nt,{x:nt[0].x,y:nt[0].y}])),(ge==null?void 0:ge.length)>0?(Tt([]),n(ge,null,!1,()=>{_2()})):O1(nt)}else O1(nt)},Z0=(be,ge)=>{console.log("deletePolygonPoint"),console.log("selectIndex ",ge);const Me=[];for(let Te=0;Te<be.length;Te++)Te!=ge&&Me.push(be[Te]);ge==0&&(Me[Me.length-1]=Me[0]),Tt(Me),(Me==null?void 0:Me.length)>3?(O1(Me),typeof o=="function"&&l0(Me)&&!p&&(W1.success("Point deleted successfully"),o(Me,u,()=>{_2()}))):W1.error("Point can not be deleted, as polygon need minimum of three points"),jo(-1),ya(null)};function J0(be,ge){console.log("handleAddAnnotationPoint");const Me=be.target;if(!(Me!=null&&Me.getBoundingClientRect))return;const Te=Me.getBoundingClientRect(),De=(be.clientX-Te.left)/Te.width,ut=(be.clientY-Te.top)/Te.height,{insertIndex:xt,minDistance:Xt}=On.closestCoordinates({x:De,y:ut},ge),hn=t1(Wt);if(Xt<hn){console.log("Very close point to insert"),console.log("minDistanceMin",Xt);const ce=t1(an);if(Xt<ce&&x2())console.log("We can remove this"),(ge==null?void 0:ge.length)>3&&(ya(ge),I1.POLYGON_POINT_REMOVE_CONFIRM_PROMPT?jo(xt):Z0(ge,xt));else{if(Xt<ce)W1.error("Press CTRL and then click to prompt for point deletion");else{const h0=(Xt*100).toFixed(1);W1.error("Very close point to draw "+h0+" it should be more than "+Wt*100)}jo(-1),ya(null)}return}if(x2())return;jo(-1),ya(null);const{insertIndex:Ct,minDistance:Kt}=On.findClosestSegment(ge,De,ut),x1=t1(_t);Kt>=x1||(ge.splice(Ct,0,{x:De,y:ut}),Tt(ge),O1(ge),typeof o=="function"&&l0(nt)&&!p&&o(nt,u,()=>{_2()}))}const ti=be=>{M&&typeof M<"u"&&typeof M=="function"&&(M({x:-1,y:-1}),ei(-1,-1)),Di(be,!0),jn!="-1"?Oi():(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&!c&&!A&&!Pn&&nt.length>0&&setTimeout(()=>{O1(nt)},200)},ki=be=>{if(!Pn){if((gn||vt&&Jn.x!==-1&&Jn.y!==-1)&&R3(L1,On.getMousePos(Ye.current,be))){const ge=E2(u);if(ge){const Me=l0(ge.awi_coords);if(typeof o=="function"&&Me)if(Jn.x!==-1&&Jn.y!==-1)if((Ce==null?void 0:Ce.awi_annotation_type)=="polygon")o(ge.awi_coords,Dt);else{const Te=On.getUpdatedCoordinates(Ye,be,Jn);o(Te,Dt)}else o(ge.awi_coords,Dt);else Me||((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&F2(ge.awi_coords,be),Xo(!0))}}En?(At(!1),typeof n=="function"&&l0(nt)&&((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?I3():n(nt,null,!1,()=>{_2()}))):vt&&(Nt(!1),cn("-1"),b1([]),typeof d=="function"&&d("-1"))}},Ea=be=>{if(!(Ye!=null&&Ye.current))return;const ge=s4(be,!1);(ge==null?void 0:ge.length)>0&&ge[0]!=Dt?(Yo(),D1(ge[0]),Ye.current.style.cursor="pointer"):jn!="-1"&&(D1("-1"),Dt=="-1"&&(Ye.current.style.cursor="default"))},_9=(be,ge=!1)=>{if(ge){ht(nt);return}const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=E2(u);if(De){const ut=De.awi_coords,{minDistance:xt,insertIndex:Xt}=On.closestCoordinates({x:Me,y:Te},ut),hn=t1(Qt);if(xt<=hn&&Ye.current){const Ct=Ye.current.getContext("2d");if(!Ct||Xt==un)return;Ye.current.style.cursor="pointer",wn(Xt),Ye.current.title="Point "+(Xt+1);const Kt=M2([ut[Xt]])[0];Ct.fillStyle=Cn,Ct.beginPath(),Ct.arc(Kt.x,Kt.y,ve*2.5,0,I1.TWO_PIE),Ct.strokeStyle="black",Ct.lineWidth=$e.SELECTED,Ct.stroke(),Ct.fill()}else if(Ye.current){if(!Ye.current.getContext("2d"))return;const Kt=t1(Ht);un!==-1&&(ht(),wn(-1)),(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"&&On.findClosestSegment(ut,Me,Te).minDistance<=Kt?(Ye.current.style.cursor="pointer",Ye.current.title="Add point"):(Ye.current.style.cursor="default",Ye.current.title="")}}},Di=Br.useThrottle(_9,100),ni=Br.useThrottle(Ea,100),F2=(be,ge)=>{if(On.breakPointCount(be)>0){console.log("================================BREAK================================"),$t(!1),ge&&ge.stopPropagation&&(ge==null||ge.stopPropagation());const Te=On.shiftPolygon(be);if(typeof o=="function"&&l0(Te)){const De=u;o(Te,u,()=>{Dt!=De&&cn(De),_2()})}}},Ze=()=>pn.length>I1.MAX_ANNOTATIONS_TO_RUN_FAST?ht:O1,ht=Br.useThrottle((be,ge,Me=!1,Te=!1,De=-1)=>{O1(be,ge,Me,Te,De)},50),st=(be="forward")=>{if((pn||[]).length!=0)if(be=="last_update"){const ge=pn==null?void 0:pn.reduce((Me,Te)=>{const De=new Date(Me.awi_last_updation).getTime();return new Date(Te.awi_last_updation).getTime()>De?Te:Me});ge&&(cn(ge.awi_id),typeof d=="function"&&d(ge.awi_id))}else if(u==="-1")(pn||[]).length>0&&(cn(pn[0].awi_id),typeof d=="function"&&d(pn[0].awi_id));else{const ge=w9(u);be=="backward"?ge!==-1?ge>0?(cn(pn[ge-1].awi_id),typeof d=="function"&&d(pn[ge-1].awi_id)):(cn(pn[pn.length-1].awi_id),typeof d=="function"&&d(pn[pn.length-1].awi_id)):(pn||[]).length>0&&(cn(pn[pn.length-1].awi_id),typeof d=="function"&&d(pn[pn.length-1].awi_id)):ge!==-1?(pn||[]).length>ge+1?(cn((pn||[])[ge+1].awi_id),typeof d=="function"&&d((pn||[])[ge+1].awi_id)):(cn((pn||[])[0].awi_id),typeof d=="function"&&d((pn||[])[0].awi_id)):(pn||[]).length>0&&(cn(pn[0].awi_id),typeof d=="function"&&d(pn[0].awi_id))}},sn=()=>{if(console.log("handleCompleteAnnotation"),!(!Ce||c))if(_==="SAM"){vo();return}else{if((Ce==null?void 0:Ce.awi_annotation_type)!="polygon")return;if(typeof n=="function"&&l0(nt))if((nt==null?void 0:nt.length)>2){const be=[...nt,{x:nt[0].x,y:nt[0].y}];Tt([]),n(be,null,!1,()=>{_2()})}else{W1.error("Polygon requires minimum of three coordinates");return}else W1.error("Invalid coordinates, please create valid coordinates")}},Un=be=>{console.log("handle Complete Multiple Annotation SAM");const ge=[];for(let Me=0;Me<(be==null?void 0:be.length);Me++){const Te=be[Me].outline,De=be[Me].classId;if(l0(Te)){const xt={coords:(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?On.createPolygonLoop(Te):Te,classId:De,isSam:!0};ge.push(xt)}}(ge==null?void 0:ge.length)>0&&typeof r=="function"&&(Tt([]),r(ge,()=>{(ge==null?void 0:ge.length)>0&&Xo()}))},h1=()=>{if(console.log("undoAnnotationPoint"),console.log("coordinates ------>",nt),u!="-1"){Ma();return}if(nt.length>0&&(Ce==null?void 0:Ce.awi_annotation_type)==="polygon")nt.pop(),Tt([...nt]),O1(nt);else if(nt.length>0&&Pn)nt.pop(),Tt([...nt]),O1(nt);else return},e0=()=>{mn(Ft)},R1=(be,ge="zoom-in")=>{if(Ye.current&&Ye)if(ge=="zoom-in"){const Me=Yt,Te=at.scale+Me,De=Ye.current.getBoundingClientRect(),ut=be.clientX-De.left,xt=be.clientY-De.top,Xt=Te/at.scale,hn=at.x-ut*(Xt-1),Ct=at.y-xt*(Xt-1),Kt={scale:+Te.toFixed(2),x:hn,y:Ct};mn(Kt),S3({x:be.clientX,y:be.clientY})}else{const Me=Yt,Te=at.scale-Me;if(Te==1)e0();else{const De=Ye.current.getBoundingClientRect();(v0.x==-1||v0.y==-1)&&console.log("zoomTimeMousePoint");const ut=v0.x!=-1?v0.x:be.clientX,xt=v0.y!=-1?v0.y:be.clientY,Xt=ut-De.left,hn=xt-De.top,Ct=Te/at.scale,Kt=-Math.abs(at.x+Xt*(1-Ct)),x1=-Math.abs(at.y+hn*(1-Ct)),ce=wt.width*(at.scale+Yt-1),h0=wt.height*(at.scale+Yt-1),{newXTransform:B0,newYTransform:m1}=On.transformCoordinatesCheck(Kt,x1,ce,h0),rn={scale:+Te.toFixed(2),x:B0,y:m1};mn(rn)}}},mo=(be=null)=>{if(at.scale!==Wn&&Ye.current)if(!be||!be.clientX||!be.clientY||be.type=="click"){const ge=wt.width*(at.scale+Yt-1),Me=wt.height*(at.scale+Yt-1),Te=at.x-wt.width*Yt/2,De=at.y-wt.height*Yt/2,{newXTransform:ut,newYTransform:xt}=On.transformCoordinatesCheck(Te,De,ge,Me),Xt={scale:+(at.scale+Yt).toFixed(2),x:ut,y:xt};mn(Xt)}else R1(be,"zoom-in")},e2=(be=null)=>{if(at.scale!==1&&Ye.current)if(!be||!be.clientX||!be.clientY||be.type=="click"){const ge=wt.width*(at.scale-Yt-1),Me=wt.height*(at.scale-Yt-1),Te=at.x+wt.width*Yt/2,De=at.y+wt.height*Yt/2,{newXTransform:ut,newYTransform:xt}=On.transformCoordinatesCheck(Te,De,ge,Me);mn({scale:+(at.scale-Yt).toFixed(2),x:ut,y:xt})}else R1(be,"zoom-out")},x0=be=>{be.deltaY<0?mo(be):e2(be)},po=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x+Qn,Te=at.y,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},Ao=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x-Qn,Te=at.y,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},pr=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x,Te=at.y+Qn,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})},Wr=()=>{const be=wt.width*(at.scale-1),ge=wt.height*(at.scale-1),Me=at.x,Te=at.y-Qn,{newXTransform:De,newYTransform:ut}=On.transformCoordinatesCheck(Me,Te,be,ge);mn({...at,x:De,y:ut})};if(!e||!i)return null;const vo=()=>{if(tn){W1.error("Request already in progress");return}if(!(nt!=null&&nt.length)){W1.error("No points to send");return}const be={};be.image_url=e,be.coords=nt,console.log("Sent to SAM",be),Pi(),typeof h=="function"&&h("annotate")},u1=()=>{if(P2?Fn(!1):P2||Fn(!0),tn){W1.error("Request already in progress");return}typeof h=="function"&&h("annotate")},l4=be=>{console.log("Submitted data from SAMModal:",be),bo(be),typeof h=="function"&&h("annotate")},bo=be=>{if(!Qo||!(Qo!=null&&Qo.mutate)){W1.error("SAM Prompt is not available");return}console.log("getSAMAnnotationsPrompt");const ge=be.awi_annotation_prompt,Me=be.model_confidence,Te=be.model_name,De=be.model_max_results;L0({modelName:Te,modelConfidence:Me,modelMaxResults:De,promptMessage:ge});const ut=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1)),Xt={requestId:a||0,contents:[{url:J2||ut,contentKey:i,directPrompt:ge||""}],confidence:Me||M1,modelName:Te||r0,modelMaxResults:De||jr};jt(!0),Qo.mutate(Xt,{onSuccess:hn=>{var Ct,Kt,x1,ce,h0;if(jt(!1),!hn.success)W1.error(hn.message);else{Fn(!1);const B0=((x1=(Kt=(Ct=hn.data)==null?void 0:Ct[0])==null?void 0:Kt.contours)==null?void 0:x1[0])??null;if(B0){const m1=B0.coordinates;if((m1==null?void 0:m1.length)==0||!((h0=(ce=m1[0])==null?void 0:ce.box)!=null&&h0.length))W1.error("No auto annotation is possible to create");else{const rn=[];(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?(console.log("coordinates",m1),m1.forEach(_0=>{var t2;(t2=_0==null?void 0:_0.mask_polygon)==null||t2.forEach(j2=>{const n2={outline:j2.outline,classId:m1.classId};rn.push(n2)})})):(Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"?m1.forEach(_0=>{const t2=On.getBoundingBox(_0.box);Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}):(Ce==null?void 0:Ce.awi_annotation_type)=="circle"?m1.forEach(_0=>{const t2=On.calculateCircleFromCoordinates(On.getBoundingBox(_0.box));Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}):(Ce==null?void 0:Ce.awi_annotation_type)=="dot"&&m1.forEach(_0=>{const t2=On.calculateCentroid(_0.box);Tt(t2);const j2={outline:t2,classId:m1.classId};rn.push(j2)}),Un(rn),typeof E=="function"&&E("Normal")}}else W1.error("No Auto Annotation found")}},onError:hn=>{W1.exception(hn),jt(!1)}})},Pi=()=>{if(!Wo||!(Wo!=null&&Wo.mutate)){W1.error("SAM is not available");return}const be=tt.generateImageUrl(tt.getImageKitUrl(e,-1,-1,-1)),ge=J2||be,Me=Br.chunkArray(nt),Te={img_url:ge,coords:nt,coordinates:Me};jt(!0),Wo.mutate(Te,{onSuccess:De=>{var ut;if(jt(!1),!De.success)W1.error(De.message);else if(console.log("this is the SAM data",De),((ut=De==null?void 0:De.data)==null?void 0:ut.length)>0){const xt=[];(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?De.data.forEach(Xt=>{Xt.contours.forEach(hn=>{Tt(hn.outline);const Kt={outline:hn.outline,classId:null};xt.push(Kt)})}):(Ce==null?void 0:Ce.awi_annotation_type)=="rectangle"?De.data.forEach(Xt=>{Tt(Xt.bbox),console.log("this si the bbox",Xt.bbox);const Ct={outline:Xt.bbox,classId:null};xt.push(Ct)}):(Ce==null?void 0:Ce.awi_annotation_type)=="circle"?De.data.forEach(Xt=>{const hn=On.calculateCircleFromCoordinates(Xt.bbox);Tt(hn);const Ct={outline:hn,classId:null};xt.push(Ct)}):(Ce==null?void 0:Ce.awi_annotation_type)=="dot"&&De.data.forEach(Xt=>{const hn=On.calculateCentroid(Xt.bbox);Tt(hn);const Ct={outline:hn,classId:null};xt.push(Ct)}),Un(xt)}else W1.error("No annotations found from SAM")},onError:De=>{W1.exception(De),jt(!1)}})},Sa=async()=>{if(fe&&typeof fe=="function"){W1.success("Loading Annotations...");const be=await fe();console.log("cacheRemoveAnnotationResponse ",be),be!=null&&be.success?(W1.success((be==null?void 0:be.message)+" and now loading final annotations..."),Xo(!0)):W1.error(be==null?void 0:be.message)}},Ma=()=>{var ge;console.log("Undo last state annotation");const be=E2(u);if(((ge=be.past_coords)==null?void 0:ge.length)>0){const Me=be.past_coords[be.past_coords.length-1];typeof o=="function"&&l0(Me)&&!p&&o(Me,u,()=>{_2()})}},Ar=be=>{console.log("Control p"),Ye.current&&mo(be)},Ni=be=>{console.log("Control m"),e2(be)},V2=()=>{const be={clientX:(Ut==null?void 0:Ut.x)||0,clientY:(Ut==null?void 0:Ut.y)||0};Ar(be)},er=()=>{const be={clientX:(Ut==null?void 0:Ut.x)||0,clientY:(Ut==null?void 0:Ut.y)||0};Ni(be)},k3=()=>{console.log("Copying annotations"),O&&typeof O=="function"&&O((vn==null?void 0:vn.result)||[])},tr=(be=!0)=>{try{document.fullscreenElement?(document.exitFullscreen().then(()=>{console.log("Fullscreen exited")}).catch(ge=>{console.log(ge)}),be&&ia.setItem("full_screen","no")):(document.documentElement.requestFullscreen().then(()=>{console.log("Fullscreen entered")}).catch(ge=>{console.log(ge)}),be&&ia.setItem("full_screen","yes"))}catch(ge){console.log(ge)}},vr=be=>{var ge;if(!(!A&&!["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level))){if((Ce==null?void 0:Ce.awi_request_for)=="attributes"){const Me=mr(be)||[];console.log("This is the temp annotation",Me),Me.length>0&&(b1(Me),typeof d=="function"&&d(Me[0]),O1()),gn&&$t(!1),Nt(!1);return}if(En)if(At(!1),Pn){if(nt&&(nt==null?void 0:nt.length)>0){let Me=[];T1?x2()?Me=go():Me=nt:Me=go(),O1(Me)}}else console.log("creating new annotation"),typeof n=="function"&&l0(nt)&&((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"?I3():(Tt([]),n(nt,null,!1,()=>{_2()})));else if(c&&Dt!=="-1"||A){if((gn||Jn.x!==-1&&Jn.y!==-1)&&R3(L1,On.getMousePos(Ye.current,be))){const Me=E2(Dt);if(Me){const Te=[...Me.awi_coords],De=l0(Te);typeof o=="function"&&De&&!p?o(Te,u,()=>{_2()}):De||((Ce==null?void 0:Ce.awi_annotation_type)=="polygon"?F2(Te,be):Xo(!0))}}else{const Me=mr(be)||[];if(Me.length>0)if(Me.every(Te=>n1.includes(Te))&&n1.every(Te=>Me.includes(Te))){if(cn(Te=>(typeof d=="function"&&d(n1[(n1.indexOf(Te)+1)%n1.length]),ht(),n1[(n1.indexOf(Te)+1)%n1.length]==="-1"&&(o1({x:0,y:0}),$n({x:-1,y:-1})),n1[(n1.indexOf(Te)+1)%n1.length])),(!gn||x2())&&(Ce==null?void 0:Ce.awi_annotation_type)=="polygon"){const Te=(ge=E2(u))==null?void 0:ge.awi_coords;J0(be,Te)}}else console.log("Selecting first temp"),cn(Me[0]),typeof d=="function"&&d(Me[0]),O1();else cn("-1"),O1();b1(Me)}gn&&$t(!1),Nt(!1)}else if(c){const Me=mr(be)||[];console.log("This is the temp annotation",Me),Me.length>0&&(b1(Me),typeof d=="function"&&d(Me[0]),O1()),Nt(!1)}}},ri=be=>{if(console.log("Handle Mouse Down"),be.button==0&&!X0()){if(!["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level))return;if(!c&&!A){At(!0),console.log("Mouse down");const{x:ge,y:Me}=On.getMousePosAbsolute(Ye.current,be);Mn({x:ge,y:Me}),Pn?T1&&x2()||Tt(Te=>[...Te||[],{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"?Tt([{x:ge,y:Me},{x:ge,y:Me},{x:ge,y:Me},{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="circle"?Tt([{x:ge,y:Me},{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="dot"?Tt([{x:ge,y:Me}]):(Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&Tt(Te=>[...Te,{x:ge,y:Me}])}else A||(O3(be,Dt),Nt(!0))}else if(be.button===1||be.button==0){const{clientX:ge,clientY:Me}=be,{x:Te,y:De}=at,ut=Xt=>{console.log("PANNING!!!!!");const hn=Xt.clientX-ge,Ct=Xt.clientY-Me,Kt=Te+hn,x1=De+Ct,ce=Math.max(Math.min(Kt,0),wt.width-wt.width*at.scale),h0=Math.max(Math.min(x1,0),wt.height-wt.height*at.scale);mn({scale:at.scale,x:ce,y:h0})},xt=()=>{window.removeEventListener("mousemove",ut),window.removeEventListener("mouseup",xt),window.addEventListener("touchmove",ut,{passive:!1}),window.addEventListener("touchend",xt)};at.scale>1&&(window.addEventListener("mousemove",ut),window.addEventListener("touchmove",ut,{passive:!1})),window.addEventListener("mouseup",xt),window.addEventListener("touchend",xt)}},Qr=be=>{if(Ye!=null&&Ye.current&&A1({x:be.clientX,y:be.clientY}),c&&(Dt!="-1"&&(pn==null?void 0:pn.length)<=I1.MAX_ANNOTATIONS_TO_HOVER&&Di(be),!gn&&!vt?(pn==null?void 0:pn.length)<=I1.MAX_ANNOTATIONS_TO_HOVER&&ni(be):jn!="-1"&&D1("-1")),p)return;let ge=[];if(En){Pn?(ge.length==0&&(ge=[Jt]),Tt(Me=>Me.length==0?[Jt]:Me),O1(nt)):(Ce==null?void 0:Ce.awi_annotation_type)==="rectangle"?(ge=On.getUpdatedCoordinates(Ye,be,Jt),Tt(ge),O1(ge)):(Ce==null?void 0:Ce.awi_annotation_type)==="circle"?(Kr(be),O1(nt)):(Ce==null||Ce.awi_annotation_type,O1(nt));return}else if(c&&Dt!=="-1"&&vt){if(console.log("isDrawingAnnotation",En),gn){const{x:Me,y:Te}=On.getMousePos(Ye.current,be),De=Me-(L1.x||0),ut=Te-(L1.y||0);if(u!=="-1"){ge=[...nt].map(hn=>({x:hn.x+De,y:hn.y+ut}));const xt=E2(u);if(xt)switch(xt.awi_coords=[...ge],Ce==null?void 0:Ce.awi_annotation_type){case"dot":{ge.length===1&&(ge[0].x=On.getPerfectPointValue(ge[0].x),ge[0].y=On.getPerfectPointValue(ge[0].y));break}case"circle":{ge.length===2&&(ge=[...On.adjustToCircle(ge)],xt.awi_coords=[...ge]);break}case"rectangle":{if(ge.length===4){const hn=Math.abs(ge[1].x-ge[0].x),Ct=Math.abs(ge[3].y-ge[1].y);for(let Kt=0;Kt<ge.length;Kt++)ge[Kt].x<0?(ge[1].x=hn,ge[2].x=hn,ge[0].x=1e-4,ge[3].x=1e-4):ge[Kt].y<0?(ge[2].y=Ct,ge[3].y=Ct,ge[0].y=1e-4,ge[1].y=1e-4):ge[Kt].x>1?(ge[0].x=1-hn,ge[3].x=1-hn,ge[1].x=1-1e-4,ge[2].x=1-1e-4):ge[Kt].y>1&&(ge[0].y=1-Ct,ge[1].y=1-Ct,ge[2].y=1-1e-4,ge[3].y=1-1e-4)}break}case"polygon":{ge.length>1&&F2(ge,be);break}default:{console.log("Unknown request type");break}}Ze()(ge)}}else if(Jn.x!==-1&&Jn.y!==-1&&u!=="-1"){console.log("Corner coordinates");const Me=E2(u);if((Ce==null?void 0:Ce.awi_annotation_type)==="circle"){const Te=On.getMousePos(Ye.current,be);if(Me){ge=Me.awi_coords;const De=(ge[0].x+ge[1].x)/2,ut=(ge[0].y+ge[1].y)/2,xt=On.getDistance(Te.x,Te.y,De,ut);De-xt<0?(ge[0]={x:0,y:ut},ge[1]={x:2*xt,y:ut}):De+xt>1?(ge[0]={x:1-2*xt,y:ut},ge[1]={x:1,y:ut}):ut-xt<0?(ge[0]={x:De,y:0},ge[1]={x:De,y:2*xt}):ut+xt>1?(ge[0]={x:De,y:1-2*xt},ge[1]={x:De,y:1}):(ge[0]={x:De-xt,y:ut},ge[1]={x:De+xt,y:ut}),ge=[...On.adjustToCircle(ge)]}}else if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&!Pn){const Te=On.getMousePos(Ye.current,be);Me!=null&&Me.awi_coords&&(ge=[...Me.awi_coords],v1>-1&&(v1===0||v1===ge.length-1?(ge[0]={x:Te.x,y:Te.y},ge[ge.length-1]={x:Te.x,y:Te.y}):ge[v1]={x:Te.x,y:Te.y},$n({x:Te.x,y:Te.y})))}else ge=On.getUpdatedCoordinates(Ye,be,Jn);if(l0(ge)){Tt([...ge]);const Te=E2(u);Te&&(Te.awi_coords=ge,O1(ge))}}}else if((Ce==null?void 0:Ce.awi_annotation_type)==="polygon"&&!c&&(nt==null?void 0:nt.length)>1){const{x:Me,y:Te}=On.getMousePos(Ye.current,be);ht(nt,{x:Me,y:Te})}},Ha=be=>{if(be.touches.length===1){const ge=be.touches[0];if(X0()){if(at.scale==1)return;S1.current||(S1.current={x:ge.clientX,y:ge.clientY})}else{const Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget,button:0};ri(Me)}}},Gr=be=>{if(be.preventDefault(),be.touches.length>=2){const[ge,Me]=[be.touches[0],be.touches[1]],Te=Me.clientX-ge.clientX,De=Me.clientY-ge.clientY,ut=Math.hypot(Te,De);if(yn!==null){const xt=ut-yn,Xt=(ge.clientX+Me.clientX)/2,hn=(ge.clientY+Me.clientY)/2;x0({deltaY:-xt,clientX:Xt,clientY:hn,currentTarget:be.currentTarget})}Hn(ut)}if(be.touches.length===1){const ge=be.touches[0];if(X0()){if(S1.current){console.log("PANNING!!!!!");const Me=ge.clientX-S1.current.x,Te=ge.clientY-S1.current.y,{x:De,y:ut}=at,xt=De+Me,Xt=ut+Te,hn=Math.max(Math.min(xt,0),wt.width-wt.width*at.scale),Ct=Math.max(Math.min(Xt,0),wt.height-wt.height*at.scale);mn({scale:at.scale,x:hn,y:Ct}),S1.current={x:ge.clientX,y:ge.clientY}}}else{S1.current&&(S1.current=null);const Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};Qr(Me)}}},nr=be=>{if(S1.current&&(S1.current=null),be.touches.length<2&&Hn(null),X0()){be.preventDefault();return}const ge=be.touches[0]||be.changedTouches[0],Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};vr(Me)},yo=be=>{const ge=be.touches[0]||be.changedTouches[0],Me={...ge,clientX:ge.clientX,clientY:ge.clientY,currentTarget:be.currentTarget};ti(Me)},Ti=(be="")=>{switch(be){case"left":po();break;case"right":Ao();break;case"top":pr();break;case"bottom":Wr();break;default:console.warn(`Unknown pan direction: ${be}`)}},La=()=>{typeof x=="function"&&x(be=>!be)},E9=()=>{if(!u||u=="-1"){W1.error("Control copy will be work only when you have a selected annotation");return}else P&&typeof P=="function"&&P(vn==null?void 0:vn.result,!1)},Fi=()=>{if(!d2.current||!$o.current)return;const be=d2.current,ge=be.getContext("2d");if(!ge)return;const Me=wt.width*at.scale,Te=wt.height*at.scale;!Me||!Te||(be.width=Me,be.height=Te,ge.clearRect(0,0,Me,Te),ge.save(),ge.setTransform(1,0,0,1,0,0),ge.clearRect(0,0,Me,Te),ge.translate(at.x,at.y),ge.scale(at.scale,at.scale),ge.drawImage($o.current,0,0,wt.width,wt.height),ge.restore())};return Z.jsxs(Z.Fragment,{children:[P2&&Z.jsx(WS,{closeSAMPromptModal:()=>Fn(!1),onSubmit:l4,directPrompt:f1,isLoading:tn,requestInfo:Ce}),A&&H&&(vn==null?void 0:vn.success)&&Z.jsx(Z.Fragment,{children:Z.jsx("div",{style:{margin:"4px",display:"flex",justifyContent:"center"},children:Z.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content"},children:Z.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:k3,children:"Copy Annotations"})})})}),A&&Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{minHeight:T1?"50vh":"unset",touchAction:"none !important",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsxs(Z.Fragment,{children:[Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((f=(Ba=(oi=k==null?void 0:k.result)==null?void 0:oi.annotatorInfo)==null?void 0:Ba.awi_personal_info)==null?void 0:f.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:T1,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i),Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})]})}),!A&&je=="atom"&&Z.jsxs("div",{style:{display:"flex",flexDirection:T1?"column":"row"},children:[Z.jsx("div",{style:{height:T1?"unset":"100%",width:T1?"100%":"5.4%",border:"1px solid #E4E0E6",backgroundColor:"white"},children:["awi_annotator","awi_verifier","awi_developer"].includes(m.userObj.awi_level)&&Z.jsx("div",{style:{width:"100%",gap:"10px",marginTop:"2px",height:"100% ",display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:T1?"row":"column"},children:Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((z=(B=(b=k==null?void 0:k.result)==null?void 0:b.annotatorInfo)==null?void 0:B.awi_personal_info)==null?void 0:z.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:T1,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i)})}),Z.jsxs("div",{style:T1?{height:"100%",width:"100%"}:{width:"94.6%"},children:[!T1&&Z.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",height:T1?"8%":"3%",border:"1px solid #E4E0E6",background:"white",justifyContent:"space-between"},children:[Z.jsxs("div",{style:{display:"flex",flexDirection:"row",height:"100%",alignItems:"center"},children:[Z.jsxs("div",{className:"color-black",style:{width:"4.8rem",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:[Z.jsx("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"50%",backgroundColor:" rgba(111, 41, 169, 0.20)",height:"100%"},children:ue+1}),Z.jsx("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"50%",backgroundColor:Fe||"rgba(111, 41, 169, 0.1)",height:"100%"},children:(((X=k==null?void 0:k.result)==null?void 0:X.awi_contents)||[]).length})]}),Z.jsxs("p",{className:"color-black",style:{marginLeft:"1rem"},title:((ie=G==null?void 0:G.awi_label)==null?void 0:ie.length)>20?G.awi_label:J.length>20?J:"",children:["Image -"," ",((ke=G==null?void 0:G.awi_label)==null?void 0:ke.length)>0?G.awi_label.length>20?G.awi_label.substring(0,20)+"...":G.awi_label:J.length>20?J.substring(0,20)+"...":J]}),Z.jsx("p",{className:"color-black",style:{marginLeft:"1rem"},children:((ye==null?void 0:ye.result)||[]).length>0&&`Annotations - ${((ye==null?void 0:ye.result)||[]).length} (Recent First) ${S.size?`Selected - ${((ye==null?void 0:ye.result)||[]).length-S.size}`:""}`})]}),Z.jsx("div",{children:Z.jsxs("div",{style:{fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center"},className:"color-black",children:[Z.jsx("div",{children:g0}),(g0==null?void 0:g0.length)>0&&Z.jsx(w7,{color:"#000"})]})})]}),Z.jsx("div",{children:W&&T1&&We&&Z.jsx("div",{style:{border:"1px solid #E4E0E6"},children:Z.jsx(We,{handleNextPage:V,handlePreviousPage:T,currentPage:$,images:(Je=k==null?void 0:k.result)==null?void 0:Je.awi_contents,handleIndexUpdate:K,currentIndex:ue,request_id:q,requestFor:(rt=k==null?void 0:k.result)==null?void 0:rt.awi_request_for,imagePagination:W,showImages:!0,fetchAnnotations:Le,pageCount:Be})})}),Z.jsx("div",{style:{height:T1||y9?"25px":"3%",border:"1px solid #E4E0E6",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px",backgroundColor:"#fff"},children:T1&&(g0==null?void 0:g0.length)>0?Z.jsx(Z.Fragment,{children:Z.jsx("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"center",alignItems:"center",fontWeight:"bold"},children:g0})}):Z.jsx(Z.Fragment,{children:at.scale>1?Z.jsx(Z.Fragment,{children:Z.jsxs("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"space-between",alignItems:"center"},children:[Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("left"),children:"Left"}),Z.jsx("progress",{value:X2.left,max:wt.width,title:X2.left==0?"You can not move left more":"Showing how much you can move left more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("right"),children:"Right"}),Z.jsx("progress",{value:X2.right,max:wt.width,title:X2.right==0?"You can not move right more":"Showing how much you can move right more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("top"),children:"Top"}),Z.jsx("progress",{value:X2.top,max:wt.height,title:X2.top==0?"You can not move top more":"Showing how much you can move top more"}),Z.jsx("button",{className:"modalButton modalButton__tertiaryChoice pan_small",onClick:()=>Ti("bottom"),children:"Bottom"}),Z.jsx("progress",{value:X2.bottom,max:wt.height,title:X2.bottom==0?"You can not move bottom more":"Showing how much you can move bottom more"})]})}):Z.jsx("div",{className:qn(Sn.zoom__container,"color-black"),style:{height:"25px",justifyContent:"center",alignItems:"center"},children:"Zoom in to see image pan progress"})})}),Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{height:W?"80%":"90%",width:"100%",touchAction:"none !important",minHeight:T1?"50vh":"unset",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})}),W&&!T1&&We&&Z.jsx("div",{children:W&&Z.jsx("div",{style:{border:"1px solid #E4E0E6"},children:Z.jsx(We,{handleNextPage:V,handlePreviousPage:T,currentPage:$,images:(Bt=k==null?void 0:k.result)==null?void 0:Bt.awi_contents,handleIndexUpdate:K,currentIndex:ue,request_id:q,requestFor:(nn=k==null?void 0:k.result)==null?void 0:nn.awi_request_for,imagePagination:W,showImages:!0,fetchAnnotations:Le,pageCount:Be})})})]})]}),!A&&je=="library"&&Z.jsxs(Z.Fragment,{children:[Ue&&Z.jsx(Tc,{isEditing:c,handleSelectTool:h,annotator_name:((f0=(Gn=(In=k==null?void 0:k.result)==null?void 0:In.annotatorInfo)==null?void 0:Gn.awi_personal_info)==null?void 0:f0.awi_full_name)||"",handleSAMToggle:E,hasAnnotation:vn,SAMToggleValue:D,currentSelectedSAMTool:N,handleCopyAnnotations:P,setOpenRequestDetails:F,openRequestDetails:j,show_guidelines_first:re,handleZoomInClick:mo,zoomProperties:at,handleReset:e0,handleZoomOutClick:e2,handleCompleteAnnotation:sn,toggleFullscreen:tr,selectAnnotationId:Dt,selectedAnnotationInfo:Nn,undoLastStateAnnotation:Ma,usingSamFunction:Pn,samAPIactive:tn,handleSendToSamFunction:vo,coordinates:nt,reLoadAndReDrawAnnotations:Sa,showGuidelinesFirst:re,handleSendToSamFunctionPrompt:u1,isMobile:!0,toggleSelectAnnotation:st,handleLeftKeyDown:po,handleRightKeyDown:Ao,handleUpKeyDown:pr,handleDownKeyDown:Wr,undoAnnotationPoint:h1,togglePagination:La,switchToEditMode:_e,switchToCreateMode:xe,goToNextImage:Ae,goToPreviousImage:he,handleGoToPendingAnnotations:le,handleCopyByCtrlC:E9,handlePasteAnnotationsByControlV:ae,showPagination:W,isControlViaToolPress:dt,setIsControlViaToolPress:qe,isAltViaToolPress:ft,setIsAltViaToolPress:Pt,isCarousel:A,allowedToCopyPreview:H,classColorMapToSend:v,request:Ce,parentReqData:et,RequestInfoModal:ne,setCrossHair:a0,isCrossHair:c1,annotationViewType:je,REACT_APP_SAM_ENABLED:lt,loggedUser:m,controlMinusHotkey:er,controlPlusHotkey:V2,Carousel:ot},i),Z.jsx("div",{className:qn(Sn.canvasContainer,{[s]:!!s}),ref:Rt,style:{height:W?"80%":"90%",width:"100%",touchAction:"none !important",minHeight:T1?"50vh":"unset",position:"relative"},children:zo?se&&(se!=null&&se.file_size)?Z.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"12px",borderRadius:"8px",backgroundColor:"#fff",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",width:"280px"},children:[Z.jsx("div",{style:{fontSize:"16px",fontWeight:"bold",color:"#333"},children:"📷 Image Details"}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Name:"})," ",se==null?void 0:se.awi_label]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#555"},children:[Z.jsx("strong",{children:"Size:"})," ",Br.byteToSize(se.file_size)]}),Z.jsxs("div",{style:{fontSize:"14px",color:"#007bff",fontWeight:"bold"},children:["🔄 Loading Image ",ue+1,"..."]})]}):Z.jsxs("div",{children:["Image number ",ue+1," is loading..."]}):Z.jsx(Fc,{canvasDimensions:wt,zoomProperties:at,isEditing:c,canvasRef:Ye,bgCanvasRef:d2,overlayCanvasRef:Et,handleMouseDown:ri,handleMouseUp:vr,handleMouseMove:Qr,handleMouseMoveOut:ki,handleOnMouseLeave:ti,handleWheel:x0,handleTouchStart:Ha,handleTouchMove:Gr,handleTouchEnd:nr,handleTouchCancel:yo})})]}),e1!=-1&&A9&&Z.jsx(zM,{callback:()=>Z0(A9,e1),cancelCallBack:()=>{jo(-1)},trigger:"REMOVE_POLYGON_POINT",fireOnMount:!0,children:Z.jsx(Z.Fragment,{})})]})},k9e="_message__container_u7nyp_1",D9e="_message__container__icon_u7nyp_15",P9e="_message__container__title_u7nyp_19",N9e="_message__container__title__success_u7nyp_24",T9e="_message__container__description_u7nyp_27",F9e="_message__container__loading_u7nyp_31",V9e="_pulse_u7nyp_1",_r={message__container:k9e,message__container__icon:D9e,message__container__title:P9e,message__container__title__success:N9e,message__container__description:T9e,message__container__loading:F9e,pulse:V9e},Vc=({iconUrl:e,title:t,description:n,messageType:r="information",isLoading:o=!1,textClass:i="",noPadding:a,iconName:s=""})=>{var c,u;return o?Z.jsxs("div",{className:qn(_r.message__container,_r.message__container__loading),children:[s&&(s==null?void 0:s.length)>0&&Z.jsx("img",{src:(c=X1[s])==null?void 0:c.IconComponent,className:_r.message__container__icon}),e&&(e==null?void 0:e.length)>0&&Z.jsx("img",{src:e,className:_r.message__container__icon}),Z.jsx("h1",{className:qn(_r.message__container__title,{[_r.message__container__title__success]:r==="success"}),children:t}),Z.jsx("p",{className:qn(_r.message__container__description,i),children:n})]}):Z.jsxs("div",{className:qn(_r.message__container,{noPadding:a}),children:[s&&(s==null?void 0:s.length)>0&&Z.jsx("img",{src:(u=X1[s])==null?void 0:u.IconComponent,className:_r.message__container__icon}),e&&(e==null?void 0:e.length)>0&&Z.jsx("img",{src:e,className:_r.message__container__icon}),Z.jsx("h1",{className:qn(_r.message__container__title,{[_r.message__container__title__success]:r==="success"}),children:t}),Z.jsx("p",{className:qn(_r.message__container__description,i),children:n})]})},qb={ATTRIBUTES:{labelValue:"Attributes",src:"noAttributes",description:"No attributes are available. Start by adding or configuring attributes.",messageType:"information",loadingMessage:"Loading attributes...",notFoundMessage:"No attributes found"},ORGANISATIONS:{labelValue:"Organisations",src:"noOrganisations",description:"There are no organisations available. Add a new organisation to get started.",messageType:"information",loadingMessage:"Loading organizations...",notFoundMessage:"No organisations found"},REQUESTS:{labelValue:"Requests",src:"noRequests",description:"There are no requests available. Raised requests will be displayed here.",messageType:"information",loadingMessage:"Loading requests...",notFoundMessage:"No requests found"},USERS:{labelValue:"Users",src:"noUsers",description:"No users have been added yet. Start by inviting or creating users.",messageType:"information",loadingMessage:"Loading users...",notFoundMessage:"No users found"},USERS_IN_REQUEST:{labelValue:"Users",src:"noUsers",description:"No users found.",messageType:"information",loadingMessage:"Loading users...",notFoundMessage:"No users found"},CLASSES:{labelValue:"Classes",src:"noClasses",description:"There are no classes available. Add a new class to begin.",messageType:"information",loadingMessage:"Loading classes...",notFoundMessage:"No classes found"},IMAGES:{labelValue:"Images",src:"noImages",description:"No images are currently available. Upload images to view them here.",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No images found"},ANNOTATOR_NO_SESSIONS:{labelValue:"Sessions",src:"noSessions",description:"No sessions are currently available. Annotator Sessions will be listed here.",messageType:"information",loadingMessage:"Loading sessions...",notFoundMessage:"No sessions found"},VERIFIER_NO_SESSIONS:{labelValue:"Sessions",src:"noSessions",description:"No sessions are currently available. Verifier Sessions will be listed here.",messageType:"information",loadingMessage:"Loading sessions...",notFoundMessage:"No sessions found"},MODELS:{labelValue:"Models",src:"noModels",description:"There are no models available. Run jobs and train models to get started.",messageType:"information",loadingMessage:"Loading models...",notFoundMessage:"No models found"},JOBS:{labelValue:"Jobs",src:"noJobs",description:"No jobs are currently scheduled or running. Create a job to see it listed here.",messageType:"information",loadingMessage:"Loading jobs...",notFoundMessage:"No jobs found"},MODEL_LOGS:{labelValue:"Model Logs",src:"noJobLogs",description:"There are no logs available for the models. Generate or upload logs to view them.",messageType:"information",loadingMessage:"Loading model logs...",notFoundMessage:"No model logs found"},DATASETS:{labelValue:"Datasets",src:"noDatasets",description:"No datasets are available. Upload or create datasets to start working.",messageType:"information",loadingMessage:"Loading datasets...",notFoundMessage:"No datasets found"},BILLS:{labelValue:"Bills",src:"noBills",description:"No bills are currently available. Generated bills will be listed here.",messageType:"information",loadingMessage:"Loading bills...",notFoundMessage:"No bills found"},MODEL_METRICS:{labelValue:"Model Metrics",src:"noModelMetrics",description:"No metrics are available for the models. Generated metrics for analyzing performance will be listed here.",messageType:"information",loadingMessage:"Loading model metrics...",notFoundMessage:"No model metrics found"},MODEL_DETAILS:{labelValue:"Model Details",src:"noModelDetails",description:"Details for the models are not available. Add or update model details to view them.",messageType:"information",loadingMessage:"Loading model details...",notFoundMessage:"No model details found"},MODEL_RESOURCES:{labelValue:"Model Resources",src:"noModelResources",description:"No resources are available for the models. Add resources to start utilizing them.",messageType:"information",loadingMessage:"Loading model resources...",notFoundMessage:"No model resources found"},NOTIFICATIONS:{labelValue:"Notifications",src:"noNotifications",description:"No notifications are available. New notifications will be displayed here.",messageType:"information",loadingMessage:"Loading notifications...",notFoundMessage:"No notifications found"},REQUEST_IMAGES:{labelValue:"Request Images",src:"noRequestImages",description:"No request images are currently available.",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No request images found"},REQUEST_PRICING:{labelValue:"Request Pricing",src:"noPrices",description:"No request pricing are currently available.",messageType:"information",loadingMessage:"Loading pricing...",notFoundMessage:"No request pricing found"},ANNOTATION_GRAPH:{labelValue:"Annotation Graph",src:"noAnnotationGraph",description:"No annotation analytics are available for the given date",messageType:"information",loadingMessage:"Loading annotation graph...",notFoundMessage:"No annotations"},LOADING_CAROUSAL:{labelValue:"Images",src:"noImages",description:"No images is available to load",messageType:"information",loadingMessage:"Loading images...",notFoundMessage:"No images found"},TAGS:{labelValue:"Tags",src:"noTags",description:"No tags are available. Start by adding or configuring tags.",messageType:"information",loadingMessage:"Loading tags...",notFoundMessage:"No tags found"},NO_CSV_REQUESTS:{labelValue:"Requests",src:"noRequests",description:"There are no requests available in sheet, kindly add and upload.",messageType:"information",loadingMessage:"Loading requests...",notFoundMessage:"No requests found"},NO_CSV_CLASS:{labelValue:"Classes",src:"noClasses",description:"There are no classes available in sheet, kindly add and upload.",messageType:"information",loadingMessage:"Loading classes...",notFoundMessage:"No classes found"},CLASS_PROPORTION:{labelValue:"Class proportion",src:"noClasses",description:"No class proportion available.",messageType:"information",loadingMessage:"Loading class proportion...",notFoundMessage:"No class proportion found"},SINGLE_CLASS:{labelValue:"Class",src:"noClasses",description:"No class available.",messageType:"information",loadingMessage:"Loading class...",notFoundMessage:"No classes found"},LOADING_FILTER:{labelValue:"Filter",src:"noClasses",description:"No filter configuration.",messageType:"information",loadingMessage:"Loading filter information...",notFoundMessage:"No filter configuration found"},LOADING_ANNOTATION:{labelValue:"Annotation Loading",src:"noImages",description:"No annotation found",messageType:"information",loadingMessage:"Please wait, loading annotation...",notFoundMessage:"No annotations"},LOADING_REQUEST:{labelValue:"Request Loading",src:"noRequests",description:"No request found",messageType:"information",loadingMessage:"Please wait, loading request info...",notFoundMessage:"No request"},NOT_FOUND_GENERAL:{labelValue:"Data Loading",src:"notFoundGeneral",description:"No data found",messageType:"information",loadingMessage:"Please wait, loading data...",notFoundMessage:"No data"}},j9e=({stateKey:e="NOT_FOUND_GENERAL",loadState:t=!1,stateDescription:n=null,stateLoadDescription:r=null,showImage:o=!1,textClass:i="",noPadding:a=!1,stateTitle:s=""})=>{const c=qb[e]||qb.NOT_FOUND_GENERAL;if(!c)return Z.jsx(Z.Fragment,{});const{labelValue:u,src:d,messageType:h,description:C,notFoundMessage:m}=c;if(t)return Z.jsxs("div",{style:{width:"100%"},children:[o&&Z.jsx(Vc,{title:c.loadingMessage,iconName:d,description:r||"",isLoading:!0,noPadding:a}),!o&&Z.jsx(Vc,{title:c.loadingMessage,description:r||"",isLoading:!0,noPadding:a})]});{const A=(s==null?void 0:s.length)>0?s:m?m||`No ${u} Found`:"",v=n||C;return Z.jsx("div",{style:{width:"100%"},children:Z.jsx(Vc,{title:A,iconName:d,description:v,messageType:h,textClass:i,noPadding:a})})}},z9e="_tableBar_103oy_1",Z9e="_buttonGroup_103oy_13",U9e="_btnIcon_103oy_34",$9e="_searchBar_103oy_41",K9e="_searchInput_103oy_53",W9e="_searchIcon_103oy_58",Q9e="_removeBorder_103oy_63",G9e="_button_103oy_13",Y9e="_isSelected_103oy_74",q9e="_isDisabled_103oy_80",X9e="_isActive_103oy_85",J9e="_isText_103oy_92",sr={tableBar:z9e,buttonGroup:Z9e,btnIcon:U9e,searchBar:$9e,searchInput:K9e,searchIcon:W9e,removeBorder:Q9e,button:G9e,isSelected:Y9e,isDisabled:q9e,isActive:X9e,isText:J9e},e3e=({showSearch:e=!1,leftButtons:t=[],rightButtons:n=[],searchFunction:r,searchDelay:o=300,onSearchClick:i,searchPlaceHolder:a="Search...",showSearchEye:s=!0,borderRequired:c=!0,borderColor:u})=>{const d=R.useCallback(cl.debounce((A,v)=>{typeof v=="function"&&v(A)},o),[o]),h=A=>{const v=A.currentTarget.value.trim();d(v,r)},C=()=>{typeof i=="function"&&i()};if(!t.length&&!n.length&&!e)return null;const m=(A,v)=>{const p=A.type==="text";return Z.jsxs("button",{onClick:!p&&!A.isDisabled?A.onClick:void 0,title:A.title||"",disabled:A.isDisabled,className:qn(sr.button,{[sr.isText]:p,[sr.isSelected]:A.isSelected,[sr.isDisabled]:A.isDisabled,[sr.isActive]:A.isActive&&!A.isSelected}),children:[A.icon&&Z.jsx("img",{src:A.icon,alt:A.name,className:sr.btnIcon}),Z.jsx("div",{children:A.name})]},v)};return Z.jsxs("div",{className:qn(sr.tableBar,!c&&sr.removeBorder),style:{borderColor:c?u||"#909090":void 0},children:[Z.jsxs("div",{className:sr.buttonGroup,children:[t.map(m)," "]}),Z.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:"10px"},children:[Z.jsx("div",{className:sr.buttonGroup,children:n.map(m)}),e&&Z.jsx("div",{className:sr.searchBar,title:a,children:Z.jsxs("form",{autoComplete:"off",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",position:"relative"},children:[Z.jsx("input",{type:"text",name:"userSearchInput",autoComplete:"off",placeholder:a,className:sr.searchInput,onKeyUp:h}),s&&Z.jsx("img",{src:X1.searchUrl.IconComponent,alt:a,className:qn(sr.btnIcon,"cursor-pointer",sr.searchIcon),onClick:C})]})})]})]})},dH=({currentPage:e,totalPages:t,onPageChange:n,isLoading:r=!1})=>{const[o,i]=R.useState(`${e}`);R.useEffect(()=>{i(`${e}`)},[e]);const a=()=>{const s=Number(o);s>=1&&s<=t&&n(s),i("")};return Z.jsx(Z.Fragment,{children:Z.jsxs("div",{className:p2.pagination_container,children:[Z.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",maxHeight:"2vh"},children:r?Z.jsx(Z.Fragment,{children:Z.jsx("div",{className:p2.pagination_loading,children:"Loading..."})}):Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:p2.pagination_left,children:Z.jsx("input",{type:"number",min:"1",max:t,value:o,onChange:s=>{i(s.target.value)},onBlur:()=>{if(o==""){i(`${e}`);return}const s=parseInt(o,10);if(!isNaN(s)){let c=Math.max(1,Math.min(t,s)).toString();c!=null&&c.length||(c="1"),i(c),a()}},onKeyDown:s=>{if(s.key==="Enter"){s==null||s.preventDefault(),s==null||s.stopPropagation();const c=parseInt(o,10);if(!isNaN(c)){const u=Math.max(1,Math.min(t,c)).toString();i(u),a()}}},placeholder:o,style:{background:"transparent",border:"0",width:"100%",height:"100%"}})}),Z.jsx("div",{className:p2.pagination_right,children:t})]})}),Z.jsxs("div",{style:{gap:"20px",display:"flex"},children:[Z.jsx("img",{src:X1.backArrow.IconComponent,onClick:()=>e>1&&n(e-1),style:{cursor:e>1?"pointer":"not-allowed"},className:p2.nextPrevArrow,title:e>1?`Go to page number ${e-1} `:"Go to previous page is not allowed"}),Z.jsx("img",{src:X1.forwardArrow.IconComponent,onClick:()=>e<t&&n(e+1),style:{cursor:e<t?"pointer":"not-allowed"},className:p2.nextPrevArrow,title:e<t?`Go to page number ${e+1}`:"Go to next page is not allowed"})]})]})})},t3e=({hasNextPage:e,isFetchingNextPage:t=!1,fetchNextPage:n,isLoading:r=!1,totalResults:o=0,totalFetchedResults:i=0,currentPage:a=1,totalPages:s=10,onPageChange:c,isPagination:u=!1,loadText:d=""})=>{let h="Load More";return i+1===o?h="Load last results":r||t?u?a==1?h="Loading...":h=`Loading page number ${a}`:o===0?h="Loading...":i+1===o?h="Loading last results...":h=`Loading ${i+1} to ${o}`:i===0?(d==null?void 0:d.length)==0?h="Load":h=d:h=`Load ${i+1} to ${o}`,u&&c?Z.jsx(dH,{currentPage:a,totalPages:s,onPageChange:c,isLoading:r||t}):Z.jsx("div",{className:p2.loadMoreButtonDiv,style:{display:"flex",justifyContent:"center",marginTop:"16px"},children:e&&!t&&Z.jsx("div",{className:p2.loadMoreButtonContainer,children:Z.jsx("button",{onClick:()=>n?n():void 0,className:"modalButton modalButton__purpleColor",disabled:r||t,children:h})})})},n3e=({items:e,listType:t="ul",maxHeight:n="100px"})=>{const r=t;return!e||e.length===0?Z.jsx("div",{style:{minWidth:"30px"},children:"N/A"}):Z.jsx(r,{style:{maxHeight:n,overflow:"auto",paddingLeft:"20px"},children:e.map((o,i)=>Z.jsx("li",{style:{minWidth:"10vw"},children:o},i))})};var fH=(e=>(e.LARGE="l",e.MEDIUM="m",e))(fH||{});const r3e=({badgeContent:e,variant:t=fH.LARGE,backgroundColor:n,textColor:r,className:o,style:i,...a})=>Z.jsx("span",{className:`badge badge_${t} ${o} ${e?"":"badge_dot"}`,style:{"--c_background":n,"--c_text":r,...i},...a,children:e}),o3e=({items:e,value:t,onChange:n=()=>{},color:r,width:o,size:i="s",gap:a})=>Z.jsx("div",{className:"button_group",style:{gap:a},children:e==null?void 0:e.map((s,c)=>Z.jsx(i2,{variant:"primary",content:s==null?void 0:s.label,icon:s==null?void 0:s.icon,iconPosition:(s==null?void 0:s.iconPosition)??"before",textColor:s==null?void 0:s.contentColor,iconColor:s==null?void 0:s.contentColor,onClick:()=>n(s.value),width:o,className:`button_group_button ${c==0?"first":""} ${c==e.length-1?"last":""} ${s.value==t?"active":""}`,backgroundColor:r,borderColor:r,disabled:s.disabled,size:i},s.value))});/*!
|
|
340
340
|
* @kurkle/color v0.3.4
|
|
341
341
|
* https://github.com/kurkle/color#readme
|
|
342
342
|
* (c) 2024 Jukka Kurkela
|