diff --git a/build/asset-manifest.json b/build/asset-manifest.json index f33be86..1f3f7b9 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/static/css/main.b85b0dd8.css", - "main.js": "/static/js/main.ef31e0ac.js", + "main.js": "/static/js/main.f1cf61c1.js", "static/js/3723.f0610be4.chunk.js": "/static/js/3723.f0610be4.chunk.js", "static/js/2898.3b8c86cc.chunk.js": "/static/js/2898.3b8c86cc.chunk.js", "static/js/6390.ca813cc4.chunk.js": "/static/js/6390.ca813cc4.chunk.js", @@ -10,32 +10,32 @@ "static/js/5770.335ad879.chunk.js": "/static/js/5770.335ad879.chunk.js", "static/js/2142.8437472d.chunk.js": "/static/js/2142.8437472d.chunk.js", "static/js/4612.9e7024f7.chunk.js": "/static/js/4612.9e7024f7.chunk.js", - "static/js/1504.1fb0366f.chunk.js": "/static/js/1504.1fb0366f.chunk.js", - "static/js/7157.a80416ea.chunk.js": "/static/js/7157.a80416ea.chunk.js", - "static/js/4947.3f1a9374.chunk.js": "/static/js/4947.3f1a9374.chunk.js", - "static/js/7221.f8fb20dc.chunk.js": "/static/js/7221.f8fb20dc.chunk.js", - "static/js/2851.2e35a236.chunk.js": "/static/js/2851.2e35a236.chunk.js", - "static/js/9521.e16f3399.chunk.js": "/static/js/9521.e16f3399.chunk.js", - "static/js/6165.f270c746.chunk.js": "/static/js/6165.f270c746.chunk.js", - "static/js/9912.3ab07d56.chunk.js": "/static/js/9912.3ab07d56.chunk.js", - "static/js/6248.bf8f395b.chunk.js": "/static/js/6248.bf8f395b.chunk.js", - "static/js/1148.f9207a95.chunk.js": "/static/js/1148.f9207a95.chunk.js", + "static/js/1504.61c5a37b.chunk.js": "/static/js/1504.61c5a37b.chunk.js", + "static/js/7157.5fea29d8.chunk.js": "/static/js/7157.5fea29d8.chunk.js", + "static/js/4947.c561ede9.chunk.js": "/static/js/4947.c561ede9.chunk.js", + "static/js/7221.434a49d6.chunk.js": "/static/js/7221.434a49d6.chunk.js", + "static/js/2851.b582cabe.chunk.js": "/static/js/2851.b582cabe.chunk.js", + "static/js/9521.15393fd8.chunk.js": "/static/js/9521.15393fd8.chunk.js", + "static/js/6165.733094c1.chunk.js": "/static/js/6165.733094c1.chunk.js", + "static/js/9912.a8585d14.chunk.js": "/static/js/9912.a8585d14.chunk.js", + "static/js/6248.d7ba49cb.chunk.js": "/static/js/6248.d7ba49cb.chunk.js", + "static/js/1148.ffa93df1.chunk.js": "/static/js/1148.ffa93df1.chunk.js", "static/css/9592.d6bfd15f.chunk.css": "/static/css/9592.d6bfd15f.chunk.css", - "static/js/9592.f7bf6a2f.chunk.js": "/static/js/9592.f7bf6a2f.chunk.js", - "static/js/54.aae1b62e.chunk.js": "/static/js/54.aae1b62e.chunk.js", - "static/js/2638.f4999b6b.chunk.js": "/static/js/2638.f4999b6b.chunk.js", - "static/js/4793.ba46570e.chunk.js": "/static/js/4793.ba46570e.chunk.js", - "static/js/7875.ed9def13.chunk.js": "/static/js/7875.ed9def13.chunk.js", - "static/js/6849.d98042c1.chunk.js": "/static/js/6849.d98042c1.chunk.js", + "static/js/9592.bfbbd05d.chunk.js": "/static/js/9592.bfbbd05d.chunk.js", + "static/js/54.5a2100fd.chunk.js": "/static/js/54.5a2100fd.chunk.js", + "static/js/2638.bc119b66.chunk.js": "/static/js/2638.bc119b66.chunk.js", + "static/js/4793.84e511ac.chunk.js": "/static/js/4793.84e511ac.chunk.js", + "static/js/7875.9e6056f7.chunk.js": "/static/js/7875.9e6056f7.chunk.js", + "static/js/6849.9b9d612c.chunk.js": "/static/js/6849.9b9d612c.chunk.js", "static/css/8846.d6bfd15f.chunk.css": "/static/css/8846.d6bfd15f.chunk.css", - "static/js/8846.0ebfcc74.chunk.js": "/static/js/8846.0ebfcc74.chunk.js", - "static/js/181.d48a53c2.chunk.js": "/static/js/181.d48a53c2.chunk.js", - "static/js/4263.b73de124.chunk.js": "/static/js/4263.b73de124.chunk.js", - "static/js/2533.c3f1e61a.chunk.js": "/static/js/2533.c3f1e61a.chunk.js", - "static/js/238.2d84f4f9.chunk.js": "/static/js/238.2d84f4f9.chunk.js", - "static/js/8954.4c6f4fd3.chunk.js": "/static/js/8954.4c6f4fd3.chunk.js", + "static/js/8846.23c0ba58.chunk.js": "/static/js/8846.23c0ba58.chunk.js", + "static/js/181.d5552073.chunk.js": "/static/js/181.d5552073.chunk.js", + "static/js/4263.640b9077.chunk.js": "/static/js/4263.640b9077.chunk.js", + "static/js/2533.ef2d33a7.chunk.js": "/static/js/2533.ef2d33a7.chunk.js", + "static/js/238.33695a38.chunk.js": "/static/js/238.33695a38.chunk.js", + "static/js/8954.4813af23.chunk.js": "/static/js/8954.4813af23.chunk.js", "static/js/2548.501e5a58.chunk.js": "/static/js/2548.501e5a58.chunk.js", - "static/js/4917.4066be6b.chunk.js": "/static/js/4917.4066be6b.chunk.js", + "static/js/4917.59b39eb6.chunk.js": "/static/js/4917.59b39eb6.chunk.js", "static/js/5260.2165290c.chunk.js": "/static/js/5260.2165290c.chunk.js", "static/js/1685.d71eee3a.chunk.js": "/static/js/1685.d71eee3a.chunk.js", "static/js/2660.8ec125e1.chunk.js": "/static/js/2660.8ec125e1.chunk.js", @@ -79,8 +79,8 @@ "static/js/7099.f09d5814.chunk.js": "/static/js/7099.f09d5814.chunk.js", "static/js/7537.36826a6b.chunk.js": "/static/js/7537.36826a6b.chunk.js", "static/js/1425.51f16953.chunk.js": "/static/js/1425.51f16953.chunk.js", - "static/css/6666.e6ebe766.chunk.css": "/static/css/6666.e6ebe766.chunk.css", - "static/js/6666.5d38556f.chunk.js": "/static/js/6666.5d38556f.chunk.js", + "static/css/6666.a79ab83b.chunk.css": "/static/css/6666.a79ab83b.chunk.css", + "static/js/6666.7adf9309.chunk.js": "/static/js/6666.7adf9309.chunk.js", "static/js/23.16c886f8.chunk.js": "/static/js/23.16c886f8.chunk.js", "static/css/6509.04ba3c11.chunk.css": "/static/css/6509.04ba3c11.chunk.css", "static/media/aiImage.png": "/static/media/aiImage.89c2ccb91a41d85031e3.png", @@ -98,6 +98,6 @@ }, "entrypoints": [ "static/css/main.b85b0dd8.css", - "static/js/main.ef31e0ac.js" + "static/js/main.f1cf61c1.js" ] } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 1daa762..64cce64 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Nearle Console
\ No newline at end of file +Nearle Console
\ No newline at end of file diff --git a/build/static/css/6666.e6ebe766.chunk.css b/build/static/css/6666.a79ab83b.chunk.css similarity index 87% rename from build/static/css/6666.e6ebe766.chunk.css rename to build/static/css/6666.a79ab83b.chunk.css index d7cb85b..c4e0fa1 100644 --- a/build/static/css/6666.e6ebe766.chunk.css +++ b/build/static/css/6666.a79ab83b.chunk.css @@ -1 +1 @@ -.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;user-select:none}.leaflet-tile::selection{background:#0000}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-height:none!important;max-width:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important;padding:0;width:auto}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:focus,.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;line-height:1.4;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:focus,.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;height:.6669em;vertical-align:initial!important;width:1em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fffc;border:2px solid #777;border-top:none;box-sizing:border-box;line-height:1.1;padding:2px 5px 1px;text-shadow:1px 1px #fff;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{font-size:13px;font-size:1.08333em;line-height:1.3;margin:13px 24px 13px 20px;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;margin-top:-1px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;pointer-events:auto;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px #0006;color:#333}.leaflet-container a.leaflet-popup-close-button{background:#0000;border:none;color:#757575;font:16px/24px Tahoma,Verdana,sans-serif;height:24px;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:24px}.leaflet-container a.leaflet-popup-close-button:focus,.leaflet-container a.leaflet-popup-close-button:hover{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px #0006;color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:#0000;border:6px solid #0000;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--bg:#fff;--bg-sub:#f8fafc;--bg-card:#fff;--border:#e2e8f0;--border-active:#3b82f6;--text:#1e293b;--text-muted:#64748b;--accent:#3b82f6;--accent-soft:#3b82f614;--kitchen:#f59e0b;--kitchen-soft:#f59e0b1a;--success:#22c55e;--shadow:0 4px 12px #0000000d;--shadow-lg:0 10px 25px -5px #00000014}.dispatch-container{background:#fff;background:var(--bg);color:#1e293b;color:var(--text);display:flex;flex-direction:column;font-family:Inter,-apple-system,sans-serif;height:calc(100vh - 88px);margin:-24px;overflow:hidden;position:relative;width:calc(100% + 48px)}.dispatch-container.embedded{flex:1 1;height:100%;margin:0;min-height:0;width:100%}.dispatch-container *{box-sizing:border-box;margin:0;padding:0}.dispatch-container #hdr{align-items:center;background:#fff;background:var(--bg);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;height:56px;justify-content:space-between;padding:0 24px;z-index:1010}.dispatch-container .logo{align-items:center;display:flex;gap:12px}.dispatch-container .logo-badge{align-items:center;background:linear-gradient(135deg,#3b82f6,#2563eb);border-radius:8px;color:#fff;display:flex;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .logo-name{color:#1e293b;color:var(--text);font-size:18px;font-weight:800;letter-spacing:-.02em}.dispatch-container .logo-name em{color:#3b82f6;color:var(--accent);font-style:normal;opacity:.8}.dispatch-container .logo-city-wrap{display:inline-block;position:relative}.dispatch-container .logo-city{align-items:center;background:#7b1fa214;border:1px solid #7b1fa240;border-radius:999px;color:#7b1fa2;cursor:pointer;display:inline-flex;font-family:inherit;font-size:11px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:4px 8px 4px 10px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.dispatch-container .logo-city:hover{background:#7b1fa224;border-color:#7b1fa273}.dispatch-container .logo-city.open{background:#7b1fa22e;border-color:#7b1fa28c;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .logo-city svg{flex-shrink:0;font-size:13px}.dispatch-container .logo-city-caret{font-size:15px;transition:transform .2s ease}.dispatch-container .logo-city.open .logo-city-caret{transform:rotate(180deg)}.dispatch-container .logo-city-text{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .logo-city-menu{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:12px;box-shadow:0 16px 36px #0f172a29;left:0;max-height:320px;min-width:200px;overflow-y:auto;padding:6px;position:absolute;top:calc(100% + 6px);z-index:1000}@keyframes logo-city-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .logo-city-menu::-webkit-scrollbar{width:6px}.dispatch-container .logo-city-menu::-webkit-scrollbar-thumb{background:#7b1fa24d;border-radius:999px}.dispatch-container .logo-city-option{align-items:center;background:#0000;border:0;border-radius:8px;color:#1e293b;cursor:pointer;display:flex;font-family:inherit;font-size:12px;font-weight:600;gap:8px;padding:8px 10px;text-align:left;transition:background .12s ease;width:100%}.dispatch-container .logo-city-option:hover{background:#7b1fa20f}.dispatch-container .logo-city-option.active{background:#7b1fa21a;color:#7b1fa2}.dispatch-container .logo-city-option-icon{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .logo-city-option span:not(.logo-city-option-check){flex:1 1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .logo-city-option-check{color:#7b1fa2;flex-shrink:0;font-weight:800}.dispatch-container .hdr-sep{background:#e2e8f0;background:var(--border);height:20px;margin:0 4px;width:1px}.dispatch-container .hdr-meta{color:#64748b;color:var(--text-muted);font-size:12px;font-weight:500}.dispatch-container #clock{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;color:#1e293b;color:var(--text);font-family:JetBrains Mono,monospace;font-size:13px;font-weight:600;padding:7px 16px}.dispatch-container .hdr-stats{align-items:center;display:flex;flex-wrap:nowrap;gap:16px;margin-left:auto;margin-right:16px;min-width:0}.dispatch-container #strat-row{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;height:54px;padding:0 24px}.dispatch-container #strat-row,.dispatch-container .sbt{align-items:center;background:#fff;background:var(--bg);gap:8px}.dispatch-container .sbt{border:1px solid #0f172a14;border-radius:10px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:600;line-height:1;padding:8px 14px;transition:all .2s cubic-bezier(.4,0,.2,1)}.dispatch-container .sbt:hover{background:#f8fafc;background:var(--bg-sub);border-color:#64748b;border-color:var(--text-muted);color:#1e293b;color:var(--text)}.dispatch-container .sbt.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 4px 12px #3b82f640;color:#fff}.dispatch-container .sbt .sbt-icon{align-items:center;color:inherit;display:inline-flex;flex-shrink:0;font-size:18px;height:18px;justify-content:center;line-height:1;width:18px}.dispatch-container .sbt .sbt-icon svg{display:block;height:1em;vertical-align:middle;width:1em}.dispatch-container .strat-stats{align-items:center;border-left:1px solid #e2e8f0;border-left:1px solid var(--border);display:inline-flex;gap:8px;height:32px;margin-left:8px;padding-left:12px}.dispatch-container .strat-stats.strat-stats-right{border-left:none;margin-left:auto;padding-left:0}.dispatch-container .strat-stat{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:12px;font-weight:700;gap:8px;line-height:1;padding:7px 15px;transition:all .15s ease;white-space:nowrap}.dispatch-container .strat-stat-icon{font-size:13px;line-height:1}.dispatch-container .strat-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .strat-stat-value{font-size:13px;font-weight:800}.dispatch-container .strat-stat-orders{background:#3b82f614;background:var(--accent-soft);border-color:#3b82f640}.dispatch-container .strat-stat-orders .strat-stat-value{color:#3b82f6;color:var(--accent)}.dispatch-container .strat-stat-profit{background:#22c55e1a;border-color:#22c55e4d}.dispatch-container .strat-stat-profit .strat-stat-label,.dispatch-container .strat-stat-profit .strat-stat-value{color:#22c55e;color:var(--success)}.dispatch-container .strat-stat-loss{background:#ef44441a;border-color:#ef444459}.dispatch-container .strat-stat-loss .strat-stat-label,.dispatch-container .strat-stat-loss .strat-stat-value{color:#dc2626}.dispatch-container .live-controls{align-items:center;display:flex;gap:12px;margin-left:auto}.dispatch-container .live-status{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);display:inline-flex;font-size:12px;font-weight:600;gap:8px;padding:7px 15px}.dispatch-container .live-status-ready{color:#22c55e;color:var(--success)}.dispatch-container .live-status-error{color:#ef4444}.dispatch-container .live-status-sub{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:500;opacity:.85}.dispatch-container .live-dot{animation:live-pulse 1.2s ease-in-out infinite;background:#3b82f6;background:var(--accent);border-radius:50%;height:8px;width:8px}.dispatch-container .live-dot.ready{animation:none;background:#22c55e;background:var(--success)}.dispatch-container .live-dot.error{animation:none;background:#ef4444}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.dispatch-container .date-chip{align-items:stretch;background:#fff;border:1px solid #0f172a14;border-radius:12px;box-shadow:0 1px 2px #0f172a0a,0 4px 12px #0f172a0f;display:inline-flex;gap:0;position:relative;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.dispatch-container .date-chip.is-open{border-color:#6366f1;box-shadow:0 0 0 3px #6366f133,0 12px 30px #6366f138}.dispatch-container .date-chip:hover{border-color:#6366f173;box-shadow:0 2px 4px #0f172a0f,0 8px 22px #6366f126;transform:translateY(-1px)}.dispatch-container .date-chip:focus-within{border-color:#6366f1;box-shadow:0 0 0 3px #6366f133,0 8px 22px #6366f138}.dispatch-container .date-chip-main{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:10px;min-width:0;padding:8px 18px;position:relative;text-align:left}.dispatch-container .date-chip-main:focus{outline:none}.dispatch-container .date-chip-main:hover{background:#6366f10a}.dispatch-container .date-chip-icon{align-items:center;background:linear-gradient(135deg,#eef2ff,#e0e7ff);border-radius:8px;color:#4338ca;display:inline-flex;flex-shrink:0;font-size:15px;height:28px;justify-content:center;width:28px}.dispatch-container .date-chip-text{align-items:flex-start;display:flex;flex-direction:column;gap:2px;line-height:1.1;min-width:0}.dispatch-container .date-chip-label{color:#94a3b8;font-size:10px;gap:6px;letter-spacing:.08em}.dispatch-container .date-chip-label,.dispatch-container .date-chip-today-pill{align-items:center;display:inline-flex;font-weight:800;text-transform:uppercase}.dispatch-container .date-chip-today-pill{background:linear-gradient(135deg,#6366f1,#3b82f6);border-radius:999px;box-shadow:0 2px 6px #6366f159;color:#fff;font-size:9px;letter-spacing:.06em;padding:1px 6px}.dispatch-container .date-chip-value{color:#0f172a;font-size:13px;font-weight:700;letter-spacing:.01em;white-space:nowrap}.dispatch-container .date-chip-chevron{align-items:center;color:#94a3b8;display:inline-flex;font-size:18px;justify-content:center;margin-left:2px;transition:color .18s ease,transform .18s ease}.dispatch-container .date-chip-main:hover .date-chip-chevron{color:#4338ca}.dispatch-container .date-chip-chevron.is-open{color:#4338ca;transform:rotate(180deg)}.dispatch-container .date-cal-popover{animation:date-cal-in .18s cubic-bezier(.4,0,.2,1);background:#fff;border:1px solid #0f172a14;border-radius:16px;box-shadow:0 18px 44px #0f172a2e,0 4px 12px #0f172a0f;padding:14px 14px 10px;position:absolute;right:0;top:calc(100% + 10px);width:304px;z-index:1000}.dispatch-container .date-cal-popover:after,.dispatch-container .date-cal-popover:before{border-left:8px solid #0000;border-right:8px solid #0000;bottom:100%;content:"";height:0;position:absolute;right:28px;width:0}.dispatch-container .date-cal-popover:before{border-bottom:8px solid #0f172a14}.dispatch-container .date-cal-popover:after{border-bottom:8px solid #fff;margin-bottom:-1px}@keyframes date-cal-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .date-cal-header{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:10px}.dispatch-container .date-cal-title{color:#0f172a;flex:1 1;font-size:14px;font-weight:800;letter-spacing:.01em;text-align:center}.dispatch-container .date-cal-nav{align-items:center;-webkit-appearance:none;appearance:none;background:#f8fafce6;border:0;border-radius:8px;color:#475569;cursor:pointer;display:inline-flex;font-size:18px;height:30px;justify-content:center;transition:background .15s ease,color .15s ease;width:30px}.dispatch-container .date-cal-nav:hover:not(:disabled){background:#6366f11a;color:#4338ca}.dispatch-container .date-cal-nav:disabled{cursor:not-allowed;opacity:.35}.dispatch-container .date-cal-grid,.dispatch-container .date-cal-weekdays{grid-gap:2px;display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.dispatch-container .date-cal-weekdays{margin-bottom:4px}.dispatch-container .date-cal-weekday{color:#94a3b8;font-size:10px;font-weight:800;letter-spacing:.06em;padding:4px 0;text-align:center;text-transform:uppercase}.dispatch-container .date-cal-day{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:9px;color:#0f172a;cursor:pointer;display:inline-flex;font-size:13px;font-weight:600;height:36px;justify-content:center;transition:background .12s ease,color .12s ease,box-shadow .18s ease,transform .12s ease}.dispatch-container .date-cal-day:hover:not(:disabled):not(.is-selected){background:#6366f11a;color:#4338ca}.dispatch-container .date-cal-day.is-other-month{color:#cbd5e1;font-weight:500}.dispatch-container .date-cal-day.is-today{box-shadow:inset 0 0 0 1.5px #6366f18c;color:#4338ca;font-weight:800}.dispatch-container .date-cal-day.is-selected{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 4px 12px #6366f159;color:#fff;font-weight:800}.dispatch-container .date-cal-day.is-selected.is-today{box-shadow:0 4px 12px #6366f159}.dispatch-container .date-cal-day.is-selected:hover{box-shadow:0 6px 16px #6366f173;transform:translateY(-1px)}.dispatch-container .date-cal-day.is-disabled{color:#e2e8f0;cursor:not-allowed;pointer-events:none}.dispatch-container .date-cal-day:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .date-cal-presets{border-top:1px solid #0f172a0f;display:flex;gap:6px;margin-top:10px;padding-top:10px}.dispatch-container .date-cal-preset{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #0f172a14;border-radius:9px;color:#475569;cursor:pointer;flex:1 1;font-size:11px;font-weight:700;letter-spacing:.02em;padding:7px 10px;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .12s ease}.dispatch-container .date-cal-preset:hover{background:#6366f114;border-color:#6366f159;color:#4338ca;transform:translateY(-1px)}.dispatch-container .date-cal-preset:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .date-chip-nav{align-items:center;-webkit-appearance:none;appearance:none;background:#f8fafcb3;border:0;border-left:1px solid #0f172a0f;border-right:1px solid #0f172a0f;color:#64748b;cursor:pointer;display:inline-flex;font-size:18px;justify-content:center;transition:background .15s ease,color .15s ease;width:34px}.dispatch-container .date-chip-nav:first-child{border-left:0;border-radius:11px 0 0 11px;border-right:1px solid #0f172a0f}.dispatch-container .date-chip-nav:last-child{border-left:1px solid #0f172a0f;border-radius:0 11px 11px 0;border-right:0}.dispatch-container .date-chip-nav:hover:not(:disabled){background:#6366f114;color:#4338ca}.dispatch-container .date-chip-nav:disabled{cursor:not-allowed;opacity:.4}.dispatch-container .date-chip-nav:focus-visible{outline:2px solid #6366f180;outline-offset:-2px}.dispatch-container #batch-row{align-items:center;background:#f8fafc;background:var(--bg-sub);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;gap:12px;min-width:0;padding:12px 24px}.dispatch-container .batch-scroll{-webkit-overflow-scrolling:touch;align-items:center;display:flex;flex:1 1;gap:10px;min-width:0;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scroll-behavior:smooth;scrollbar-color:#64748b66 #0000;scrollbar-width:thin}.dispatch-container .batch-scroll::-webkit-scrollbar{height:6px}.dispatch-container .batch-scroll::-webkit-scrollbar-track{background:#0000}.dispatch-container .batch-scroll::-webkit-scrollbar-thumb{background:#64748b4d;border-radius:999px}.dispatch-container .batch-scroll::-webkit-scrollbar-thumb:hover{background:#64748b8c}.dispatch-container .batch-label{color:#64748b;color:var(--text-muted);flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.08em;margin-right:4px;text-transform:uppercase}.dispatch-container .time-field-wrap{display:inline-block;flex-shrink:0;margin-right:4px;position:relative}.dispatch-container .time-field-btn{align-items:center;background:#7b1fa214;border:1px solid #7b1fa240;border-radius:999px;color:#7b1fa2;cursor:pointer;display:inline-flex;font-family:inherit;font-size:12.5px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:7px 12px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.dispatch-container .time-field-btn:hover{background:#7b1fa224;border-color:#7b1fa273}.dispatch-container .time-field-btn.open{background:#7b1fa22e;border-color:#7b1fa28c;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .time-field-btn svg{flex-shrink:0;font-size:13px}.dispatch-container .time-field-caret{font-size:15px;transition:transform .2s ease}.dispatch-container .time-field-btn.open .time-field-caret{transform:rotate(180deg)}.dispatch-container .time-field-text{white-space:nowrap}.dispatch-container .time-field-menu{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:12px;box-shadow:0 16px 36px #0f172a29;left:0;min-width:180px;padding:6px;position:absolute;top:calc(100% + 6px);z-index:1000}.dispatch-container .time-field-option{align-items:center;background:#0000;border:0;border-radius:8px;color:#1e293b;cursor:pointer;display:flex;font-family:inherit;font-size:12px;font-weight:600;gap:8px;padding:8px 10px;text-align:left;transition:background .12s ease;width:100%}.dispatch-container .time-field-option:hover{background:#7b1fa20f}.dispatch-container .time-field-option.active{background:#7b1fa21a;color:#7b1fa2}.dispatch-container .time-field-option-icon{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .time-field-option-check{color:#7b1fa2;font-weight:800;margin-left:auto}.dispatch-container .slot-edit-wrap{display:inline-block;flex-shrink:0;margin-right:4px;position:relative}.dispatch-container .slot-edit-btn{align-items:center;background:#0f172a0a;border:1px dashed #0f172a2e;border-radius:999px;color:#475569;cursor:pointer;display:inline-flex;font-family:inherit;font-size:12.5px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:7px 12px}.dispatch-container .slot-edit-btn:hover{background:#0f172a14;border-color:#0f172a52;color:#0f172a}.dispatch-container .slot-edit-btn.open{background:#7b1fa21a;border-color:#7b1fa280;border-style:solid;color:#7b1fa2}.dispatch-container .slot-edit-btn svg{flex-shrink:0;font-size:13px}.dispatch-container .slot-edit-panel{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:14px;box-shadow:0 20px 44px #0f172a33;left:0;min-width:340px;padding:12px;position:absolute;top:calc(100% + 6px);z-index:1000}.dispatch-container .slot-edit-head{margin-bottom:10px}.dispatch-container .slot-edit-title{color:#0f172a;font-size:13px;font-weight:800}.dispatch-container .slot-edit-sub{color:#64748b;font-size:11px;margin-top:2px}.dispatch-container .slot-edit-list{display:flex;flex-direction:column;gap:8px;max-height:260px;overflow-y:auto;padding-right:2px}.dispatch-container .slot-edit-row{grid-gap:8px;align-items:center;display:grid;gap:8px;grid-template-columns:22px 70px 70px 1fr 28px}.dispatch-container .slot-edit-idx{align-items:center;background:#7b1fa21f;border-radius:6px;color:#7b1fa2;display:inline-flex;font-size:11px;font-weight:800;height:22px;justify-content:center;width:22px}.dispatch-container .slot-edit-field{display:flex;flex-direction:column;gap:2px}.dispatch-container .slot-edit-field-label{color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .slot-edit-field input{background:#fff;border:1px solid #0f172a29;border-radius:8px;color:#0f172a;font-family:inherit;font-size:12px;font-weight:700;padding:5px 8px;width:100%}.dispatch-container .slot-edit-field input:focus{border-color:#7b1fa2;box-shadow:0 0 0 3px #7b1fa22e;outline:none}.dispatch-container .slot-edit-preview{color:#475569;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .slot-edit-remove{align-items:center;background:#dc26260f;border:1px solid #dc262652;border-radius:50%;color:#dc2626;cursor:pointer;display:inline-flex;font-size:16px;font-weight:800;height:26px;justify-content:center;line-height:1;padding:0;width:26px}.dispatch-container .slot-edit-remove:hover:not(:disabled){background:#dc262624;border-color:#dc26268c}.dispatch-container .slot-edit-remove:disabled{cursor:not-allowed;opacity:.4}.dispatch-container .slot-edit-actions{border-top:1px dashed #0f172a1a;display:flex;gap:8px;margin-top:12px;padding-top:10px}.dispatch-container .slot-edit-add,.dispatch-container .slot-edit-reset{border:1px solid #0000;border-radius:8px;cursor:pointer;flex:1 1;font-family:inherit;font-size:11px;font-weight:700;letter-spacing:.02em;padding:7px 10px}.dispatch-container .slot-edit-add{background:#7b1fa2;border-color:#7b1fa2;color:#fff}.dispatch-container .slot-edit-add:hover{background:#6a1591}.dispatch-container .slot-edit-reset{background:#fff;border-color:#0f172a29;color:#475569}.dispatch-container .slot-edit-reset:hover{background:#0f172a0a;color:#0f172a}.dispatch-container .batch-btn{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:inherit;font-size:13.5px;font-weight:600;gap:8px;padding:8px 16px;transition:all .15s cubic-bezier(.4,0,.2,1);white-space:nowrap}.dispatch-container .batch-btn:hover{border-color:#64748b;border-color:var(--text-muted);color:#1e293b;color:var(--text)}.dispatch-container .batch-btn.active{border-color:#0000;box-shadow:0 4px 12px #0000001f;color:#fff}.dispatch-container .batch-btn.batch-slot.active{background:linear-gradient(135deg,#3b82f6,#6366f1)}.dispatch-container .batch-btn-icon{font-size:14px;line-height:1}.dispatch-container .batch-btn-label{letter-spacing:.01em}.dispatch-container .batch-btn-count{font-feature-settings:"tnum";align-items:center;background:#f8fafc;background:var(--bg-sub);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:800;height:20px;justify-content:center;min-width:24px;padding:0 7px}.dispatch-container .batch-btn.active .batch-btn-count{background:#ffffff47;color:#fff}.dispatch-container .status-chip{border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em;padding:3px 8px;text-transform:uppercase}.dispatch-container .status-chip,.dispatch-container .step-flag{align-items:center;display:inline-flex;flex-shrink:0;margin-left:8px}.dispatch-container .step-flag{gap:5px}.dispatch-container .step-flag-svg{filter:drop-shadow(0 1px 1px rgba(0,0,0,.15));flex-shrink:0;height:18px;width:14px}.dispatch-container .step-flag-label{font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.dispatch-container .cmark{display:block;height:100%;position:relative;width:100%}.dispatch-container .cmark.pulse{animation:cmark-pulse .8s ease-out infinite;z-index:1500!important}@keyframes cmark-pulse{0%{filter:drop-shadow(0 2px 4px rgba(59,130,246,.4));transform:scale(1)}50%{filter:drop-shadow(0 4px 8px rgba(59,130,246,.7));transform:scale(1.2)}to{filter:drop-shadow(0 2px 4px rgba(59,130,246,.4));transform:scale(1)}}.dispatch-container .cmark .cmark-flag{display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25));height:100%;pointer-events:none;width:100%}.dispatch-container .cmark.is-rider-focused{align-items:center;border:3px solid #fff;border-radius:50%;box-shadow:0 4px 12px #0006;color:#fff;display:flex;font-weight:800;justify-content:center;letter-spacing:.02em;position:relative}.dispatch-container .cmark.is-rider-focused .cmark-flag{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35));height:22px;left:50%;pointer-events:none;position:absolute;top:-20px;transform:translateX(-2px);width:18px}.dispatch-container .cmark.is-rider-focused.pulse{animation:cmark-focused-pulse .8s ease-out infinite;z-index:1500!important}@keyframes cmark-focused-pulse{0%{box-shadow:0 0 0 0 #3b82f68c,0 4px 12px #0006;transform:scale(1)}70%{box-shadow:0 0 0 14px #3b82f600,0 4px 12px #0006;transform:scale(1.18)}to{box-shadow:0 0 0 0 #3b82f600,0 4px 12px #0006;transform:scale(1)}}.dispatch-container .live-rider-pin{--pin-color:#16a34a;height:41px;position:relative;width:24px}.dispatch-container .live-rider-pin-marker{background:var(--pin-color);border:3px solid #fff;border-radius:50% 50% 50% 0;box-shadow:0 4px 10px #0000004d;height:24px;left:0;position:absolute;top:0;transform:rotate(-45deg);width:24px}.dispatch-container .live-rider-pin-marker:after{background:#fff;border-radius:50%;content:"";inset:4px;position:absolute}.dispatch-container .live-rider-pin-label{background:var(--pin-color);border-radius:4px;box-shadow:0 2px 6px #00000040;color:#fff;font-size:11px;font-weight:700;left:30px;line-height:1.2;padding:3px 8px;position:absolute;top:2px;white-space:nowrap}.dispatch-container .live-rider-pin-label span{font-weight:500;margin-left:4px;opacity:.85}.dispatch-container #body{display:flex;flex:1 1;min-height:0;overflow:hidden;position:relative}.dispatch-container #sidebar{background:#f8fafc;background:var(--bg-sub);border-right:1px solid #e2e8f0;border-right:1px solid var(--border);display:flex;flex:0 0 400px;flex-direction:column;overflow:hidden;transition:width .32s cubic-bezier(.4,0,.2,1),flex-basis .32s cubic-bezier(.4,0,.2,1),border-right-color .2s ease;width:400px;z-index:5}.dispatch-container #body.sidebar-collapsed #sidebar{border-right-color:#0000;flex:0 0;width:0}.dispatch-container .sidebar-toggle-tab{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:10px;box-shadow:0 4px 12px #0f172a1f,0 1px 3px #0f172a0f;color:#1e293b;color:var(--text,#0f172a);cursor:pointer;display:inline-flex;font-size:18px;height:56px;justify-content:center;left:400px;line-height:1;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:left .32s cubic-bezier(.4,0,.2,1),background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;width:22px;z-index:1200}.dispatch-container .sidebar-toggle-tab:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 6px 16px #6366f159;color:#fff;transform:translate(-50%,-50%) scale(1.06)}.dispatch-container .sidebar-toggle-tab:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent,#3b82f6);outline-offset:2px}.dispatch-container .sidebar-toggle-tab.is-collapsed{border-left:none;border-radius:0 10px 10px 0;left:0;transform:translateY(-50%)}.dispatch-container .sidebar-toggle-tab.is-collapsed:hover{transform:translateY(-50%) scale(1.06)}.dispatch-container .sidebar-toggle-tab svg{display:block}.dispatch-container .sb-header{background:linear-gradient(180deg,#fff,#f8fafc);background:linear-gradient(180deg,#fff 0,var(--bg-sub) 100%);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);overflow:hidden;padding:18px 18px 16px;position:relative}.dispatch-container .sb-header:before{background:radial-gradient(circle at center,#3b82f614 0,#0000 70%);background:radial-gradient(circle at center,var(--accent-soft) 0,#0000 70%);border-radius:50%;content:"";height:160px;inset:-40px -40px auto auto;pointer-events:none;position:absolute;width:160px}.dispatch-container .sb-header>*{position:relative}.dispatch-container .sb-header-top{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:12px}.dispatch-container .sb-header-title{align-items:center;display:inline-flex;gap:8px}.dispatch-container .sb-title-bar{background:linear-gradient(180deg,#3b82f6,#6366f1);background:linear-gradient(180deg,var(--accent),#6366f1);border-radius:2px;display:inline-block;height:14px;width:3px}.dispatch-container .sb-title-text{color:#1e293b;color:var(--text);font-size:12px;font-weight:800;letter-spacing:.12em}.dispatch-container .sb-header-scope{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);display:inline-flex;font-size:9px;font-weight:800;gap:5px;letter-spacing:.08em;max-width:60%;overflow:hidden;padding:3px 9px;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .sb-scope-dot{background:#22c55e;background:var(--success);border-radius:50%;box-shadow:0 0 0 2px #22c55e2e;flex-shrink:0;height:6px;width:6px}.dispatch-container .sb-header-area{align-items:center;background:#3b82f614;background:var(--accent-soft);border:1px solid #3b82f638;border-radius:999px;color:#3b82f6;color:var(--accent);display:inline-flex;font-size:11px;font-weight:700;gap:6px;margin-bottom:14px;padding:4px 10px 4px 8px}.dispatch-container .sb-area-icon{align-items:center;display:inline-flex;font-size:14px;line-height:1}.dispatch-container .sb-header-tiles{grid-gap:10px;display:grid;gap:10px;grid-template-columns:1fr 1fr}.dispatch-container .sb-tile{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;box-shadow:0 2px 6px #0f172a0a;display:flex;gap:10px;padding:10px 12px;transition:transform .18s ease,box-shadow .18s ease}.dispatch-container .sb-tile:hover{box-shadow:0 6px 14px #0f172a0f;transform:translateY(-1px)}.dispatch-container .sb-tile-icon{align-items:center;border-radius:10px;display:inline-flex;flex-shrink:0;font-size:18px;height:32px;justify-content:center;width:32px}.dispatch-container .sb-tile-orders .sb-tile-icon{background:#3b82f614;background:var(--accent-soft);color:#3b82f6;color:var(--accent)}.dispatch-container .sb-tile-riders .sb-tile-icon{background:#f59e0b1f;color:#f59e0b;color:var(--kitchen)}.dispatch-container .sb-tile-body{line-height:1.1;min-width:0}.dispatch-container .sb-tile-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.01em}.dispatch-container .sb-tile-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container #stats-strip{grid-gap:12px;background:#fff;background:var(--bg);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:grid;gap:12px;grid-template-columns:repeat(2,1fr);padding:16px}.dispatch-container .sc{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;padding:12px}.dispatch-container .sc-lbl{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.05em;margin-bottom:4px;text-transform:uppercase}.dispatch-container .sc-val{color:#1e293b;color:var(--text);font-size:22px;font-weight:800;line-height:1}.dispatch-container .sc-val.g{color:#22c55e;color:var(--success)}.dispatch-container .sc-sub{color:#64748b;color:var(--text-muted);font-size:11px;margin-top:4px}.dispatch-container #riders-panel{flex:1 1;overflow-y:auto;padding:16px}.dispatch-container .ph{align-items:center;color:#64748b;color:var(--text-muted);display:flex;font-size:11px;font-weight:700;gap:12px;letter-spacing:.05em;margin-bottom:16px;text-transform:uppercase}.dispatch-container .ph:after{background:#e2e8f0;background:var(--border);content:"";flex:1 1;height:1px}.dispatch-container .rcard{background:#fff;background:var(--bg-card);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:14px;box-shadow:0 4px 12px #0000000d;box-shadow:var(--shadow);cursor:pointer;margin-bottom:12px;padding:16px;transition:all .2s cubic-bezier(.4,0,.2,1)}.dispatch-container .rcard:hover{border-color:#3b82f6;border-color:var(--accent);box-shadow:0 10px 25px -5px #00000014;box-shadow:var(--shadow-lg);transform:translateY(-2px)}.dispatch-container .rcard-top{align-items:center;display:flex;gap:12px;margin-bottom:12px}.dispatch-container .kitchen-mark{box-shadow:0 0 20px #f59e0b99,0 0 40px #f59e0b4d;font-size:14px;font-weight:800;height:34px;width:34px}.dispatch-container .rcard-info{flex:1 1}.dispatch-container .rcard-emo{align-items:center;border:1.5px solid #e2e8f0;border:1.5px solid var(--border);border-radius:10px;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.dispatch-container .rcard-name{color:#1e293b;color:var(--text);font-size:15px;font-weight:700}.dispatch-container .rcard-zone{color:#64748b;color:var(--text-muted);font-size:12px;margin-top:2px}.dispatch-container .rcard-badge{font-feature-settings:"tnum","tnum";background:#f8fafc;background:var(--bg-sub);border-radius:8px;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;padding:4px 10px;white-space:nowrap}.dispatch-container .rcard-badge.is-done{background:#16a34a1f;color:#16a34a}.dispatch-container .bar-bg{background:#f8fafc;background:var(--bg-sub);border-radius:4px;height:5px;margin-bottom:12px;overflow:hidden}.dispatch-container .bar-fg{border-radius:4px;height:100%}.dispatch-container .rcard-meta{color:#64748b;color:var(--text-muted);display:flex;font-size:12px;font-weight:500;justify-content:space-between}.dispatch-container .step-ids{display:flex;flex-wrap:wrap;gap:4px;margin-top:10px}.dispatch-container .step-id{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:4px;color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;padding:2px 6px}.dispatch-container .zone-order-change-rider{align-items:center;align-self:flex-start;background:#fff;border:1px solid #e2e8f0;border-radius:7px;color:#4f46e5;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:15px;height:26px;justify-content:center;margin-left:6px;transition:background .15s,color .15s,border-color .15s;width:26px}.dispatch-container .zone-order-change-rider:hover{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}.dispatch-container #route-detail{background:#fff;background:var(--bg);flex:1 1;overflow-y:auto;padding:20px}.dispatch-container .rd-back{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;color:#1e293b;color:var(--text);cursor:pointer;font-size:12px;font-weight:600;margin-bottom:20px;padding:8px 16px;transition:all .2s}.dispatch-container .rd-back:hover{background:#e2e8f0;background:var(--border)}.dispatch-container .rd-rider-name{font-size:28px;font-weight:800;letter-spacing:-.02em;line-height:1.1;margin-bottom:6px}.dispatch-container .rd-rider-sub{color:#64748b;color:var(--text-muted);display:flex;font-size:13px;gap:16px;margin-bottom:24px}.dispatch-container .rd-stats-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(3,1fr);margin:14px 0 22px}.dispatch-container .rd-stat{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;padding:14px 10px 12px;text-align:center;transition:transform .15s,box-shadow .15s}.dispatch-container .rd-stat:hover{box-shadow:0 4px 10px #0000000d;transform:translateY(-1px)}.dispatch-container .rd-stat-icon{font-size:18px;line-height:1;margin-bottom:6px;opacity:.9}.dispatch-container .rd-stat-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.02em;line-height:1}.dispatch-container .rd-stat-unit{font-size:12px;font-weight:700;margin-left:3px;opacity:.7}.dispatch-container .rd-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:800;letter-spacing:.08em;margin-top:6px;text-transform:uppercase}.dispatch-container .rd-stat-orders{background:linear-gradient(135deg,#3b82f617,#6366f10a);border-color:#3b82f638}.dispatch-container .rd-stat-orders .rd-stat-value{color:#2563eb}.dispatch-container .rd-stat-distance{background:linear-gradient(135deg,#f59e0b1a,#f973160a);border-color:#f59e0b40}.dispatch-container .rd-stat-distance .rd-stat-value{color:#d97706}.dispatch-container .rd-stat-profit.is-gain{background:linear-gradient(135deg,#22c55e1f,#14b8a60a);border-color:#22c55e59}.dispatch-container .rd-stat-profit.is-gain .rd-stat-value{color:#16a34a}.dispatch-container .rd-stat-profit.is-gain .rd-stat-label{color:#16a34a;opacity:.75}.dispatch-container .rd-stat-profit.is-loss{background:linear-gradient(135deg,#ef44441f,#f43f5e0a);border-color:#ef444459}.dispatch-container .rd-stat-profit.is-loss .rd-stat-value{color:#dc2626}.dispatch-container .rd-stat-profit.is-loss .rd-stat-label{color:#dc2626;opacity:.75}.dispatch-container .trip-block{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:16px;margin-bottom:24px;overflow:hidden}.dispatch-container .trip-header{align-items:center;background:#fff;border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-start;padding:10px 14px}.dispatch-container .th-badge{border-radius:6px;color:#fff;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.02em;padding:4px 10px}.dispatch-container .trip-stats{color:#64748b;color:var(--text-muted);display:flex;flex-shrink:0;font-size:12px;font-weight:600;gap:10px}.dispatch-container .trip-sort-toggle{align-items:stretch;background:#f1f5f9;border-radius:10px;display:flex;flex-basis:100%;isolation:isolate;margin-left:0;padding:3px;position:relative;width:100%}.dispatch-container .trip-sort-pill{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:7px;color:#64748b;cursor:pointer;display:inline-flex;flex:1 1;font-size:11.5px;font-weight:600;gap:6px;justify-content:center;letter-spacing:.01em;line-height:1;min-height:28px;padding:6px 10px;transition:color .18s ease,background .18s ease,box-shadow .18s ease;white-space:nowrap}.dispatch-container .trip-sort-pill svg{color:#94a3b8;display:block;flex:0 0 auto;height:14px;transition:color .18s ease,transform .18s ease;width:14px}.dispatch-container .trip-sort-pill:hover:not(.is-active){color:#0f172a}.dispatch-container .trip-sort-pill:hover:not(.is-active) svg{color:#475569}.dispatch-container .trip-sort-pill:focus-visible{box-shadow:0 0 0 2px #6366f166;outline:none}.dispatch-container .trip-sort-pill.is-active{background:#fff;box-shadow:0 1px 2px #0f172a14,0 0 0 1px #0f172a0a,0 2px 6px #0f172a0f;color:#0f172a}.dispatch-container .trip-sort-toggle[data-mode=planned] .trip-sort-pill.is-active svg{color:#6366f1}.dispatch-container .trip-sort-toggle[data-mode=time] .trip-sort-pill.is-active svg{color:#10b981}.dispatch-container .zone-order-card.is-pending-time{opacity:.72}.dispatch-container .step-wrap{padding:16px}.dispatch-container .step-row{border-radius:8px;display:flex;gap:16px;padding-bottom:20px;position:relative;transition:background .15s ease,box-shadow .15s ease}.dispatch-container .step-row.clickable{cursor:pointer}.dispatch-container .step-row.clickable:hover{background:#6366f10f}.dispatch-container .step-row.clickable:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent);outline-offset:2px}.dispatch-container .step-row.active{background:#6366f11a;box-shadow:inset 3px 0 0 #6366f1;margin-left:-8px;padding-left:8px}.dispatch-container .step-row:not(:last-child):before{background:#e2e8f0;background:var(--border);bottom:0;content:"";left:15px;position:absolute;top:32px;width:2px}.dispatch-container .step-dot{align-items:center;border-radius:50%;display:flex;flex-shrink:0;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px;z-index:2}.dispatch-container .step-dot.kitchen{background:#f59e0b;background:var(--kitchen);color:#fff}.dispatch-container .step-dot.delivery{background:#fff;border:2px solid #e2e8f0;border:2px solid var(--border);color:#64748b;color:var(--text-muted)}.dispatch-container .step-label{font-size:15px;font-weight:700}.dispatch-container .step-label-row{align-items:flex-start;display:flex}.dispatch-container .step-customer{flex:1 1;line-height:1.35;min-width:0;overflow-wrap:anywhere;word-break:break-word}.dispatch-container .kitchen-tag{color:#f59e0b;color:var(--kitchen)}.dispatch-container .step-dest{color:#64748b;color:var(--text-muted);font-size:13px;margin-top:3px}.dispatch-container .step-detail{display:flex;flex-wrap:wrap;font-size:13px;font-weight:600;gap:10px;margin-top:6px}.dispatch-container .step-profit{color:#22c55e;color:var(--success)}.dispatch-container .step-profit.is-loss{color:#dc2626}.dispatch-container .step-location{font-weight:500}.dispatch-container .step-location,.dispatch-container .step-notes{color:#64748b;color:var(--text-muted);font-size:11px;margin-top:3px}.dispatch-container .step-notes{background:#f59e0b14;border-left:2px solid #f59e0b99;border-radius:4px;font-style:italic;max-width:100%;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .step-charges{color:#0074e7;font-weight:600}.dispatch-container .step-type{border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em;padding:2px 7px;text-transform:uppercase}.dispatch-container .step-type.type-economy{background:#22c55e26;color:#16a34a}.dispatch-container .step-type.type-risky{background:#ef444426;color:#dc2626}.dispatch-container .step-type.type-express{background:#3b82f626;color:#2563eb}.dispatch-container .step-type:not(.type-economy):not(.type-risky):not(.type-express){background:#64748b26;color:#475569}.dispatch-container .rcard.zone-card{background:linear-gradient(180deg,#fff,#fafbff);overflow:hidden;padding:14px 14px 12px;position:relative}.dispatch-container .rcard.zone-card:before{background:linear-gradient(180deg,#3b82f6,#6366f1);content:"";height:100%;left:0;opacity:.55;position:absolute;top:0;transition:opacity .2s,width .2s;width:3px}.dispatch-container .rcard.zone-card:hover{background:linear-gradient(180deg,#fff,#f0f7ff);border-color:#3b82f680;box-shadow:0 8px 22px #3b82f61f}.dispatch-container .rcard.zone-card:hover:before{opacity:1;width:4px}.dispatch-container .zone-card-header{align-items:center;display:flex;gap:10px;margin-bottom:12px}.dispatch-container .zone-card-emoji{align-items:center;background:linear-gradient(135deg,#3b82f61f,#6366f124);border:1px solid #3b82f638;border-radius:10px;display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.dispatch-container .zone-card-titles{flex:1 1;min-width:0}.dispatch-container .zone-card-name{color:#1e293b;color:var(--text);font-size:15px;font-weight:800;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-card-sub{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:500;margin-top:2px}.dispatch-container .zone-card-arrow{color:#3b82f6;color:var(--accent);flex-shrink:0;font-size:18px;font-weight:800;opacity:.4;transition:transform .2s,opacity .2s}.dispatch-container .rcard.zone-card:hover .zone-card-arrow{opacity:1;transform:translateX(4px)}.dispatch-container .zone-progress-row{align-items:center;display:flex;gap:10px;margin:10px 0 4px}.dispatch-container .zone-progress-row .zone-status-bar{flex:1 1;height:6px;margin:0}.dispatch-container .zone-progress-label{font-feature-settings:"tnum";color:#64748b;color:var(--text-muted);font-size:10px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:.02em;white-space:nowrap}.dispatch-container .zone-stat-pills{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.dispatch-container .zone-stat-pill{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:8px;display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:4px 9px;transition:all .15s}.dispatch-container .zone-stat-icon{font-size:12px;opacity:.85}.dispatch-container .zone-stat-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-variant-numeric:tabular-nums;font-weight:800}.dispatch-container .zone-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:600}.dispatch-container .zone-stat-pill.profit-positive{background:#22c55e14;border-color:#22c55e40}.dispatch-container .zone-stat-pill.profit-positive .zone-stat-value{color:#22c55e;color:var(--success)}.dispatch-container .zone-stat-pill.profit-negative{background:#ef444414;border-color:#ef444440}.dispatch-container .zone-stat-pill.profit-negative .zone-stat-value{color:#ef4444}.dispatch-container .zone-card-suburbs{align-items:center;border-top:1px dashed #e2e8f0;border-top:1px dashed var(--border);color:#64748b;color:var(--text-muted);display:flex;font-size:11px;gap:6px;line-height:1.4;margin-top:10px;padding-top:10px}.dispatch-container .zone-card-suburbs-text{flex:1 1;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-card-suburbs-more{background:#3b82f614;background:var(--accent-soft);border-radius:999px;color:#3b82f6;color:var(--accent);flex-shrink:0;font-size:10px;font-weight:800;padding:1px 7px}.dispatch-container .zone-status-bar{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:3px;display:flex;height:5px;margin-top:10px;overflow:hidden}.dispatch-container .zone-status-bar.tall{border-radius:4px;height:16px}.dispatch-container .zone-status-seg{align-items:center;display:flex;height:100%;justify-content:center;min-width:1px;transition:filter .2s}.dispatch-container .zone-status-bar.tall .zone-status-seg{color:#fff;font-size:10px;font-weight:800;text-shadow:0 1px 2px #0000004d}.dispatch-container .zone-status-seg:hover{filter:brightness(1.1)}.dispatch-container .zone-status-seg-label{padding:0 4px}.dispatch-container .zone-status-legend{color:#64748b;color:var(--text-muted);display:flex;flex-wrap:wrap;font-size:11px;gap:10px;margin-top:8px}.dispatch-container .legend-item{align-items:center;display:inline-flex;gap:5px}.dispatch-container .legend-item strong{color:#1e293b;color:var(--text);font-weight:700;margin-left:2px}.dispatch-container .legend-dot{border-radius:50%;flex-shrink:0;height:9px;width:9px}.dispatch-container .zone-detail-section{margin:18px 0}.dispatch-container .zone-section-label{align-items:center;color:#64748b;color:var(--text-muted);display:flex;font-size:10px;font-weight:800;gap:10px;letter-spacing:.06em;margin-bottom:10px;text-transform:uppercase}.dispatch-container .zone-section-label:after{background:#e2e8f0;background:var(--border);content:"";flex:1 1;height:1px}.dispatch-container .section-count{color:#3b82f6;color:var(--accent);font-weight:700}.dispatch-container .zone-chips{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .zone-chip{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-weight:600;gap:6px;padding:4px 4px 4px 10px;transition:all .15s}.dispatch-container .zone-chip:hover{background:#3b82f614;background:var(--accent-soft);border-color:#3b82f6;border-color:var(--accent)}.dispatch-container .zone-chip.kitchen{background:#f59e0b0f;border-color:#f59e0b40}.dispatch-container .zone-chip.kitchen:hover{background:#f59e0b1f;border-color:#f59e0b80}.dispatch-container .zone-chip-name{white-space:nowrap}.dispatch-container .zone-chip-count{align-items:center;background:#3b82f6;background:var(--accent);border-radius:999px;color:#fff;display:inline-flex;font-size:10px;font-weight:800;height:18px;justify-content:center;min-width:20px;padding:0 6px}.dispatch-container .zone-chip-count.kitchen{background:#f59e0b;background:var(--kitchen)}.dispatch-container .zone-chip.zone-chip-clickable{cursor:pointer;font-family:inherit}.dispatch-container .zone-chip.zone-chip-clickable.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 2px 8px #3b82f640;color:#fff}.dispatch-container .zone-chip.zone-chip-clickable.active .zone-chip-count{background:#ffffff40;color:#fff}.dispatch-container .zone-suburb-panel{animation:zone-suburb-panel-in .18s ease-out;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;margin-top:12px;overflow:hidden}@keyframes zone-suburb-panel-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .zone-suburb-panel-head{align-items:center;background:#3b82f614;background:var(--accent-soft);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;gap:8px;justify-content:space-between;padding:10px 14px}.dispatch-container .zone-suburb-panel-title{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:13px;font-weight:800;gap:6px;letter-spacing:-.01em}.dispatch-container .zone-suburb-panel-count{background:#3b82f6;background:var(--accent);border-radius:999px;color:#fff;font-size:10px;font-weight:800;letter-spacing:.04em;margin-left:6px;padding:2px 8px}.dispatch-container .zone-suburb-panel-close{background:#0f172a0f;border:none;border-radius:50%;color:#64748b;color:var(--text-muted);cursor:pointer;font-size:18px;font-weight:700;height:24px;line-height:1;transition:all .15s;width:24px}.dispatch-container .zone-suburb-panel-close:hover{background:#ef444426;color:#dc2626}.dispatch-container .zone-suburb-panel-empty{color:#64748b;color:var(--text-muted);font-size:12px;padding:16px;text-align:center}.dispatch-container .zone-order-grid{display:flex;flex-direction:column;gap:10px;padding:4px 2px 12px}.dispatch-container .zone-order-card{background:#fff;border:1px solid #7b1fa224;border-radius:12px;box-shadow:0 1px 2px #0f172a0a;overflow:hidden;padding:12px 14px 12px 18px;position:relative;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.dispatch-container .zone-order-card:before{background:#7b1fa2;content:"";height:100%;left:0;opacity:.85;position:absolute;top:0;transition:width .18s ease,opacity .18s ease;width:4px}.dispatch-container .zone-order-card.clickable{cursor:pointer}.dispatch-container .zone-order-card.clickable:hover{border-color:#7b1fa273;box-shadow:0 8px 20px #7b1fa229;transform:translateY(-1px)}.dispatch-container .zone-order-card.clickable:hover:before{opacity:1;width:5px}.dispatch-container .zone-order-card.active{background:linear-gradient(180deg,#fff,#f7eaff);border-color:#7b1fa2;box-shadow:0 10px 24px #7b1fa238}.dispatch-container .zone-order-card.active:before{opacity:1;width:6px}.dispatch-container .zone-order-card.going-on{background:linear-gradient(180deg,#fff,#ecfdf5);border-color:#22c55e66;box-shadow:0 6px 18px #22c55e26}.dispatch-container .zone-order-card.going-on:before{background:#16a34a;opacity:1}.dispatch-container .zone-order-card.going-on.active{background:linear-gradient(180deg,#fff,#d1fae5);border-color:#16a34a}.dispatch-container .zone-order-card-head{align-items:center;display:flex;gap:10px;margin-bottom:8px}.dispatch-container .zone-order-num{align-items:center;background:#7b1fa2;border:1px solid #7b1fa2;border-radius:8px;box-shadow:0 2px 6px #7b1fa238;color:#fff;display:flex;flex-shrink:0;font-size:13px;font-weight:800;height:28px;justify-content:center;width:28px}.dispatch-container .zone-order-id-block{flex:1 1;min-width:0}.dispatch-container .zone-order-id{color:#1e293b;color:var(--text);font-size:12px;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-rider{color:#7b1fa2;font-size:11px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-status{border-radius:999px;flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.04em;padding:3px 8px;text-transform:uppercase}.dispatch-container .zone-order-status-stack{align-items:flex-end;display:flex;flex-direction:column;flex-shrink:0;gap:3px}.dispatch-container .zone-order-time{font-feature-settings:"tnum";align-items:center;color:#1e293b;display:inline-flex;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;gap:4px;letter-spacing:.01em;white-space:nowrap}.dispatch-container .zone-order-time svg{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .zone-order-time.is-expected{color:#64748b;font-weight:600}.dispatch-container .zone-order-time.is-expected svg{color:#94a3b8}.dispatch-container .zone-order-est-drop{font-feature-settings:"tnum";align-items:center;color:#475569;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:600;gap:4px;white-space:nowrap}.dispatch-container .zone-order-est-drop svg{color:#0ea5e9;flex-shrink:0;font-size:13px}.dispatch-container .zone-order-customer{color:#1e293b;color:var(--text);font-size:14px;font-weight:700;letter-spacing:-.01em;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-line{color:#64748b;color:var(--text-muted);font-size:12px;line-height:1.4;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-notes{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#475569;display:-webkit-box;font-style:italic;text-overflow:clip;white-space:normal}.dispatch-container .zone-order-stats{border-top:1px dashed #7b1fa224;display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}.dispatch-container .zone-order-chip{align-items:center;background:#7b1fa20f;border:1px solid #7b1fa224;border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:4px 8px}.dispatch-container .zone-order-chip.is-profit{background:#22c55e1a;border-color:#22c55e40;color:#16a34a}.dispatch-container .zone-order-chip.is-loss{background:#ef44441a;border-color:#ef444440;color:#dc2626}.dispatch-container .zone-order-chip.zone-order-trip{background:#7b1fa21a;border-color:#7b1fa240;color:#7b1fa2}.dispatch-container .zone-order-type{letter-spacing:.05em;text-transform:uppercase}.dispatch-container .kitchen-transition{background:#f59e0b1a;background:var(--kitchen-soft);border:1px dashed #f59e0b;border:1px dashed var(--kitchen);border-radius:10px;font-size:12px;font-weight:600;margin:8px 0 20px 40px;padding:12px}.dispatch-container .zone-order-grid .kitchen-transition{margin:2px 0;padding:8px 12px}.dispatch-container #map-wrap{flex:1 1;position:relative;transition:flex .32s cubic-bezier(.4,0,.2,1)}.dispatch-container #map-wrap.compare-split{border-radius:0 14px 14px 0;border-right:0;box-shadow:0 0 0 1px #0f172a0f;flex-basis:calc(50% - 8px);flex-grow:1;flex-shrink:1;margin-right:16px;min-width:0;overflow:hidden}.dispatch-container .compare-planned-label{align-items:center;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffff2;border:1px solid #6366f14d;border-radius:999px;box-shadow:0 4px 14px #0f172a1a;color:#4338ca;display:inline-flex;font-size:10px;font-weight:800;gap:6px;left:12px;letter-spacing:.06em;padding:5px 12px 5px 9px;pointer-events:none;position:absolute;text-transform:uppercase;top:12px;z-index:1000}.dispatch-container .compare-planned-dot{background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;flex-shrink:0;height:7px;width:7px}.dispatch-container .compare-actual-label{align-items:center;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffff2;border:1px solid #0ea5e959;border-radius:999px;box-shadow:0 4px 14px #0f172a1a;color:#0369a1;display:inline-flex;font-size:10px;font-weight:800;gap:6px;left:12px;letter-spacing:.06em;padding:5px 12px 5px 9px;pointer-events:none;position:absolute;text-transform:uppercase;top:12px;z-index:1000}.dispatch-container .compare-actual-dot{animation:compare-actual-pulse 1.6s ease-in-out infinite;background:linear-gradient(135deg,#0ea5e9,#0369a1);border-radius:50%;box-shadow:0 0 0 2px #0ea5e926;flex-shrink:0;height:7px;width:7px}@keyframes compare-actual-pulse{0%,to{box-shadow:0 0 0 2px #0ea5e926}50%{box-shadow:0 0 0 4px #0ea5e90d}}@keyframes compare-label-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container #compare-map-wrap{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px 0 0 14px;box-shadow:0 0 0 1px #0f172a0f;display:flex;flex-basis:calc(50% - 8px);flex-direction:column;flex-grow:1;flex-shrink:1;min-width:0;overflow:hidden;position:relative}@keyframes compare-slide-in{0%{opacity:0;transform:translateX(18px)}to{opacity:1;transform:translateX(0)}}.dispatch-container #compare-map-wrap .leaflet-container{background:#f0f4f8!important;flex:1 1;min-height:0}.dispatch-container .compare-map-area{display:flex;flex:1 1;flex-direction:column;min-height:0;position:relative}.dispatch-container .compare-ov-br{bottom:12px;display:flex;gap:8px;position:absolute;right:12px;z-index:1000}.dispatch-container .compare-header{background:linear-gradient(180deg,#fff,#f8fafc);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);flex-shrink:0;padding:10px 14px 8px}.dispatch-container .compare-header-top{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:7px}.dispatch-container .compare-title{align-items:center;color:#0f172a;display:inline-flex;font-size:12px;font-weight:800;gap:7px;letter-spacing:.01em;min-width:0}.dispatch-container .compare-title-dot{border-radius:50%;display:inline-block;flex-shrink:0;height:12px;width:12px}.dispatch-container .compare-title-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-title-badge{align-items:center;background:#0ea5e91a;border:1px solid #0ea5e940;border-radius:999px;color:#0284c7;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.07em;padding:3px 9px;text-transform:uppercase}.dispatch-container .compare-progress{align-items:center;display:flex;gap:8px}.dispatch-container .compare-progress-bar-wrap{background:#0f172a12;border-radius:999px;flex:1 1;height:3px;overflow:hidden}.dispatch-container .compare-progress-bar-fill{background:linear-gradient(90deg,#0ea5e9,#6366f1);border-radius:999px;height:100%;transition:width .45s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-progress-bar-fill.is-done{background:linear-gradient(90deg,#22c55e,#16a34a)}.dispatch-container .compare-progress-text{font-feature-settings:"tnum";color:#94a3b8;flex-shrink:0;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}.dispatch-container .compare-track-legend{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a12);flex-shrink:0;max-height:150px;overflow-y:auto;scrollbar-color:#64748b40 #0000;scrollbar-width:thin}.dispatch-container .compare-track-legend::-webkit-scrollbar{width:4px}.dispatch-container .compare-track-legend::-webkit-scrollbar-thumb{background:#64748b40;border-radius:999px}.dispatch-container .compare-track-item{align-items:center;border-bottom:1px solid #0f172a0a;display:flex;gap:9px;padding:5px 14px;transition:background .12s}.dispatch-container .compare-track-item:last-child{border-bottom:0}.dispatch-container .compare-track-item:hover{background:rgba(15,23,42,.025)}.dispatch-container .compare-track-num{align-items:center;border-radius:50%;box-shadow:0 2px 6px #0003;color:#fff;display:inline-flex;flex-shrink:0;font-size:9px;font-weight:800;height:20px;justify-content:center;width:20px}.dispatch-container .compare-track-info{flex:1 1;min-width:0}.dispatch-container .compare-track-customer{color:#1e293b;font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-track-meta{color:#94a3b8;font-size:10px;font-weight:600;margin-top:1px}.dispatch-container .compare-track-right{align-items:flex-end;display:flex;flex-direction:column;flex-shrink:0;gap:3px}.dispatch-container .compare-track-status{align-items:center;border-radius:999px;display:inline-flex;font-size:8px;font-weight:800;letter-spacing:.05em;padding:1px 6px;text-transform:uppercase}.dispatch-container .compare-track-kms{color:#64748b;font-size:10px;font-weight:700}.dispatch-container .compare-track-no-data{align-items:center;color:#cbd5e1;display:inline-flex;font-size:9px;font-weight:600;gap:4px}.dispatch-container .compare-track-spinner{animation:compare-spin .65s linear infinite;border:1.5px solid #64748b2e;border-radius:50%;border-top-color:#94a3b8;flex-shrink:0;height:9px;width:9px}@keyframes compare-spin{to{transform:rotate(1turn)}}.dispatch-container .compare-overall-card{background:linear-gradient(180deg,#fff,#f8fafc);border-top:1px solid #e2e8f0;border-top:1px solid var(--border,#0f172a12);flex-shrink:0;padding:10px 14px}.dispatch-container .compare-overall-head{align-items:center;display:flex;gap:8px;margin-bottom:9px}.dispatch-container .compare-overall-dot{border-radius:50%;flex-shrink:0;height:11px;width:11px}.dispatch-container .compare-overall-name{color:#0f172a;flex:1 1;font-size:12px;font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-overall-rate{align-items:center;background:#22c55e1a;border:1px solid #22c55e38;border-radius:999px;color:#16a34a;display:inline-flex;flex-shrink:0;font-size:9px;font-weight:800;letter-spacing:.06em;padding:2px 8px;text-transform:uppercase}.dispatch-container .compare-overall-rate.is-partial{background:#f59e0b1a;border-color:#f59e0b40;color:#b45309}.dispatch-container .compare-overall-rate.is-zero{background:#64748b14;border-color:#64748b33;color:#64748b}.dispatch-container .compare-overall-stats{grid-gap:6px;display:grid;gap:6px;grid-template-columns:repeat(5,1fr)}.dispatch-container .compare-overall-stat{background:#0f172a08;border:1px solid #0f172a0f;border-radius:10px;padding:7px 6px 6px;text-align:center;transition:background .15s,transform .15s}.dispatch-container .compare-overall-stat:hover{background:rgba(15,23,42,.055);transform:translateY(-1px)}.dispatch-container .compare-overall-stat-icon{align-items:center;color:#94a3b8;display:flex;font-size:13px;justify-content:center;line-height:1;margin-bottom:3px}.dispatch-container .compare-overall-stat-value{color:#0f172a;font-size:14px;font-weight:800;line-height:1.1}.dispatch-container .compare-overall-stat-unit{color:#94a3b8;font-size:9px;font-weight:700;margin-left:2px}.dispatch-container .compare-overall-stat-label{color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container .compare-overall-stat.is-profit{background:#22c55e0f;border-color:#22c55e29}.dispatch-container .compare-overall-stat.is-profit .compare-overall-stat-value{color:#16a34a}.dispatch-container .compare-overall-stat.is-profit .compare-overall-stat-icon{color:#22c55e}.dispatch-container .compare-overall-stat.is-loss{background:#ef44440f;border-color:#ef444429}.dispatch-container .compare-overall-stat.is-loss .compare-overall-stat-value{color:#dc2626}.dispatch-container .compare-overall-stat.is-loss .compare-overall-stat-icon{color:#ef4444}.dispatch-container .compare-header-v2{background:linear-gradient(180deg,#fff,#f8fafc);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);display:flex;flex-direction:column;flex-shrink:0;gap:10px;padding:12px 14px 10px}.dispatch-container .compare-header-row{align-items:center;display:flex;gap:10px;min-width:0}.dispatch-container .compare-header-row .compare-title{align-items:center;color:#0f172a;display:inline-flex;flex:1 1;font-size:16px;font-weight:800;gap:10px;min-width:0}.dispatch-container .compare-header-tools{align-items:center;display:inline-flex;flex-shrink:0;gap:6px}.dispatch-container .compare-overall-btn{align-items:center;background:linear-gradient(135deg,#6366f114,#3b82f614);border:1px solid #6366f147;border-radius:999px;color:#4338ca;cursor:pointer;display:inline-flex;font-size:12px;font-weight:800;gap:6px;letter-spacing:.04em;padding:6px 12px;text-transform:uppercase;transition:all .18s ease}.dispatch-container .compare-overall-btn:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);border-color:#6366f1;box-shadow:0 4px 12px #6366f147;color:#fff;transform:translateY(-1px)}.dispatch-container .compare-overall-btn svg{font-size:15px}.dispatch-container .compare-sync-toggle{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:999px;color:#64748b;cursor:pointer;display:inline-flex;font-size:12px;font-weight:800;gap:6px;letter-spacing:.04em;padding:6px 12px;text-transform:uppercase;transition:all .18s ease}.dispatch-container .compare-sync-toggle:hover{border-color:#6366f166;color:#4338ca}.dispatch-container .compare-sync-toggle.is-on{background:linear-gradient(135deg,#22c55e,#16a34a);border-color:#16a34a;box-shadow:0 4px 10px #22c55e38;color:#fff}.dispatch-container .compare-sync-toggle svg{font-size:15px}.dispatch-container .compare-timeline-toggle{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:8px;color:#64748b;cursor:pointer;display:inline-flex;height:30px;justify-content:center;padding:0;transition:background .18s ease,color .18s ease,border-color .18s ease;width:30px}.dispatch-container .compare-timeline-toggle:hover{background:#6366f10f;border-color:#6366f166;color:#4338ca}.dispatch-container .compare-timeline-toggle svg{font-size:18px;transition:transform .22s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-timeline-toggle.is-open svg{color:#4338ca;transform:rotate(180deg)}.dispatch-container .compare-timeline-wrap{display:flex;flex-direction:column;gap:6px}.dispatch-container .compare-timeline-container{align-items:stretch;background:#0f172a05;border:1px solid #0f172a0f;border-radius:12px;box-shadow:inset 0 1px 2px #0f172a05;display:flex;gap:16px;padding:18px}.dispatch-container .compare-timeline-labels{border-right:1.5px dashed #0f172a14;display:flex;flex-direction:column;flex-shrink:0;gap:16px;justify-content:space-between;padding-right:14px}.dispatch-container .compare-timeline-label{align-items:center;color:#64748b;display:flex;font-size:11px;font-weight:800;height:32px;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .compare-timeline-scrollable{display:flex;flex:1 1;flex-direction:column;gap:16px;overflow-x:auto;padding-bottom:2px;scrollbar-color:#64748b33 #0000;scrollbar-width:thin}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar{height:4px}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-thumb{background:#64748b40;border-radius:999px}.dispatch-container .compare-timeline-track{align-items:center;display:flex;gap:0;position:relative}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:22px}.dispatch-container .compare-step-spacer{background:linear-gradient(90deg,#94a3b800,#94a3b88c 30%,#94a3b88c 70%,#94a3b800);flex-shrink:0;height:2px;width:16px}.dispatch-container .compare-step{align-items:center;background:#0000;border:0;cursor:pointer;display:inline-flex;flex-direction:column;flex-shrink:0;gap:11px;padding:2px 2px 0;position:relative;transition:transform .18s ease}.dispatch-container .compare-step:hover{transform:translateY(-1px)}.dispatch-container .compare-step-circle{align-items:center;background:#94a3b8;background:var(--step-color,#94a3b8);border-radius:50%;box-shadow:0 2px 6px #0f172a24,0 0 0 1px #fff9;color:#fff;display:inline-flex;font-size:13px;font-weight:800;height:32px;justify-content:center;transition:transform .18s ease,box-shadow .18s ease,background .18s ease;width:32px}.dispatch-container .compare-step:hover .compare-step-circle{box-shadow:0 4px 10px #0f172a33,0 0 0 1px #fff9;transform:scale(1.08)}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 4px 10px #0f172a38,0 0 0 2px #fff,0 0 0 4px #6366f1;box-shadow:0 4px 10px #0f172a38,0 0 0 2px #fff,0 0 0 4px var(--step-color,#6366f1);transform:scale(1.18)}.dispatch-container .compare-step.is-focused .compare-step-tick{color:#4338ca;color:var(--step-color,#4338ca);font-weight:800}.dispatch-container .compare-step.is-pending .compare-step-circle{background:#fff;border:2px solid #cbd5e1;border:2px solid var(--step-color,#cbd5e1);box-shadow:0 1px 3px #0f172a14;color:#94a3b8;color:var(--step-color,#94a3b8)}.dispatch-container .compare-step.is-skipped .compare-step-circle{background:#cbd5e1;opacity:.42}.dispatch-container .compare-step.is-loading .compare-step-circle{background:#fff;border:2px solid #6366f173;color:#0000}.dispatch-container .compare-step.is-no-data .compare-step-circle{background:repeating-linear-gradient(45deg,#e2e8f0 0 4px,#f1f5f9 4px 8px);color:#94a3b8}.dispatch-container .compare-step-spin{animation:compare-step-spin .7s linear infinite;border:2px solid #6366f12e;border-radius:50%;border-top-color:#6366f1;height:14px;width:14px}@keyframes compare-step-spin{to{transform:rotate(1turn)}}.dispatch-container .compare-step-tick{font-feature-settings:"tnum";color:#64748b;font-size:11px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.01em;line-height:1}.dispatch-container .compare-step-flag{background:#dc2626;border:1.5px solid #fff;border-radius:50%;box-shadow:0 2px 4px #dc262673;height:8px;position:absolute;right:-2px;top:-2px;width:8px}.dispatch-container .compare-progress-strip{align-items:center;display:flex;gap:8px}.dispatch-container .compare-legend{align-items:center;border-top:1px dashed #0f172a0f;display:flex;flex-wrap:wrap;gap:14px;padding-top:2px}.dispatch-container .compare-legend-item{align-items:center;color:#64748b;display:inline-flex;font-size:12px;font-weight:700;gap:7px;letter-spacing:.02em}.dispatch-container .compare-legend-swatch{border-radius:2px;flex-shrink:0;height:4px;width:22px}.dispatch-container .compare-legend-swatch.is-planned{background:repeating-linear-gradient(90deg,#6366f1 0 5px,#0000 5px 9px);height:3px}.dispatch-container .compare-legend-swatch.is-actual{background:linear-gradient(90deg,currentColor,currentColor);height:4px}.dispatch-container .compare-legend-swatch.is-step-color{border-radius:2px;height:4px}.dispatch-container .compare-legend-swatch.is-step-color.is-dashed{-webkit-mask-image:repeating-linear-gradient(90deg,#000 0 5px,#0000 5px 9px);mask-image:repeating-linear-gradient(90deg,#000 0 5px,#0000 5px 9px)}.dispatch-container .compare-legend-note{color:#94a3b8;font-size:11px;font-weight:700;letter-spacing:.04em;margin-left:auto;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .compare-legend-swatch.is-transit{background:repeating-linear-gradient(90deg,#94a3b8 0 3px,#0000 3px 6px);height:2px}.dispatch-container .compare-delta{animation:compare-delta-in .22s cubic-bezier(.4,0,.2,1);background:linear-gradient(180deg,#fff,#f8fafc);border-top:1px solid #e2e8f0;border-top:1px solid var(--border,#0f172a12);display:flex;flex-direction:column;flex-shrink:0;gap:10px;padding:12px 14px 14px}.dispatch-container .compare-delta.is-anomaly{background:linear-gradient(180deg,#fff,#fef2f2);border-top-color:#dc262640}@keyframes compare-delta-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .compare-delta-title{align-items:center;display:flex;gap:10px;min-width:0}.dispatch-container .compare-delta-step-badge{align-items:center;background:#6366f1;border-radius:50%;box-shadow:0 3px 10px #0f172a26,0 0 0 1px #ffffff80;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .compare-delta-step-badge svg{font-size:17px}.dispatch-container .compare-delta-title-text{flex:1 1;min-width:0}.dispatch-container .compare-delta-title-main{color:#0f172a;font-size:16px;font-weight:800;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-delta-title-sub{color:#94a3b8;font-size:13px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-delta-status{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.07em;padding:4px 11px;text-transform:uppercase}.dispatch-container .compare-delta-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(3,1fr)}.dispatch-container .compare-delta-cell{background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a14);border-radius:12px;display:flex;flex-direction:column;gap:4px;padding:11px 13px 10px;transition:transform .18s ease,box-shadow .18s ease}.dispatch-container .compare-delta-cell:hover{box-shadow:0 4px 12px #0f172a0f;transform:translateY(-1px)}.dispatch-container .compare-delta-cell.is-anomaly{background:linear-gradient(180deg,#fff,#fef2f2);border-color:#dc26266b;box-shadow:inset 0 0 0 1px #dc26262e}.dispatch-container .compare-delta-cell-label{color:#94a3b8;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.dispatch-container .compare-delta-cell-val{font-feature-settings:"tnum";color:#0f172a;font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;line-height:1.15}.dispatch-container .compare-delta-cell-val.is-over{color:#dc2626}.dispatch-container .compare-delta-cell-val.is-under{color:#16a34a}.dispatch-container .compare-delta-cell-unit{color:#94a3b8;font-size:13px;font-weight:700;margin-left:2px}.dispatch-container .compare-delta-cell-sub{color:#64748b;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-step-pin{align-items:center;background:#475569;background:var(--pin-color,#475569);border:3px solid #fff;border-radius:50%;box-shadow:0 4px 12px #00000052,0 0 0 1px #ffffff2e;color:#fff;cursor:pointer;display:flex;font-size:13px;font-weight:800;height:34px;justify-content:center;position:relative;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s ease;width:34px}.dispatch-container .compare-step-pin:hover{transform:scale(1.08);z-index:1200}.dispatch-container .compare-step-pin-num{line-height:1;position:relative;z-index:1}.dispatch-container .compare-step-pin.is-skipped{filter:grayscale(.6);opacity:.45}.dispatch-container .compare-step-pin.is-focused{animation:compare-pin-pulse 1.6s ease-in-out infinite;box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px #6366f1,0 0 18px 6px color-mix(in srgb,#6366f1 35%,#0000);box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px var(--pin-color,#6366f1),0 0 18px 6px color-mix(in srgb,var(--pin-color,#6366f1) 35%,#0000);transform:scale(1.22);z-index:1300}.dispatch-container .compare-step-pin.is-focused:hover{transform:scale(1.3)}.dispatch-container .compare-step-pin.is-focused:before{animation:compare-pin-halo 1.6s ease-out infinite;border:2px solid #6366f1;border:2px solid var(--pin-color,#6366f1);border-radius:50%;content:"";inset:-6px;opacity:.65;pointer-events:none;position:absolute}@keyframes compare-pin-pulse{0%,to{box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px #6366f1,0 0 18px 6px color-mix(in srgb,#6366f1 35%,#0000);box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px var(--pin-color,#6366f1),0 0 18px 6px color-mix(in srgb,var(--pin-color,#6366f1) 35%,#0000)}50%{box-shadow:0 10px 28px #0f172a80,0 0 0 3px #fff,0 0 0 6px #6366f1,0 0 28px 10px color-mix(in srgb,#6366f1 55%,#0000);box-shadow:0 10px 28px #0f172a80,0 0 0 3px #fff,0 0 0 6px var(--pin-color,#6366f1),0 0 28px 10px color-mix(in srgb,var(--pin-color,#6366f1) 55%,#0000)}}@keyframes compare-pin-halo{0%{inset:-2px;opacity:.7}to{inset:-16px;opacity:0}}.dispatch-container .compare-step-pin.is-anomaly{box-shadow:0 4px 14px #dc262659,0 0 0 1px #ffffff2e,0 0 0 3px #fff,0 0 0 5px #dc2626}.dispatch-container .compare-step-pin.is-anomaly.is-focused{animation:compare-pin-pulse-anomaly 1.4s ease-in-out infinite;box-shadow:0 8px 22px #dc262680,0 0 0 3px #fff,0 0 0 5px #dc2626,0 0 22px 8px #dc262673}@keyframes compare-pin-pulse-anomaly{0%,to{box-shadow:0 8px 22px #dc262680,0 0 0 3px #fff,0 0 0 5px #dc2626,0 0 22px 8px #dc262673}50%{box-shadow:0 10px 28px #dc2626a6,0 0 0 3px #fff,0 0 0 6px #dc2626,0 0 32px 12px #dc26268c}}.dispatch-container .compare-step-pin-check{background:#16a34a;border:1.5px solid #fff;border-radius:50%;bottom:-3px;box-shadow:0 2px 5px #0f172a57;height:14px;padding:1px;position:absolute;right:-3px;width:14px;z-index:2}.dispatch-container .compare-start-pin{align-items:center;background:#fff;border:3px solid #475569;border:3px solid var(--pin-color,#475569);border-radius:50%;box-shadow:0 5px 14px #0f172a52,0 0 0 1px #fff9;color:#475569;color:var(--pin-color,#475569);cursor:pointer;display:flex;height:40px;justify-content:center;transition:transform .18s ease,box-shadow .18s ease;width:40px}.dispatch-container .compare-start-pin:hover{box-shadow:0 7px 20px #0f172a66,0 0 0 1px #ffffffb3;transform:scale(1.1);z-index:1100}.dispatch-container .compare-start-pin svg{display:block;height:22px;width:22px}.dispatch-container .compare-tooltip{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#0f172af2;border:0;border-radius:12px;box-shadow:0 10px 30px #0f172a66,0 0 0 1px #ffffff0f;color:#f8fafc;font-family:inherit;padding:0;white-space:normal}.dispatch-container .compare-tooltip.leaflet-tooltip-top:before{border-top-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-bottom:before{border-bottom-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-left:before{border-left-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-right:before{border-right-color:#0f172af2}.dispatch-container .cmp-tip{max-width:260px;min-width:200px;padding:9px 12px 8px}.dispatch-container .cmp-tip-header{align-items:center;display:flex;gap:9px;min-width:0}.dispatch-container .cmp-tip-step{align-items:center;background:#6366f1;border-radius:50%;box-shadow:0 2px 6px #0000004d;color:#fff;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;height:24px;justify-content:center;width:24px}.dispatch-container .cmp-tip-step svg{font-size:14px}.dispatch-container .cmp-tip-title-stack{flex:1 1;min-width:0}.dispatch-container .cmp-tip-title{color:#f8fafc;font-size:12px;font-weight:800;letter-spacing:.01em;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-tip-sub{color:#cbd5e1;font-size:10px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-tip-tag{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:8px;font-weight:800;letter-spacing:.08em;padding:2px 7px;text-transform:uppercase}.dispatch-container .cmp-tip-anomaly{background:#dc262629;border:1px solid #dc262652;border-radius:8px;color:#fecaca;font-size:10px;font-weight:700;letter-spacing:.02em;margin-top:7px;padding:5px 8px}.dispatch-container .cmp-tip-action{border-top:1px solid #ffffff1a;color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.08em;margin-top:7px;padding-top:6px;text-align:center;text-transform:uppercase}.dispatch-container .compare-popup .leaflet-popup-content-wrapper{background:#fff;border-radius:14px;box-shadow:0 12px 32px #0f172a38,0 0 0 1px #0f172a0f;overflow:hidden;padding:0}.dispatch-container .compare-popup .leaflet-popup-content{margin:0;min-width:240px;width:auto!important}.dispatch-container .compare-popup .leaflet-popup-tip{background:#fff;box-shadow:0 6px 18px #0f172a2e}.dispatch-container .compare-popup .leaflet-popup-close-button{color:#94a3b8;font-size:18px;font-weight:700;padding:4px 6px;right:6px;top:6px}.dispatch-container .compare-popup .leaflet-popup-close-button:hover{color:#0f172a}.dispatch-container .cmp-pop{color:#0f172a;font-family:Inter,-apple-system,sans-serif;line-height:1.35}.dispatch-container .cmp-pop-head{align-items:center;background:linear-gradient(180deg,#f8fafc,#fff);border-bottom:1px solid #0f172a0f;display:flex;gap:10px;padding:12px 32px 12px 14px}.dispatch-container .cmp-pop-pin{align-items:center;border:2.5px solid #fff;border-radius:50%;box-shadow:0 3px 10px #0003;color:#fff;display:flex;flex-shrink:0;font-size:13px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cmp-pop-titles{flex:1 1;min-width:0}.dispatch-container .cmp-pop-title{color:#0f172a;font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-pop-sub{color:#64748b;font-size:9.5px;font-weight:700;letter-spacing:.05em;margin-top:2px;text-transform:uppercase}.dispatch-container .cmp-pop-tag{background:#e0e7ff;border-radius:999px;color:#4338ca;flex-shrink:0;font-size:9px;font-weight:800;letter-spacing:.06em;padding:3px 8px;text-transform:uppercase;white-space:nowrap}.dispatch-container .cmp-pop-tag-start{background:#ecfeff;color:#0e7490}.dispatch-container .cmp-pop-rows{display:flex;flex-direction:column;padding:8px 14px 12px}.dispatch-container .cmp-pop-row{align-items:center;border-bottom:1px dashed #0f172a12;display:flex;font-size:12px;gap:12px;justify-content:space-between;padding:6px 0}.dispatch-container .cmp-pop-row:last-child{border-bottom:0}.dispatch-container .cmp-pop-k{color:#64748b;font-weight:600;white-space:nowrap}.dispatch-container .cmp-pop-v{font-feature-settings:"tnum";color:#0f172a;font-variant-numeric:tabular-nums;font-weight:700;text-align:right}.dispatch-container .cmp-pop-v.is-loss{color:#dc2626}.dispatch-container .cmp-pop-v.is-profit{color:#16a34a}.dispatch-container .cmp-pop-coord{color:#475569;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;font-weight:600}.dispatch-container .leaflet-container{background:#f1f5f9!important}.dispatch-container #ov-tl{left:16px;position:absolute;top:16px;z-index:1000}.dispatch-container .ov-card{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffe6;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:16px;box-shadow:0 10px 25px -5px #00000014;box-shadow:var(--shadow-lg);padding:16px 20px}.dispatch-container .ov-stats{display:flex;gap:24px}.dispatch-container .osv{font-size:24px;font-weight:800}.dispatch-container .osv.g{color:#22c55e;color:var(--success)}.dispatch-container .osl{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:700;margin-top:2px;text-transform:uppercase}.dispatch-container #ov-tr{display:flex;flex-direction:column;gap:8px;position:absolute;right:16px;top:16px;width:200px;z-index:1000}.dispatch-container #body.compare-mode #ov-tr{display:none!important}.dispatch-container #ov-br{bottom:20px;position:absolute;right:80px;z-index:1000}.dispatch-container .rchip{align-items:center;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffe6;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;box-shadow:0 4px 12px #0000000d;box-shadow:var(--shadow);cursor:pointer;display:flex;font-size:12px;font-weight:600;gap:8px;padding:8px 12px;transition:all .2s}.dispatch-container .rchip.active{background:#fff;border-color:#3b82f6;border-color:var(--accent);box-shadow:0 4px 12px #3b82f626}.dispatch-container .rchip-dot{border-radius:50%;height:8px;width:8px}.dispatch-container .rchip-n{font-feature-settings:"tnum","tnum";color:#3b82f6;color:var(--accent);font-variant-numeric:tabular-nums;font-weight:800;margin-left:auto;white-space:nowrap}.dispatch-container .rchip-n.is-done{color:#16a34a}.dispatch-container .kitchen-mark{align-items:center;background:#f59e0b;background:var(--kitchen);border:3px solid #fff;border-radius:50%;box-shadow:0 0 20px #f59e0bcc,0 0 40px #f59e0b66;color:#fff;display:flex;font-size:18px;font-weight:900;height:46px;justify-content:center;width:46px}.dispatch-container .kitchen-mark.is-focused{animation:kitchen-mark-pulse 1.8s ease-in-out infinite;border-width:4px;font-size:22px;height:56px;width:56px}@keyframes kitchen-mark-pulse{0%,to{box-shadow:0 0 20px #f59e0be6,0 0 40px #f59e0b80,0 0 0 0 #f59e0b8c}50%{box-shadow:0 0 30px #f59e0b,0 0 60px #f59e0bb3,0 0 0 18px #f59e0b00}}.dispatch-container .leaflet-popup-content-wrapper{background:#fff;border-radius:12px;box-shadow:0 10px 25px -5px #00000026;color:#1e293b;padding:0}.dispatch-container .leaflet-popup-tip-container{bottom:-10px;height:10px;left:50%;margin-left:-10px;overflow:hidden;position:absolute;width:20px}.dispatch-container .leaflet-popup-tip{background:#fff;box-shadow:none;height:14px;margin:-10px auto 0;padding:0;transform:rotate(45deg);width:14px}.dispatch-container .pu-id{align-items:center;background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;color:#64748b;display:flex;font-size:10px;font-weight:800;gap:6px;letter-spacing:.08em;padding:10px 14px}.dispatch-container .pu-live-dot{animation:pu-pulse 1.2s ease-in-out infinite;background:#22c55e;border-radius:50%;box-shadow:0 0 0 2px #22c55e33;height:6px;width:6px}@keyframes pu-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.2)}}.dispatch-container .pu-rider-wrap{align-items:center;display:flex;gap:8px;padding:14px 14px 8px}.dispatch-container .pu-rider-indicator{border-radius:50%;box-shadow:0 0 6px #00000026;flex-shrink:0;height:8px;width:8px}.dispatch-container .pu-rider-name{color:#0f172a;font-size:14.5px;font-weight:800;letter-spacing:-.01em}.dispatch-container .pu-body-content{display:flex;flex-direction:column;gap:6px;padding:0 14px 12px}.dispatch-container .pu-row{align-items:center;color:#64748b;display:flex;font-size:12px;justify-content:space-between;padding:2px 0}.dispatch-container .pu-row span:first-child{color:#64748b;flex-shrink:0;font-size:11px;font-weight:600;letter-spacing:.02em;margin-right:12px;text-transform:uppercase}.dispatch-container .pu-row span:last-child{color:#334155;font-weight:600;max-width:70%;overflow-wrap:anywhere;text-align:right;word-break:break-word}.dispatch-container .pu-status-tag{align-items:center;border-radius:6px;display:inline-flex;font-size:10.5px;font-weight:800;letter-spacing:.02em;padding:2px 8px;text-transform:uppercase}.dispatch-container .pu-status-tag.is-idle{background:#f1f5f9;color:#475569}.dispatch-container .pu-status-tag.is-active{background:#e0f2fe;color:#0284c7}.dispatch-container .pu-status-tag.is-delivered{background:#dcfce7;color:#16a34a}.dispatch-container .pu-status-tag.is-generic{background:#f1f5f9;color:#475569}.dispatch-container .pu-order-tag{background:#f5f3ff;border-radius:4px;color:#4f46e5!important;font-family:JetBrains Mono,monospace;font-size:11px;font-weight:700!important;padding:1px 6px}.dispatch-container .pu-phone-tag{color:#334155;font-family:JetBrains Mono,monospace;font-size:11.5px}.dispatch-container .pu-coord-tag{color:#64748b!important;font-family:JetBrains Mono,monospace;font-size:10.5px}.dispatch-container .live-rider-popup .leaflet-popup-content-wrapper{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#fffffff2;border:1px solid #ffffffd9;border-radius:16px;box-shadow:0 20px 48px #0f172a38;max-width:280px;min-width:260px;overflow:hidden;padding:0}.dispatch-container .live-rider-popup .leaflet-popup-content{margin:0;min-width:260px}.dispatch-container .live-rider-popup .pu-hdr-live{align-items:center;background:#f8fafc;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;padding:10px 14px}.dispatch-container .live-rider-popup .pu-hdr-left{align-items:center;display:flex;gap:8px}.dispatch-container .live-rider-popup .pu-live-indicator{align-items:center;display:inline-flex;justify-content:center;position:relative}.dispatch-container .live-rider-popup .pu-live-dot{background-color:#dc2626;background-color:var(--pulse-color,#dc2626);border-radius:50%;height:7px;width:7px;z-index:2}.dispatch-container .live-rider-popup .pu-live-indicator:after{animation:pu-pulse-ring 1.8s cubic-bezier(.4,0,.2,1) infinite;border:2px solid #dc2626;border:2px solid var(--pulse-color,#dc2626);border-radius:50%;content:"";height:15px;opacity:0;position:absolute;width:15px;z-index:1}@keyframes pu-pulse-ring{0%{opacity:.8;transform:scale(.5)}to{opacity:0;transform:scale(1.6)}}.dispatch-container .live-rider-popup .pu-hdr-title{color:#64748b;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-status-badge{border-radius:999px;box-shadow:0 1px 3px #0000000d;font-size:9px;font-weight:800;letter-spacing:.04em;padding:2px 8px;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-status-badge.active{background:#e0f2fe;color:#0369a1}.dispatch-container .live-rider-popup .pu-status-badge.idle{background:#f1f5f9;color:#475569}.dispatch-container .live-rider-popup .pu-rider-profile{align-items:center;background:linear-gradient(180deg,#f8fafc80,#fff0);display:flex;gap:12px;padding:14px 16px 10px}.dispatch-container .live-rider-popup .pu-avatar{align-items:center;border-radius:10px;box-shadow:inset 0 1px 2px #fff3;display:flex;font-size:20px;height:38px;justify-content:center;width:38px}.dispatch-container .live-rider-popup .pu-rider-info-text{display:flex;flex-direction:column;gap:2px}.dispatch-container .live-rider-popup .pu-rider-name{color:#0f172a;font-size:15px;font-weight:800;letter-spacing:-.01em;line-height:1.2}.dispatch-container .live-rider-popup .pu-rider-name-row{align-items:center;display:flex;flex-wrap:wrap;gap:8px}.dispatch-container .live-rider-popup .pu-rider-meta{color:#94a3b8;font-size:10px;font-weight:600;letter-spacing:.02em}.dispatch-container .live-rider-popup .pu-body-content{display:flex;flex-direction:column;gap:8px;padding:4px 16px 16px}.dispatch-container .live-rider-popup .pu-info-row{align-items:center;border-bottom:1px dashed #f1f5f9;display:flex;justify-content:space-between;padding:4px 0}.dispatch-container .live-rider-popup .pu-info-row:last-child{border-bottom:none;padding-bottom:0}.dispatch-container .live-rider-popup .pu-info-label{color:#94a3b8;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-info-value{color:#334155;font-size:12px;font-weight:700;text-align:right}.dispatch-container .live-rider-popup .pu-order-badge{background:#f5f3ff;border:1px solid #4f46e51f;border-radius:6px;color:#4f46e5;font-family:JetBrains Mono,monospace;font-size:11px;font-weight:800;padding:2px 8px}.dispatch-container .live-rider-popup .pu-phone-link{color:#0284c7;font-family:JetBrains Mono,monospace;font-weight:700;text-decoration:none;transition:color .15s ease}.dispatch-container .live-rider-popup .pu-phone-link:hover{color:#0369a1;text-decoration:underline}.dispatch-container .live-rider-popup .pu-time-stamp{align-items:center;color:#475569;display:inline-flex;gap:4px}.dispatch-container .live-rider-popup .pu-time-stamp .inline-icon{color:#64748b;font-size:13px}.dispatch-container .live-rider-popup .pu-coordinates{background:#f8fafc;border:1px solid #e2e8f0;border-radius:4px;color:#64748b;font-family:JetBrains Mono,monospace;font-size:11px;padding:2px 6px}.dispatch-container .pu-section-label{border-bottom:1px solid #7b1fa22e;color:#7b1fa2;font-size:10px;font-weight:700;letter-spacing:.06em;margin:10px 14px 4px;padding-bottom:4px;text-transform:uppercase}.dispatch-container .pu-timeline{display:flex;flex-direction:column;gap:5px;padding:4px 14px 4px 16px;position:relative}.dispatch-container .pu-timeline:before{background:#7b1fa22e;bottom:8px;content:"";left:19px;position:absolute;top:8px;width:1px}.dispatch-container .pu-tl-row{align-items:center;display:flex;font-size:11px;gap:8px;position:relative;z-index:1}.dispatch-container .pu-tl-dot{background:#fff;border:2px solid #7b1fa273;border-radius:50%;box-sizing:border-box;flex-shrink:0;height:8px;width:8px}.dispatch-container .pu-tl-row.delivered .pu-tl-dot{background:#16a34a;border-color:#16a34a;box-shadow:0 0 0 3px #16a34a2e}.dispatch-container .pu-tl-label{color:#64748b;flex:1 1;font-weight:500}.dispatch-container .pu-tl-row.delivered .pu-tl-label{color:#16a34a;font-weight:700}.dispatch-container .pu-tl-time{font-feature-settings:"tnum","tnum";color:#1e293b;font-variant-numeric:tabular-nums;font-weight:700}.dispatch-container .dispatch-popup .leaflet-popup-content{margin:0;width:auto!important}.dispatch-container .dispatch-popup .leaflet-popup-content-wrapper{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);border-radius:14px;box-shadow:0 18px 40px #0f172a2e;min-width:580px;overflow:hidden;padding:0}.dispatch-container .dispatch-popup .leaflet-popup-tip{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1)}@keyframes dispatch-popup-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .dispatch-popup .leaflet-popup-content{min-width:580px}.dispatch-container .dispatch-popup-center{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);display:flex;left:50%;max-height:calc(100vh - 32px);max-width:calc(100vw - 32px);pointer-events:auto;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:1700}.dispatch-container .dispatch-popup-center .dispatch-popup-card{background:#fff;border-radius:14px;box-shadow:0 24px 60px #0f172a47;max-height:calc(100vh - 32px);max-width:680px;min-width:min(580px,calc(100vw - 32px));overflow-x:hidden;overflow-y:auto;position:relative}.dispatch-container .dispatch-popup-center-close{align-items:center;background:#fff3;border:0;border-radius:50%;color:#fff;cursor:pointer;display:flex;font-size:20px;font-weight:700;height:26px;justify-content:center;line-height:1;padding:0;position:absolute;right:8px;top:8px;transition:background .15s ease;width:26px;z-index:2}.dispatch-container .dispatch-popup-center-close:hover{background:#ffffff59}.dispatch-container .dispatch-popup-center .dispatch-popup .pu-header{padding-right:44px}.dispatch-container .dispatch-popup .pu-header{background:linear-gradient(135deg,#7b1fa2,#9c27b0 50%,#ab47bc);border-radius:12px 12px 0 0;color:#fff;padding:14px 16px 12px}.dispatch-container .dispatch-popup .pu-header-top{align-items:center;display:flex;gap:10px;justify-content:space-between;margin-bottom:8px}.dispatch-container .dispatch-popup .pu-id{background:#0000;border:0;border-radius:0;color:#fffffff2;font-size:12px;font-weight:800;letter-spacing:.06em;overflow:hidden;padding:0;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .dispatch-popup .pu-status-chip{border-radius:999px;box-shadow:0 2px 6px #0000002e;flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.06em;padding:4px 10px;text-transform:uppercase;white-space:nowrap}.dispatch-container .dispatch-popup .pu-rider{align-items:center;color:#fff!important;display:flex;font-size:16px;font-weight:800;gap:6px;letter-spacing:-.01em;padding:0}.dispatch-container .dispatch-popup .pu-rider svg{font-size:18px;opacity:.9}.dispatch-container .dispatch-popup .pu-rider span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-customer{align-items:center;color:#ffffffeb;display:flex;font-size:13px;font-weight:600;gap:6px;letter-spacing:-.005em;margin-top:4px;max-width:100%;padding:0}.dispatch-container .dispatch-popup .pu-customer svg{flex:0 0 auto;font-size:14px;opacity:.85}.dispatch-container .dispatch-popup .pu-customer span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-delivery-id{color:#ffffffd9;font-size:11px;font-weight:600;letter-spacing:.04em;margin-top:6px}.dispatch-container .dispatch-popup .pu-body{padding:4px 16px 12px}.dispatch-container .dispatch-popup .pu-section{margin-top:8px}.dispatch-container .dispatch-popup .pu-section-label{border-bottom:1px solid #7b1fa22e;color:#7b1fa2;font-size:10px;font-weight:800;letter-spacing:.08em;margin:0 0 6px;padding-bottom:4px;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-timeline{grid-column-gap:14px;grid-row-gap:4px;column-gap:14px;display:grid;grid-template-columns:1fr 1fr;padding:2px 0;position:relative;row-gap:4px}.dispatch-container .dispatch-popup .pu-timeline:before{display:none}.dispatch-container .dispatch-popup .pu-details-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .dispatch-popup .pu-detail{align-items:flex-start;background:#7b1fa20d;border:1px solid #7b1fa21f;border-radius:10px;display:flex;gap:8px;min-width:0;padding:8px 10px}.dispatch-container .dispatch-popup .pu-detail-icon{align-items:center;background:#7b1fa21f;border-radius:7px;color:#7b1fa2;display:flex;flex-shrink:0;font-size:14px;height:26px;justify-content:center;width:26px}.dispatch-container .dispatch-popup .pu-detail-icon svg{font-size:15px}.dispatch-container .dispatch-popup .pu-detail-body{flex:1 1;min-width:0}.dispatch-container .dispatch-popup .pu-detail-label{color:#64748b;font-size:9px;font-weight:700;letter-spacing:.06em;margin-bottom:2px;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-detail-value{color:#1e293b;font-size:12px;font-weight:700;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-distance-row{border-top:1px dashed #7b1fa22e;display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;padding-top:8px}.dispatch-container .dispatch-popup .pu-distance-chip{align-items:center;background:linear-gradient(135deg,#7b1fa214,#9c27b00f);border:1px solid #7b1fa233;border-radius:999px;display:inline-flex;font-size:11px;font-weight:600;gap:5px;padding:5px 10px}.dispatch-container .dispatch-popup .pu-distance-icon{color:#7b1fa2;display:inline-flex}.dispatch-container .dispatch-popup .pu-distance-icon svg{font-size:14px}.dispatch-container .dispatch-popup .pu-distance-label{color:#64748b;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-distance-value{font-feature-settings:"tnum";color:#1e293b;font-variant-numeric:tabular-nums;font-weight:800}.dispatch-container .kitchen-popup .kp-header{background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;color:#64748b;font-size:10px;font-weight:800;letter-spacing:.1em;padding:8px 14px}.dispatch-container .kitchen-popup .kp-name{color:#f59e0b;color:var(--kitchen);font-size:16px;font-weight:800;padding:14px 14px 4px}.dispatch-container .kitchen-popup .kp-stat{display:flex;justify-content:space-between;padding:8px 14px 16px}.dispatch-container .kitchen-popup .kp-stat-lbl{color:#64748b;font-size:12px}.dispatch-container .kitchen-popup .kp-stat-val{color:#1e293b;font-size:16px;font-weight:800}.dispatch-container .empty-slot{align-items:center;display:flex;flex-direction:column;gap:10px;justify-content:center;padding:48px 24px;text-align:center}.dispatch-container .empty-slot-icon{color:#e2e8f0;color:var(--border);font-size:36px;line-height:1}.dispatch-container .empty-slot-title{color:#64748b;color:var(--text-muted);font-size:14px;font-weight:700}.dispatch-container .empty-slot-sub{color:#e2e8f0;color:var(--border);font-size:12px;font-weight:500;line-height:1.5;max-width:220px}.dispatch-container #desc{background:#fff;background:var(--bg);border-top:1px solid #e2e8f0;border-top:1px solid var(--border);color:#64748b;color:var(--text-muted);font-size:12px;font-weight:500;padding:16px 20px}@media (max-width:1280px){.dispatch-container #sidebar{flex-basis:360px;width:360px}.dispatch-container .sidebar-toggle-tab{left:360px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}}@media (max-width:1180px){.dispatch-container #sidebar{flex-basis:320px;width:320px}.dispatch-container .sidebar-toggle-tab{left:320px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .rd-rider-name{font-size:24px}.dispatch-container .rd-stat-value,.dispatch-container .sb-tile-value{font-size:20px}.dispatch-container #hdr{padding:0 16px}.dispatch-container #strat-row{gap:6px;padding:0 16px}.dispatch-container #batch-row{padding:8px 16px}.dispatch-container .sbt{font-size:12px;gap:6px;padding:7px 11px}}@media (max-width:1080px){.dispatch-container #sidebar{flex-basis:290px;width:290px}.dispatch-container .sidebar-toggle-tab{left:290px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .logo-city,.dispatch-container .logo-city-wrap{display:none}.dispatch-container .logo-name{font-size:16px}.dispatch-container #clock{font-size:12px;padding:5px 10px}.dispatch-container .hdr-stats{gap:6px;margin-right:8px}.dispatch-container .strat-stat{font-size:11px;gap:4px;padding:5px 9px}.dispatch-container .strat-stat-label{display:none}.dispatch-container .live-status{font-size:11px;padding:5px 8px}.dispatch-container .live-status-sub{display:none}.dispatch-container .sbt{font-size:12px;gap:5px;padding:7px 10px}.dispatch-container .sbt .sbt-icon{font-size:16px;height:16px;width:16px}.dispatch-container .batch-btn{font-size:11px;gap:4px;padding:5px 9px}.dispatch-container .batch-btn-count{font-size:9px;height:16px;min-width:18px;padding:0 4px}.dispatch-container .sb-header{padding:14px 14px 12px}.dispatch-container .sb-tile-value{font-size:18px}.dispatch-container .sb-tile{gap:8px;padding:8px 10px}.dispatch-container .sb-tile-icon{font-size:16px;height:28px;width:28px}.dispatch-container .rcard{padding:12px}.dispatch-container .rcard-name{font-size:13px}.dispatch-container .rcard-zone{font-size:11px}.dispatch-container .step-wrap{padding:12px}.dispatch-container #route-detail{padding:16px}.dispatch-container .rd-rider-name{font-size:20px}.dispatch-container .rd-stat-value{font-size:17px}.dispatch-container .rd-stat{padding:12px 8px 10px}.dispatch-container #ov-tr{width:160px}.dispatch-container .rchip{font-size:11px;padding:6px 8px}}@media (max-width:960px){.dispatch-container #sidebar{flex-basis:250px;width:250px}.dispatch-container .sidebar-toggle-tab{left:250px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container #strat-row{-webkit-overflow-scrolling:touch;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.dispatch-container #strat-row::-webkit-scrollbar{display:none}.dispatch-container .sbt{flex-shrink:0;font-size:11px;padding:7px 9px}.dispatch-container .zone-stat-label{display:none}.dispatch-container .zone-stat-pill{gap:3px;padding:3px 7px}.dispatch-container .zone-stat-value{font-size:12px}.dispatch-container .rd-stats-grid{gap:6px}.dispatch-container .rd-stat{padding:10px 6px 8px}.dispatch-container .rd-stat-value{font-size:15px}.dispatch-container .rd-stat-label{font-size:9px}.dispatch-container .rd-stat-icon{font-size:15px}.dispatch-container #ov-tr{display:none}.dispatch-container .zone-card-name{font-size:13px}.dispatch-container .zone-card-sub{font-size:10px}.dispatch-container #riders-panel{padding:12px}.dispatch-container .trip-header{padding:10px 12px}}.dispatch-container .rider-info-mode{background:#fff;background:var(--bg);display:flex;flex:1 1;min-height:0;overflow:hidden}.dispatch-container .ri-sidebar{background:#f8fafc;background:var(--bg-sub,#f8fafc);border-right:1px solid #e2e8f0;border-right:1px solid var(--border,#0f172a14);display:flex;flex-direction:column;flex-shrink:0;min-width:280px;overflow:hidden;width:320px}.dispatch-container .ri-sb-head{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);padding:16px 18px 12px}.dispatch-container .ri-sb-title{color:#1e293b;font-size:20px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-sb-sub{color:#64748b;font-size:13px;font-weight:600;margin-top:4px}.dispatch-container .ri-main{background:#fff;flex:1 1;min-width:0;overflow-y:auto;padding:24px 28px}.dispatch-container .ri-main::-webkit-scrollbar{width:6px}.dispatch-container .ri-main::-webkit-scrollbar-thumb{background:#7b1fa240;border-radius:999px}.dispatch-container .ri-placeholder{align-items:center;color:#64748b;display:flex;flex-direction:column;height:100%;justify-content:center;padding:60px 20px;text-align:center}.dispatch-container .ri-placeholder-icon{align-items:center;background:#7b1fa214;border-radius:16px;color:#7b1fa2;display:flex;font-size:32px;height:64px;justify-content:center;margin-bottom:16px;width:64px}.dispatch-container .ri-placeholder-icon svg{font-size:36px}.dispatch-container .ri-placeholder-title{color:#1e293b;font-size:16px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-placeholder-sub{font-size:12px;font-weight:500;line-height:1.5;margin-top:6px;max-width:320px}.dispatch-container .ri-search{padding:12px 14px 4px;position:relative}.dispatch-container .ri-search-icon{color:#94a3b8;font-size:18px;left:26px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.dispatch-container .ri-search-input{background:#f8fafc;border:1px solid #7b1fa22e;border-radius:10px;color:#1e293b;font-family:inherit;font-size:13px;font-weight:500;outline:none;padding:10px 12px 10px 38px;transition:border-color .15s ease,background .15s ease;width:100%}.dispatch-container .ri-search-input:focus{background:#fff;border-color:#7b1fa2}.dispatch-container .ri-rider-list{display:flex;flex:1 1;flex-direction:column;gap:6px;min-height:0;overflow-y:auto;padding:8px 14px 16px}.dispatch-container .ri-rider-list::-webkit-scrollbar{width:6px}.dispatch-container .ri-rider-list::-webkit-scrollbar-thumb{background:#7b1fa240;border-radius:999px}.dispatch-container .ri-rider-item{align-items:center;background:#fff;border:1px solid #7b1fa21f;border-radius:10px;cursor:pointer;display:flex;font-family:inherit;gap:12px;padding:12px 14px;text-align:left;transition:border-color .15s ease,background .15s ease,transform .15s ease;width:100%}.dispatch-container .ri-rider-item:hover{background:#7b1fa20a;border-color:#7b1fa266;transform:translateX(2px)}.dispatch-container .ri-rider-item.active{background:linear-gradient(180deg,#fbf3ff,#f0e0fa);border-color:#7b1fa2;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .ri-rider-item.active .ri-rider-name{color:#7b1fa2}.dispatch-container .ri-rider-item.active .ri-rider-arrow{opacity:1;transform:translateX(2px)}.dispatch-container .ri-rider-dot{border-radius:50%;box-shadow:0 0 0 2px #fff,0 0 0 3px #0f172a14;flex-shrink:0;height:14px;width:14px}.dispatch-container .ri-rider-info-block{display:flex;flex:1 1;flex-direction:column;gap:3px;min-width:0}.dispatch-container .ri-rider-name{color:#1e293b;font-size:15px;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .ri-rider-meta{color:#64748b;font-size:13px;font-weight:600}.dispatch-container .ri-rider-arrow{color:#7b1fa2;font-size:18px;font-weight:800;opacity:.4;transition:opacity .15s ease,transform .15s ease}.dispatch-container .ri-rider-item:hover .ri-rider-arrow{opacity:1;transform:translateX(2px)}.dispatch-container .ri-empty{color:#64748b;font-size:12px;padding:32px 16px;text-align:center}.dispatch-container .ri-error,.dispatch-container .ri-loading{color:#64748b;font-size:13px;padding:32px 16px;text-align:center}.dispatch-container .ri-error{color:#dc2626}.dispatch-container .ri-snap-head{border-bottom:1px dashed #7b1fa22e;margin-bottom:20px;padding:6px 0 18px}.dispatch-container .ri-snap-name{color:#1e293b;font-size:18px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-snap-meta{align-items:center;color:#64748b;display:flex;font-size:12px;font-weight:600;gap:8px;margin-top:4px}.dispatch-container .ri-status{background:#64748b2e;border-radius:999px;color:#475569;font-size:10px;font-weight:800;letter-spacing:.06em;padding:2px 10px;text-transform:uppercase}.dispatch-container .ri-status-idle{background:#f59e0b2e;color:#b45309}.dispatch-container .ri-status-active,.dispatch-container .ri-status-ongoing,.dispatch-container .ri-status-online{background:#22c55e2e;color:#15803d}.dispatch-container .ri-status-offline{background:#ef44442e;color:#b91c1c}.dispatch-container .ri-live{align-items:center;background:#22c55e1f;border-radius:999px;color:#15803d;display:inline-flex;font-size:10px;font-weight:800;gap:5px;letter-spacing:.06em;padding:2px 8px 2px 6px;text-transform:uppercase}.dispatch-container .ri-live.is-refetching{background:#7b1fa21f;color:#7b1fa2}.dispatch-container .ri-live-dot{animation:ri-live-pulse 1.6s ease-in-out infinite;background:#16a34a;border-radius:50%;box-shadow:0 0 0 0 #22c55e8c;height:6px;width:6px}.dispatch-container .ri-live.is-refetching .ri-live-dot{background:#7b1fa2;box-shadow:0 0 0 0 #7b1fa28c}@keyframes ri-live-pulse{0%,to{box-shadow:0 0 0 0 #22c55e8c}50%{box-shadow:0 0 0 5px #22c55e00}}.dispatch-container .ri-snap-time{font-feature-settings:"tnum";align-items:center;color:#64748b;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:500;gap:4px;margin-top:6px}.dispatch-container .ri-snap-time svg{font-size:13px}.dispatch-container .ri-snap-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .ri-stat{align-items:center;background:#7b1fa20d;border:1px solid #7b1fa21f;border-radius:10px;display:flex;gap:10px;padding:10px 12px}.dispatch-container .ri-stat-warn{background:#ef44440f;border-color:#ef444438}.dispatch-container .ri-stat-icon{align-items:center;background:#7b1fa21f;border-radius:9px;color:#7b1fa2;display:flex;flex-shrink:0;font-size:16px;height:32px;justify-content:center;width:32px}.dispatch-container .ri-stat-warn .ri-stat-icon{background:#ef444429;color:#b91c1c}.dispatch-container .ri-stat-icon svg{font-size:18px}.dispatch-container .ri-stat-body{flex:1 1;min-width:0}.dispatch-container .ri-stat-label{color:#64748b;font-size:10px;font-weight:700;letter-spacing:.05em;margin-bottom:2px;text-transform:uppercase}.dispatch-container .ri-stat-value{align-items:center;color:#1e293b;display:flex;font-size:13px;font-weight:700;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .ri-stat-tag{background:#22c55e2e;border-radius:999px;color:#15803d;font-size:9px;font-weight:800;letter-spacing:.04em;padding:2px 6px;text-transform:uppercase}.dispatch-container .ri-map-section{margin-top:14px}.dispatch-container .ri-coords-label{font-feature-settings:"tnum";align-items:center;background:linear-gradient(180deg,#fff,#fbf5ff);border:1px solid #7b1fa22e;border-bottom:0;border-radius:10px 10px 0 0;box-sizing:border-box;color:#1e293b;display:inline-flex;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;gap:4px;padding:8px 14px;width:100%}.dispatch-container .ri-coords-label svg{color:#7b1fa2;font-size:16px}.dispatch-container .ri-map{border:1px solid #7b1fa22e;border-radius:0 0 10px 10px;height:260px;overflow:hidden;position:relative;width:100%;z-index:0}.dispatch-container .ri-map .leaflet-container{font-family:inherit;height:100%;width:100%}.dispatch-container .ri-map .leaflet-tooltip.ri-area-banner{background:#7b1fa2;border:0;border-radius:8px;box-shadow:0 4px 10px #0f172a40;color:#fff;font-size:11px;font-weight:700;letter-spacing:.02em;padding:4px 10px;white-space:nowrap}.dispatch-container .ri-map .leaflet-tooltip.ri-area-banner:before{border-top-color:#7b1fa2}@media (max-width:600px){.dispatch-container .rider-info-mode{flex-direction:column}.dispatch-container .ri-sidebar{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);border-right:0;max-height:40vh;min-width:0;width:100%}.dispatch-container .ri-main{padding:16px}.dispatch-container .ri-snap-grid{grid-template-columns:1fr}}@media (max-width:1366px){.dispatch-container #hdr{height:48px;padding:0 16px}.dispatch-container .logo-name{font-size:15px}.dispatch-container .logo-badge{border-radius:6px;font-size:13px;height:28px;width:28px}.dispatch-container .logo{gap:8px}.dispatch-container #clock{font-size:11px;padding:4px 10px}.dispatch-container .hdr-stats{gap:8px;margin-right:8px}.dispatch-container .strat-stat{font-size:11px;gap:4px;padding:4px 8px}.dispatch-container .strat-stat-label{display:none}.dispatch-container .live-status{font-size:11px;padding:4px 8px}.dispatch-container .date-chip-label,.dispatch-container .live-status-sub{display:none}.dispatch-container .date-chip-main{gap:8px;padding:6px 10px}.dispatch-container .date-chip-icon{font-size:13px;height:24px;width:24px}.dispatch-container .date-chip-value{font-size:12px}.dispatch-container .date-chip-nav{font-size:16px;width:28px}.dispatch-container #strat-row{gap:8px;height:48px;padding:0 16px}.dispatch-container .sbt{border:1px solid #0f172a14;border-radius:8px;font-size:12px;gap:6px;padding:6px 12px}.dispatch-container .sbt .sbt-icon{font-size:16px;height:16px;width:16px}.dispatch-container #batch-row{gap:6px;padding:6px 16px}.dispatch-container .batch-label{font-size:11px}.dispatch-container .batch-btn{font-size:11px;padding:4px 8px}.dispatch-container #sidebar{flex-basis:320px;width:320px}.dispatch-container .sidebar-toggle-tab{left:320px}.dispatch-container #body.compare-mode #sidebar{flex-basis:250px;width:250px}.dispatch-container #body.compare-mode .sidebar-toggle-tab{left:250px}.dispatch-container #body.compare-mode .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .sb-header{padding:10px 12px}.dispatch-container .sb-tile{gap:6px;padding:6px 8px}.dispatch-container .sb-tile-value{font-size:16px}.dispatch-container .rcard{padding:10px}.dispatch-container .rcard-name{font-size:12px}.dispatch-container .rcard-zone{font-size:10px}.dispatch-container .step-wrap{padding:10px}.dispatch-container #route-detail{padding:12px}.dispatch-container .rd-rider-name{font-size:18px}.dispatch-container .rd-stats-grid{gap:4px}.dispatch-container .rd-stat{padding:8px 4px 6px}.dispatch-container .rd-stat-value{font-size:14px}.dispatch-container .rd-stat-label{font-size:9px}.dispatch-container .compare-header-v2{gap:6px;padding:8px 12px 6px}.dispatch-container .compare-header-row .compare-title{font-size:13px;gap:8px}.dispatch-container .compare-title-dot{height:8px;width:8px}.dispatch-container .compare-title-badge{font-size:9px;padding:2px 6px}.dispatch-container .compare-overall-btn,.dispatch-container .compare-sync-toggle{font-size:10px;gap:4px;padding:4px 8px}.dispatch-container .compare-overall-btn svg,.dispatch-container .compare-sync-toggle svg{font-size:12px}.dispatch-container .compare-timeline-wrap{gap:4px}.dispatch-container .compare-timeline-container{border-radius:8px;gap:12px;padding:12px}.dispatch-container .compare-timeline-labels{border-right-width:1px;gap:12px;padding-right:10px}.dispatch-container .compare-timeline-label{font-size:9px;height:24px}.dispatch-container .compare-timeline-scrollable{-ms-overflow-style:none;display:flex;flex:1 1;flex-direction:column;gap:12px;overflow-x:auto;scrollbar-width:none}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar{height:4px}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-track{background:#0000}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-thumb{background:#6366f140;border-radius:999px}.dispatch-container .compare-timeline-scrollable:hover::-webkit-scrollbar-thumb{background:#6366f180}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:14px}.dispatch-container .compare-step{gap:4px}.dispatch-container .compare-step-circle{box-shadow:0 1px 4px #0f172a1a,0 0 0 1px #fff9;font-size:10px;height:24px;width:24px}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px #6366f1;box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px var(--step-color,#6366f1);transform:scale(1.1)}.dispatch-container .compare-step-spacer{margin-bottom:14px;width:10px}.dispatch-container .compare-step-tick{font-size:9px}.dispatch-container .compare-step-flag{border-width:1px;height:8px;right:-3px;top:-3px;width:8px}.dispatch-container .compare-progress-strip{margin-top:2px}.dispatch-container .compare-progress-text{font-size:9px}.dispatch-container .compare-legend{gap:8px;margin-top:0;padding-top:2px}.dispatch-container .compare-legend-item{font-size:9px}.dispatch-container .compare-legend-swatch{height:10px;width:10px}.dispatch-container .compare-legend-note{display:none}.dispatch-container .compare-delta{gap:6px;padding:8px 12px}.dispatch-container .compare-delta-title{gap:8px;margin-bottom:4px}.dispatch-container .compare-delta-step-badge{font-size:11px;height:20px;width:20px}.dispatch-container .compare-delta-title-main{font-size:12px}.dispatch-container .compare-delta-title-sub{font-size:9px}.dispatch-container .compare-delta-status{font-size:9px;padding:2px 6px}.dispatch-container .compare-delta-grid{gap:6px}.dispatch-container .compare-delta-cell{border-radius:8px;padding:5px 8px 4px}.dispatch-container .compare-delta-cell-label{font-size:9px;margin-bottom:1px}.dispatch-container .compare-delta-cell-val{font-size:13px}.dispatch-container .compare-delta-cell-unit{font-size:8px}.dispatch-container .compare-delta-cell-sub{font-size:9px;margin-top:1px}}@media (max-height:750px){.dispatch-container #hdr,.dispatch-container #strat-row{height:42px}.dispatch-container #strat-row .sbt{border:1px solid #0f172a14;border-radius:6px;font-size:11px;padding:5px 10px}.dispatch-container #batch-row{padding:4px 16px}.dispatch-container .compare-header-v2{gap:6px;padding:8px 12px 6px}.dispatch-container .compare-header-row .compare-title{font-size:13px;gap:8px}.dispatch-container .compare-title-dot{height:8px;width:8px}.dispatch-container .compare-title-badge{font-size:9px;padding:2px 6px}.dispatch-container .compare-overall-btn,.dispatch-container .compare-sync-toggle{font-size:10px;gap:4px;padding:4px 8px}.dispatch-container .compare-overall-btn svg,.dispatch-container .compare-sync-toggle svg{font-size:12px}.dispatch-container .compare-timeline-wrap{gap:4px}.dispatch-container .compare-timeline-container{border-radius:8px;gap:12px;padding:12px}.dispatch-container .compare-timeline-labels{border-right-width:1px;gap:12px;padding-right:10px}.dispatch-container .compare-timeline-label{font-size:9px;height:24px}.dispatch-container .compare-timeline-scrollable{display:flex;flex:1 1;flex-direction:column;gap:12px;overflow-x:auto;padding-bottom:2px}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:14px}.dispatch-container .compare-step{gap:4px}.dispatch-container .compare-step-circle{box-shadow:0 1px 4px #0f172a1a,0 0 0 1px #fff9;font-size:10px;height:24px;width:24px}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px #6366f1;box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px var(--step-color,#6366f1);transform:scale(1.1)}.dispatch-container .compare-step-spacer{margin-bottom:14px;width:10px}.dispatch-container .compare-step-tick{font-size:9px}.dispatch-container .compare-progress-strip{margin-top:2px}.dispatch-container .compare-progress-text{font-size:9px}.dispatch-container .compare-legend{gap:8px;margin-top:0;padding-top:2px}.dispatch-container .compare-legend-item{font-size:9px}.dispatch-container .compare-legend-swatch{height:10px;width:10px}.dispatch-container .compare-legend-note{display:none}.dispatch-container .compare-delta{gap:6px;padding:8px 12px}.dispatch-container .compare-delta-title{gap:8px;margin-bottom:4px}.dispatch-container .compare-delta-step-badge{font-size:11px;height:20px;width:20px}.dispatch-container .compare-delta-title-main{font-size:12px}.dispatch-container .compare-delta-title-sub{font-size:9px}.dispatch-container .compare-delta-status{font-size:9px;padding:2px 6px}.dispatch-container .compare-delta-grid{gap:6px}.dispatch-container .compare-delta-cell{border-radius:8px;padding:5px 8px 4px}.dispatch-container .compare-delta-cell-label{font-size:9px;margin-bottom:1px}.dispatch-container .compare-delta-cell-val{font-size:13px}.dispatch-container .compare-delta-cell-unit{font-size:8px}.dispatch-container .compare-delta-cell-sub{font-size:9px;margin-top:1px}}.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:12px}.dispatch-container .compare-delta-toggle-icon{align-items:center;color:#64748b;color:var(--text-muted,#64748b);display:inline-flex;font-size:18px;justify-content:center;transition:transform .22s cubic-bezier(.4,0,.2,1),color .15s ease}.dispatch-container .compare-delta-title:hover .compare-delta-toggle-icon{color:#3b82f6;color:var(--accent,#6366f1)}@media (max-width:1366px){.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:8px}.dispatch-container .compare-delta-toggle-icon{font-size:15px}}@media (max-height:750px){.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:8px}.dispatch-container .compare-delta-toggle-icon{font-size:15px}}.dispatch-container #body.compare-mode{grid-gap:12px;background:linear-gradient(180deg,#f8fafc,#eef2ff);display:grid;gap:12px;grid-template-columns:minmax(0,1fr) minmax(360px,440px);grid-template-rows:auto minmax(0,1fr);padding:12px;position:relative;transition:grid-template-columns .32s cubic-bezier(.4,0,.2,1)}.dispatch-container #body.compare-mode #sidebar,.dispatch-container #body.compare-mode .sidebar-toggle-tab{display:none!important}.dispatch-container #body.compare-mode.compare-data-collapsed{gap:0;grid-template-columns:minmax(0,1fr) 0}.dispatch-container #body.compare-mode.compare-data-collapsed .compare-data-panel{opacity:0;pointer-events:none;transform:translateX(20px)}.dispatch-container .compare-data-panel{transition:opacity .24s ease,transform .32s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-data-toggle-tab{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:10px;box-shadow:0 4px 12px #0f172a1f,0 1px 3px #0f172a0f;color:#1e293b;color:var(--text,#0f172a);cursor:pointer;display:inline-flex;font-size:18px;height:56px;justify-content:center;line-height:1;padding:0;position:absolute;right:452px;top:50%;transform:translate(50%,-50%);transition:right .32s cubic-bezier(.4,0,.2,1),background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;width:22px;z-index:1200}.dispatch-container .compare-data-toggle-tab:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 6px 16px #6366f159;color:#fff;transform:translate(50%,-50%) scale(1.06)}.dispatch-container .compare-data-toggle-tab:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent,#3b82f6);outline-offset:2px}.dispatch-container .compare-data-toggle-tab.is-collapsed{border-radius:10px 0 0 10px;border-right:none;right:0;transform:translateY(-50%)}.dispatch-container .compare-data-toggle-tab.is-collapsed:hover{transform:translateY(-50%) scale(1.06)}.dispatch-container .compare-data-toggle-tab svg{display:block}.dispatch-container #body.compare-mode #compare-map-wrap{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;flex:none;grid-column:1;grid-row:1;margin:0;min-width:0;overflow:hidden}.dispatch-container #body.compare-mode #compare-map-wrap .compare-header-v2{background:#0000;border-bottom:0}.dispatch-container #body.compare-mode #map-wrap,.dispatch-container #body.compare-mode #map-wrap.compare-split{border-radius:14px;border-right:0;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;flex:none;grid-column:1;grid-row:2;margin:0;min-height:0;min-width:0;overflow:hidden}.dispatch-container .compare-view-switcher{align-items:stretch;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffffa;border-radius:10px;box-shadow:0 6px 20px #0f172a1f,0 0 0 1px #0f172a14;display:inline-flex;gap:2px;left:12px;padding:4px;position:absolute;top:12px;z-index:600}.dispatch-container .compare-view-switcher button{-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:7px;color:#475569;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.04em;padding:6px 14px;text-transform:uppercase;transition:background .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease;white-space:nowrap}.dispatch-container .compare-view-switcher button:hover{background:#6366f114;color:#4338ca}.dispatch-container .compare-view-switcher button:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .compare-view-switcher button.is-active{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 2px 8px #6366f159;color:#fff}.dispatch-container .compare-view-switcher button.is-active:hover{color:#fff;transform:translateY(-.5px)}.dispatch-container .compare-data-panel{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;display:flex;flex-direction:column;grid-column:2;grid-row:1/3;min-height:0;min-width:0;overflow:hidden}.dispatch-container .cdp-head{align-items:center;background:linear-gradient(135deg,#6366f1,#3b82f6);border-bottom:1px solid #0f172a14;color:#fff;display:flex;flex-shrink:0;gap:12px;padding:14px 16px}.dispatch-container .cdp-head-title{align-items:center;display:flex;flex:1 1;gap:10px;min-width:0}.dispatch-container .cdp-rider-dot{border-radius:50%;box-shadow:0 0 0 2px #fff6;flex-shrink:0;height:14px;width:14px}.dispatch-container .cdp-head-text{display:flex;flex-direction:column;min-width:0}.dispatch-container .cdp-rider-name{color:#fff;font-size:15px;font-weight:800;letter-spacing:.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-head-badge{color:#ffffffd9;font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-close{align-items:center;background:#ffffff2e;border:0;border-radius:8px;color:#fff;cursor:pointer;display:inline-flex;font-size:18px;height:32px;justify-content:center;transition:background .15s ease,transform .15s ease;width:32px}.dispatch-container .cdp-close:hover{background:#ffffff52;transform:rotate(90deg)}.dispatch-container .cdp-scroll{display:flex;flex:1 1;flex-direction:column;gap:14px;min-height:0;overflow-y:auto;padding:14px 14px 18px}.dispatch-container .cdp-scroll::-webkit-scrollbar{width:8px}.dispatch-container .cdp-scroll::-webkit-scrollbar-track{background:#0000}.dispatch-container .cdp-scroll::-webkit-scrollbar-thumb{background:#0f172a24;border-radius:999px}.dispatch-container .cdp-section{background:#f8fafc;border:1px solid #0f172a0f;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:12px}.dispatch-container .cdp-section-head{align-items:center;color:#475569;display:flex;font-size:11px;font-weight:800;gap:8px;letter-spacing:.08em;text-transform:uppercase}.dispatch-container .cdp-section-icon{align-items:center;background:#6366f11f;border-radius:6px;color:#4338ca;display:inline-flex;font-size:14px;height:22px;justify-content:center;width:22px}.dispatch-container .cdp-section-icon.cdp-icon-warn{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-section-title{flex:1 1;min-width:0}.dispatch-container .cdp-section-sub{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:none}.dispatch-container .cdp-section-clear{background:#6366f11a;border:0;border-radius:999px;color:#4338ca;cursor:pointer;font-size:10px;font-weight:700;letter-spacing:.04em;padding:3px 9px;text-transform:none}.dispatch-container .cdp-section-clear:hover{background:#6366f133}.dispatch-container .cdp-tiles{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .cdp-tile{background:#fff;border:1px solid #0f172a12;border-radius:10px;display:flex;flex-direction:column;gap:4px;padding:10px 12px;transition:transform .15s ease,box-shadow .15s ease}.dispatch-container .cdp-tile:hover{box-shadow:0 4px 12px #0f172a0f;transform:translateY(-1px)}.dispatch-container .cdp-tile.is-warn{background:linear-gradient(180deg,#fff7ed,#fff);border-color:#f9731640}.dispatch-container .cdp-tile.is-loss{background:linear-gradient(180deg,#fef2f2,#fff);border-color:#ef444440}.dispatch-container .cdp-tile.is-gain{background:linear-gradient(180deg,#ecfdf5,#fff);border-color:#10b98140}.dispatch-container .cdp-tile-label{align-items:center;color:#64748b;display:flex;font-size:10px;font-weight:800;gap:5px;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .cdp-tile-label svg{font-size:13px}.dispatch-container .cdp-tile-value{color:#0f172a;font-size:20px;font-weight:800;letter-spacing:-.01em;line-height:1.1}.dispatch-container .cdp-tile-value.is-over{color:#dc2626}.dispatch-container .cdp-tile-value.is-under{color:#16a34a}.dispatch-container .cdp-tile-unit{color:#94a3b8;font-size:12px;font-weight:700;margin-left:2px}.dispatch-container .cdp-tile-sub{color:#94a3b8;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-dev-list,.dispatch-container .cdp-step-list{display:flex;flex-direction:column;gap:6px;list-style:none;margin:0;padding:0}.dispatch-container .cdp-dev-item{align-items:center;background:#fff;border:1px solid #ef444433;border-radius:10px;cursor:pointer;display:flex;gap:10px;padding:8px 10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-dev-item:hover{box-shadow:0 3px 10px #ef44441f;transform:translateX(2px)}.dispatch-container .cdp-dev-item.is-focused{background:#fef2f2;border-color:#ef444499}.dispatch-container .cdp-dev-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #fff9,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cdp-dev-body{display:flex;flex:1 1;flex-direction:column;gap:5px;min-width:0}.dispatch-container .cdp-dev-title{color:#0f172a;font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-dev-meta{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .cdp-dev-chip{align-items:center;background:#ef44441a;border-radius:999px;color:#dc2626;display:inline-flex;font-size:12px;font-weight:700;padding:3px 9px}.dispatch-container .cdp-dev-chip.is-over{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-step{align-items:flex-start;background:#fff;border:1px solid #0f172a12;border-radius:10px;cursor:pointer;display:flex;gap:10px;padding:10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-step:hover{border-color:#6366f14d;box-shadow:0 4px 12px #0f172a14;transform:translateY(-1px)}.dispatch-container .cdp-step.is-focused{background:linear-gradient(180deg,#eef2ff,#fff);border-color:#6366f1a6;box-shadow:0 4px 14px #6366f12e}.dispatch-container .cdp-step.is-correct{border-color:#10b98140}.dispatch-container .cdp-step.is-anomaly{background:linear-gradient(180deg,#fef2f2,#fff);border-color:#ef444466}.dispatch-container .cdp-step.is-skipped{opacity:.65}.dispatch-container .cdp-step.is-loading{opacity:.7}.dispatch-container .cdp-step-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #fff9,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:15px;font-weight:800;height:34px;justify-content:center;position:relative;width:34px}.dispatch-container .cdp-step-check,.dispatch-container .cdp-step-flag{align-items:center;background:#fff;border-radius:50%;bottom:-3px;box-shadow:0 1px 3px #0f172a33;display:inline-flex;font-size:13px;height:16px;justify-content:center;position:absolute;right:-3px;width:16px}.dispatch-container .cdp-step-check{color:#16a34a}.dispatch-container .cdp-step-flag{color:#dc2626}.dispatch-container .cdp-step-body{display:flex;flex:1 1;flex-direction:column;gap:4px;min-width:0}.dispatch-container .cdp-step-title-row{align-items:center;display:flex;gap:6px;min-width:0}.dispatch-container .cdp-step-title{color:#0f172a;flex:1 1;font-size:15px;font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-step-status{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.05em;padding:3px 9px;text-transform:uppercase}.dispatch-container .cdp-step-sub{color:#94a3b8;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-step-deltas{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:3px}.dispatch-container .cdp-step-delta{align-items:center;color:#475569;display:inline-flex;font-size:13px;font-weight:700;gap:4px}.dispatch-container .cdp-step-delta svg{color:#94a3b8;font-size:15px}.dispatch-container .cdp-step-delta small{color:#94a3b8;font-size:12px;font-weight:700}.dispatch-container .cdp-step-delta small.is-over,.dispatch-container .cdp-step-delta.is-over,.dispatch-container .cdp-step-delta.is-over svg{color:#dc2626}.dispatch-container .cdp-step-delta.is-under,.dispatch-container .cdp-step-delta.is-under svg{color:#16a34a}@media (max-width:1100px){.dispatch-container #body.compare-mode{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(360px,1fr) auto}.dispatch-container #body.compare-mode #compare-map-wrap{grid-column:1;grid-row:1}.dispatch-container #body.compare-mode #map-wrap,.dispatch-container #body.compare-mode #map-wrap.compare-split{grid-column:1;grid-row:2}.dispatch-container .compare-data-panel{grid-column:1;grid-row:3;max-height:50vh}.dispatch-container .compare-data-toggle-tab{display:none}}.dispatch-container.compare-open #batch-row,.dispatch-container.compare-open #strat-row{display:none!important}.dispatch-container .cdp-score-section{background:linear-gradient(135deg,#f8fafc,#eef2ff);border-color:#6366f12e;padding:14px}.dispatch-container .cdp-score-wrap{align-items:center;display:flex;gap:16px}.dispatch-container .cdp-score-ring{align-items:center;border-radius:50%;box-shadow:0 4px 14px #0f172a1a;display:inline-flex;flex-shrink:0;height:84px;justify-content:center;transition:background .5s ease;width:84px}.dispatch-container .cdp-score-inner{align-items:center;background:#fff;border-radius:50%;display:flex;flex-direction:column;gap:1px;height:70px;justify-content:center;width:70px}.dispatch-container .cdp-score-value{font-size:26px;font-weight:900;letter-spacing:-.02em;line-height:1}.dispatch-container .cdp-score-unit{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.05em}.dispatch-container .cdp-score-body{display:flex;flex:1 1;flex-direction:column;gap:2px;min-width:0}.dispatch-container .cdp-score-label{font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-score-title{color:#0f172a;font-size:15px;font-weight:800;letter-spacing:-.01em}.dispatch-container .cdp-score-sub{color:#64748b;font-size:11px;font-weight:600}.dispatch-container .cdp-timing-section .cdp-section-head{align-items:center;display:flex;gap:8px}.dispatch-container .cdp-timing-active-tag{align-items:center;background:#10b9811a;border-radius:999px;color:#16a34a;display:inline-flex;font-size:9px;font-weight:800;gap:5px;letter-spacing:.06em;margin-left:auto;padding:2px 8px 2px 6px;text-transform:uppercase}.dispatch-container .cdp-timing-active-pulse{animation:cdp-timing-pulse 1.8s cubic-bezier(.4,0,.6,1) infinite;background:#10b981;border-radius:50%;box-shadow:0 0 0 0 #10b9818c;height:6px;width:6px}@keyframes cdp-timing-pulse{0%{box-shadow:0 0 0 0 #10b9818c}70%{box-shadow:0 0 0 8px #10b98100}to{box-shadow:0 0 0 0 #10b98100}}.dispatch-container .cdp-timing-clock{grid-gap:8px;align-items:center;background:radial-gradient(120% 80% at 50% 0,#6366f112 0,#0000 60%),linear-gradient(180deg,#fbfcff,#fff);border:1px solid #0f172a12;border-radius:14px;box-shadow:0 1px 2px #0f172a08;display:grid;gap:8px;grid-template-columns:1fr minmax(70px,1.3fr) 1fr;padding:18px 14px 16px;position:relative}.dispatch-container .cdp-clock-card{align-items:center;display:flex;flex-direction:column;gap:6px;min-width:0}.dispatch-container .cdp-clock-label{align-items:center;color:#64748b;display:inline-flex;font-size:10px;font-weight:800;gap:4px;letter-spacing:.07em;text-transform:uppercase}.dispatch-container .cdp-clock-label svg{font-size:13px}.dispatch-container .cdp-clock-card.is-start .cdp-clock-label svg{color:#10b981}.dispatch-container .cdp-clock-card.is-end .cdp-clock-label svg{color:#f59e0b}.dispatch-container .cdp-clock-face{align-items:baseline;background:linear-gradient(180deg,#1e293b,#0b1220);border-radius:12px;box-shadow:0 2px 4px #0f172a2e,0 8px 18px #0f172a1f,inset 0 1px 0 #ffffff12,inset 0 -1px 0 #0006;display:inline-flex;gap:5px;padding:10px 14px;position:relative}.dispatch-container .cdp-clock-face:after{background:linear-gradient(180deg,#ffffff0a,#0000 50%);border-radius:11px;content:"";inset:1px;pointer-events:none;position:absolute}.dispatch-container .cdp-clock-card.is-start .cdp-clock-face{border-top:1px solid #10b98166}.dispatch-container .cdp-clock-card.is-end .cdp-clock-face{border-top:1px solid #f59e0b66}.dispatch-container .cdp-clock-time{font-feature-settings:"tnum";color:#f1f5f9;font-family:SF Mono,Roboto Mono,Menlo,Consolas,monospace;font-size:24px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.02em;line-height:1;text-shadow:0 0 12px #a7c3ff2e}.dispatch-container .cdp-clock-period{background:#ffffff14;border-radius:4px;color:#cbd5e1;font-size:10px;font-weight:800;letter-spacing:.1em;padding:1px 5px}.dispatch-container .cdp-clock-caption{color:#94a3b8;font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-clock-card.is-start .cdp-clock-caption{color:#16a34a}.dispatch-container .cdp-clock-card.is-end .cdp-clock-caption{color:#d97706}.dispatch-container .cdp-clock-track{align-items:center;display:flex;height:60px;justify-content:center;min-width:70px;position:relative}.dispatch-container .cdp-clock-track-line{background:linear-gradient(90deg,#10b981,#6366f1 50%,#f59e0b);border-radius:999px;box-shadow:0 1px 2px #6366f12e;height:4px;left:4px;position:absolute;right:4px;top:50%;transform:translateY(-50%)}.dispatch-container .cdp-clock-track-dot{border-radius:50%;height:11px;position:absolute;top:50%;transform:translateY(-50%);width:11px;z-index:1}.dispatch-container .cdp-clock-track-dot.is-start{background:#10b981;box-shadow:0 0 0 2px #fff,0 0 0 5px #10b98140;left:0}.dispatch-container .cdp-clock-track-dot.is-end{background:#f59e0b;box-shadow:0 0 0 2px #fff,0 0 0 5px #f59e0b40;right:0}.dispatch-container .cdp-clock-duration{align-items:center;background:#fff;border:1px solid #6366f133;border-radius:12px;box-shadow:0 4px 12px #0f172a14,0 1px 3px #6366f11f;display:inline-flex;flex-direction:column;gap:0;min-width:56px;padding:6px 10px 5px;position:relative;white-space:nowrap;z-index:2}.dispatch-container .cdp-clock-duration-icon{align-items:center;background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;box-shadow:0 2px 4px #6366f159;color:#fff;display:inline-flex;font-size:12px;height:20px;justify-content:center;margin-bottom:3px;width:20px}.dispatch-container .cdp-clock-duration-val{font-feature-settings:"tnum";color:#0f172a;font-size:14px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.01em;line-height:1.1}.dispatch-container .cdp-clock-duration-sub{color:#94a3b8;font-size:8px;font-weight:800;letter-spacing:.1em;margin-top:1px;text-transform:uppercase}.dispatch-container .cdp-timing-stats{grid-gap:10px;display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-top:12px}.dispatch-container .cdp-timing-stat{background:#fff;border:1px solid #0f172a12;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:12px;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.dispatch-container .cdp-timing-stat:hover{border-color:#6366f14d;box-shadow:0 4px 12px #6366f11a;transform:translateY(-1px)}.dispatch-container .cdp-timing-stat-head{align-items:center;display:flex;gap:10px}.dispatch-container .cdp-timing-stat-icon{align-items:center;background:linear-gradient(135deg,#6366f126,#4338ca1a);border-radius:10px;box-shadow:inset 0 0 0 1px #6366f11f;color:#4338ca;display:inline-flex;flex-shrink:0;font-size:20px;height:36px;justify-content:center;width:36px}.dispatch-container .cdp-timing-stat-body{display:flex;flex-direction:column;gap:1px;min-width:0}.dispatch-container .cdp-timing-stat-value{font-feature-settings:"tnum";color:#0f172a;font-size:18px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.02em;line-height:1.1}.dispatch-container .cdp-timing-stat-unit{color:#94a3b8;font-size:11px;font-weight:700;margin-left:3px}.dispatch-container .cdp-timing-stat-label{color:#94a3b8;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .cdp-timing-stat-viz{align-items:center;border-top:1px dashed #0f172a14;display:flex;gap:6px;padding-top:8px}.dispatch-container .cdp-timing-stat-viz-label{color:#94a3b8;font-size:10px;font-weight:700;margin-left:auto;white-space:nowrap}.dispatch-container .cdp-stops-dots{flex-wrap:wrap}.dispatch-container .cdp-stop-dot{background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;box-shadow:0 1px 2px #6366f14d;flex-shrink:0;height:6px;width:6px}.dispatch-container .cdp-speed-gauge{align-items:stretch;flex-direction:column;gap:4px}.dispatch-container .cdp-speed-gauge-track{background:#0f172a0f;border-radius:999px;height:6px;overflow:hidden;position:relative}.dispatch-container .cdp-speed-gauge-fill{background:linear-gradient(90deg,#10b981,#6366f1 60%,#f59e0b);border-radius:999px;box-shadow:0 1px 3px #6366f14d;height:100%;transition:width .4s cubic-bezier(.4,0,.2,1)}.dispatch-container .cdp-speed-gauge-scale{font-feature-settings:"tnum";color:#94a3b8;display:flex;font-size:9px;font-variant-numeric:tabular-nums;font-weight:700;justify-content:space-between;letter-spacing:.04em}.dispatch-container .cdp-highlights{display:flex;flex-direction:column;gap:10px}.dispatch-container .cdp-highlight{align-items:stretch;background:#fff;border:1px solid #0f172a12;border-radius:12px;cursor:pointer;display:flex;overflow:hidden;padding:0;position:relative;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-highlight:hover{box-shadow:0 6px 16px #0f172a14;transform:translateX(2px)}.dispatch-container .cdp-highlight-rail{align-self:stretch;flex-shrink:0;width:4px}.dispatch-container .cdp-highlight-content{display:flex;flex:1 1;flex-direction:column;gap:8px;min-width:0;padding:12px 14px}.dispatch-container .cdp-highlight.is-best{background:linear-gradient(90deg,#10b98112,#fff 65%);border-color:#10b98147}.dispatch-container .cdp-highlight.is-best:hover{border-color:#10b98180}.dispatch-container .cdp-highlight.is-best .cdp-highlight-rail{background:linear-gradient(180deg,#10b981,#16a34a)}.dispatch-container .cdp-highlight.is-worst{background:linear-gradient(90deg,#ef444412,#fff 65%);border-color:#ef444447}.dispatch-container .cdp-highlight.is-worst:hover{border-color:#ef444480}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-rail{background:linear-gradient(180deg,#ef4444,#dc2626)}.dispatch-container .cdp-highlight-top{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .cdp-highlight-label{align-items:center;display:inline-flex;font-size:11px;font-weight:800;gap:6px;letter-spacing:.06em;min-width:0;text-transform:uppercase}.dispatch-container .cdp-highlight.is-best .cdp-highlight-label{color:#16a34a}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-label{color:#dc2626}.dispatch-container .cdp-highlight-chip{align-items:center;border-radius:7px;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;height:22px;justify-content:center;width:22px}.dispatch-container .cdp-highlight.is-best .cdp-highlight-chip{background:linear-gradient(135deg,#10b981,#16a34a);box-shadow:0 1px 3px #10b98159}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-chip{background:linear-gradient(135deg,#ef4444,#dc2626);box-shadow:0 1px 3px #ef444459}.dispatch-container .cdp-highlight-step-chip{align-items:center;border-radius:999px;box-shadow:0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.05em;padding:3px 9px;text-transform:uppercase}.dispatch-container .cdp-highlight-title{color:#0f172a;font-size:15px;font-weight:700;letter-spacing:-.01em;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-highlight-meta{align-items:center;display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .cdp-highlight-pill{font-feature-settings:"tnum";align-items:center;border-radius:999px;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:.01em;padding:3px 9px}.dispatch-container .cdp-highlight-pill.is-bad{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-highlight-pill.is-good{background:#10b9811f;color:#16a34a}.dispatch-container .cdp-trips{display:flex;flex-direction:column;gap:8px}.dispatch-container .cdp-trip{background:#fff;border:1px solid #0f172a12;border-left:3px solid #6366f199;border-radius:10px;display:flex;flex-direction:column;gap:6px;padding:10px 12px}.dispatch-container .cdp-trip-head{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .cdp-trip-badge{align-items:center;background:#6366f11f;border-radius:999px;color:#4338ca;display:inline-flex;font-size:10px;font-weight:800;letter-spacing:.05em;padding:2px 8px;text-transform:uppercase}.dispatch-container .cdp-trip-meta{color:#64748b;font-size:11px;font-weight:700}.dispatch-container .cdp-trip-stats{display:flex;flex-wrap:wrap;gap:6px 14px}.dispatch-container .cdp-trip-stats span{align-items:center;color:#475569;display:inline-flex;font-size:12px;font-weight:700;gap:4px}.dispatch-container .cdp-trip-stats span svg{color:#94a3b8;font-size:13px}.dispatch-container .cdp-trip-stats span small{color:#94a3b8;font-size:10px;font-weight:700}.dispatch-container .cdp-trip-stats span.is-over,.dispatch-container .cdp-trip-stats span.is-over svg{color:#dc2626}.dispatch-container .cdp-section-head-clickable{cursor:pointer;-webkit-user-select:none;user-select:none}.dispatch-container .cdp-section-head-clickable:hover .cdp-section-title{color:#4338ca}.dispatch-container .cdp-seq-status{border-radius:999px;flex-shrink:0;font-size:12px;font-weight:800;letter-spacing:.05em;padding:3px 10px;text-transform:uppercase}.dispatch-container .cdp-seq-status.is-good{background:#10b9811f;color:#16a34a}.dispatch-container .cdp-seq-status.is-warn{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-seq-toggle{align-items:center;color:#94a3b8;display:inline-flex;font-size:18px;justify-content:center;transition:transform .22s cubic-bezier(.4,0,.2,1)}.dispatch-container .cdp-seq-toggle.is-open{color:#4338ca;transform:rotate(180deg)}.dispatch-container .cdp-seq{animation:cdp-seq-in .22s cubic-bezier(.4,0,.2,1);background:#fff;border:1px solid #0f172a12;border-radius:10px;display:flex;flex-direction:column;gap:10px;padding:12px}@keyframes cdp-seq-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .cdp-seq-diffs{display:flex;flex-direction:column;gap:6px;list-style:none;margin:4px 0 0;padding:0}.dispatch-container .cdp-seq-diff{align-items:center;background:linear-gradient(180deg,#fef2f2,#fff);border:1px solid #ef444433;border-radius:8px;cursor:pointer;display:flex;gap:10px;padding:8px 10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-seq-diff:hover{box-shadow:0 3px 10px #ef44441f;transform:translateX(2px)}.dispatch-container .cdp-seq-diff.is-focused{border-color:#ef444499;box-shadow:0 3px 12px #ef444433}.dispatch-container .cdp-seq-diff-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #ffffffb3,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cdp-seq-diff-body{display:flex;flex:1 1;flex-direction:column;gap:2px;min-width:0}.dispatch-container .cdp-seq-diff-title{color:#0f172a;font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-seq-diff-sub{color:#64748b;font-size:13px;font-weight:600}.dispatch-container .cdp-seq-diff-tag{background:#ef44441f;border-radius:999px;color:#dc2626;flex-shrink:0;font-size:13px;font-weight:800;padding:3px 10px}.dispatch-container .cdp-seq-good{align-items:center;background:#10b98114;border-radius:8px;color:#16a34a;display:inline-flex;font-size:14px;font-weight:700;gap:6px;padding:6px 10px}.dispatch-container .cdp-seq-good svg{font-size:18px}.dispatch-container .cdp-seq-diff.is-group{background:linear-gradient(180deg,#eef2ff,#fff);border-color:#6366f14d;padding-right:40px;position:relative}.dispatch-container .cdp-seq-diff.is-group:hover{border-color:#6366f18c;box-shadow:0 3px 10px #6366f126}.dispatch-container .cdp-seq-diff.is-group.is-expanded{background:linear-gradient(180deg,#e0e7ff,#f5f7ff);border-bottom-left-radius:0;border-bottom-right-radius:0;border-color:#6366f199}.dispatch-container .cdp-seq-group-num{align-items:center;display:inline-flex;flex-shrink:0;height:30px;justify-content:center;position:relative;width:30px}.dispatch-container .cdp-seq-group-num-bg{border-radius:8px;box-shadow:0 0 0 2px #ffffffb3,0 1px 3px #0f172a26;inset:0;position:absolute}.dispatch-container .cdp-seq-group-num-label{color:#fff;font-size:13px;font-weight:800;letter-spacing:-.01em;position:relative;text-shadow:0 1px 2px #00000040}.dispatch-container .cdp-seq-group-delta{align-items:center;background:#6366f126;border-radius:999px;color:#4338ca;display:inline-flex;font-size:13px;font-weight:800;margin-left:4px;padding:2px 8px;vertical-align:1px}.dispatch-container .cdp-seq-group-toggle{align-items:center;background:#ffffffb3;border-radius:6px;color:#4338ca;display:inline-flex;font-size:18px;height:22px;justify-content:center;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%);transition:transform .22s cubic-bezier(.4,0,.2,1);width:22px}.dispatch-container .cdp-seq-group-toggle.is-open{background:#6366f12e;transform:translateY(-50%) rotate(180deg)}.dispatch-container .cdp-seq-group-children-wrap{animation:cdp-seq-group-in .22s cubic-bezier(.4,0,.2,1);background:#6366f10d;border-bottom:1px solid #6366f133;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-left:2px solid #6366f159;border-right:1px solid #6366f133;list-style:none;margin:-2px 0 0 4px;padding:0}@keyframes cdp-seq-group-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .cdp-seq-group-children{display:flex;flex-direction:column;gap:4px;list-style:none;margin:0;padding:8px 8px 8px 14px}.dispatch-container .cdp-seq-diff.is-nested{background:#fff;border-color:#6366f126;border-radius:8px;padding:6px 8px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-num{font-size:13px;height:26px;width:26px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-title{font-size:13.5px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-sub{font-size:12.5px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-tag{font-size:12px;padding:2px 8px}.dispatch-container .rcard-est-meters{align-items:center;background:#3b82f614;background:var(--accent-soft,#3b82f614);border-radius:6px;color:#3b82f6;color:var(--accent,#3b82f6);display:inline-flex;font-size:11px;font-weight:700;gap:3px;padding:2px 8px}.dispatch-container .zone-order-chip.est-meters-chip{background:#2563eb14;border-color:#2563eb33;color:#2563eb}.dispatch-container .pu-distance-chip.pu-est-meters{background:#2563eb14;border-color:#2563eb33}.dispatch-container .pu-distance-chip.pu-est-meters .pu-distance-icon{color:#2563eb}.dispatch-container .pu-distance-chip.pu-est-meters .pu-distance-value{color:#2563eb;font-weight:700}.dispatch-container #dispatch-top-tabs{align-items:center;background:#0000;display:inline-flex;flex-shrink:0;gap:4px;padding:0}.dispatch-container #dispatch-top-tabs.dtt-inline{margin-right:4px}.dispatch-container .dtt-tab{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:12px;font-weight:700;gap:6px;line-height:1;padding:6px 12px;transition:color .15s,background .15s,border-color .15s}.dispatch-container .dtt-tab:hover{background:#f8fafc;background:var(--bg-sub);color:#1e293b;color:var(--text)}.dispatch-container .dtt-tab.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 2px 6px #3b82f640;color:#fff}.dispatch-container .dtt-icon{align-items:center;display:inline-flex;font-size:14px}.dispatch-container #dispatch-analysis{background:#f8fafc;display:flex;flex:1 1;flex-direction:column;gap:18px;overflow:auto;padding:20px}.dispatch-container .da-intro-title{color:#1e293b;color:var(--text);font-size:16px;font-weight:700;margin-bottom:4px}.dispatch-container .da-intro-sub{color:#64748b;color:var(--text-muted);font-size:12.5px;line-height:1.5}.dispatch-container .da-code{background:#eef2ff;border-radius:4px;color:#4f46e5;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;margin:0 4px;padding:1px 6px}.dispatch-container .da-picker-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width:720px){.dispatch-container .da-picker-row{grid-template-columns:1fr}}.dispatch-container .da-picker{background:#fff;border:1px solid #e2e8f0;border-radius:12px;cursor:pointer;font-family:inherit;padding:14px;text-align:left;transition:box-shadow .15s,transform .15s,border-color .15s}.dispatch-container .da-picker:hover:not(.is-loading){box-shadow:0 4px 14px -6px #0f172a26;transform:translateY(-1px)}.dispatch-container .da-picker.is-loading{cursor:wait;opacity:.7}.dispatch-container .da-picker-head{align-items:center;display:flex;gap:10px;margin-bottom:6px}.dispatch-container .da-picker-badge{align-items:center;border-radius:8px;display:inline-flex;font-size:13px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .da-picker-meta{flex:1 1;min-width:0}.dispatch-container .da-picker-name{color:#1e293b;color:var(--text);font-size:14px;font-weight:700;line-height:1.2}.dispatch-container .da-picker-range{color:#64748b;color:var(--text-muted);font-size:11px}.dispatch-container .da-picker-status{border-radius:12px;flex-shrink:0;font-size:10.5px;font-weight:700;padding:4px 8px}.dispatch-container .da-picker-sub{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-empty{background:#fff;border:1px dashed #cbd5e1;border-radius:12px;color:#94a3b8;font-size:13px;padding:40px;text-align:center}.dispatch-container .da-result-row{grid-gap:14px;align-items:stretch;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}.dispatch-container .da-result-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;border-top:4px solid #6366f1;display:flex;flex-direction:column;gap:12px;padding:16px}.dispatch-container .da-result-head{align-items:center;display:flex;justify-content:space-between}.dispatch-container .da-result-title{color:#1e293b;color:var(--text);font-size:15px;font-weight:700}.dispatch-container .da-result-sub{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-result-refresh{align-items:center;border:none;border-radius:8px;cursor:pointer;display:inline-flex;font-size:16px;height:30px;justify-content:center;transition:filter .15s;width:30px}.dispatch-container .da-result-refresh:hover{filter:brightness(.95)}.dispatch-container .da-result-refresh:disabled{cursor:wait;opacity:.5}.dispatch-container .da-detail-actions{align-items:center;display:inline-flex;gap:10px}.dispatch-container .da-live-tag{align-items:center;background:#ecfdf5;border:1px solid #a7f3d0;border-radius:999px;color:#166534;display:inline-flex;font-size:11px;font-weight:700;gap:6px;letter-spacing:.02em;padding:4px 9px 4px 8px;transition:background .15s,color .15s,border-color .15s;-webkit-user-select:none;user-select:none}.dispatch-container .da-live-tag.is-active{background:#fffbeb;border-color:#fde68a;color:#92400e}.dispatch-container .da-live-dot{animation:da-live-pulse 1.8s ease-in-out infinite;background:#10b981;border-radius:50%;box-shadow:0 0 0 2px #10b9812e;height:7px;width:7px}.dispatch-container .da-live-tag.is-active .da-live-dot{animation:da-live-pulse .9s ease-in-out infinite;background:#f59e0b;box-shadow:0 0 0 2px #f59e0b38}@keyframes da-live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.dispatch-container .da-metric-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}.dispatch-container .da-metric{background:#f8fafc;border:1px solid #eef2f6;border-radius:8px;padding:8px 10px}.dispatch-container .da-metric-label{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.4px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-metric-value{color:#1e293b;color:var(--text);font-size:14px;font-weight:800;line-height:1.3}.dispatch-container .da-riders-label{color:#475569;font-size:11px;font-weight:700;letter-spacing:.4px;margin-bottom:6px;text-transform:uppercase}.dispatch-container .da-riders-list{display:flex;flex-direction:column;gap:4px}.dispatch-container .da-rider-row{align-items:center;background:#f8fafc;border:1px solid #eef2f6;border-radius:6px;display:flex;justify-content:space-between;padding:5px 10px}.dispatch-container .da-rider-name{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:12px;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .da-rider-stat{color:#64748b;color:var(--text-muted);flex-shrink:0;font-size:11px}.dispatch-container .da-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;color:#991b1b;display:flex;flex-direction:column;gap:4px;padding:12px}.dispatch-container .da-error-title{align-items:center;color:#b91c1c;display:inline-flex;font-size:12.5px;font-weight:800;gap:6px;letter-spacing:.3px;text-transform:uppercase}.dispatch-container .da-error-msg{color:#7f1d1d;font-size:13px;line-height:1.5}.dispatch-container .da-error-meta{color:#b45353;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.dispatch-container .da-detail{display:flex;flex-direction:column;gap:16px}.dispatch-container .da-detail-head{align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;border-top:4px solid #6366f1;display:flex;justify-content:space-between;padding:14px 16px}.dispatch-container .da-detail-title{color:#1e293b;color:var(--text);font-size:16px;font-weight:800;text-transform:capitalize}.dispatch-container .da-detail-sub-inline{color:#64748b;color:var(--text-muted);font-size:12.5px;font-weight:600;margin-left:6px}.dispatch-container .da-detail-sub{color:#64748b;color:var(--text-muted);font-size:11.5px;margin-top:2px}.dispatch-container .da-section{background:#fff;border:1px solid #e2e8f0;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:14px}.dispatch-container .da-section-label{color:#475569;font-size:12px;font-weight:800;letter-spacing:.4px;text-transform:uppercase}.dispatch-container .da-section-count{color:#94a3b8;font-weight:700;margin-left:4px}.dispatch-container .da-metric-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width:720px){.dispatch-container .da-metric-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}}.dispatch-container .da-rec{background:linear-gradient(135deg,#eef2ff,#f0fdf4);border:1px solid #c7d2fe;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:12px 14px}.dispatch-container .da-rec.da-rec-empty{background:#f8fafc;border:1px dashed #e2e8f0;color:#64748b}.dispatch-container .da-rec.da-rec-empty .da-rec-action{color:#64748b;font-weight:500;letter-spacing:0;text-transform:none}.dispatch-container .da-rec-head{align-items:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}.dispatch-container .da-rec-action{align-items:center;color:#4338ca;display:inline-flex;font-size:13px;font-weight:800;gap:6px;text-transform:capitalize}.dispatch-container .da-rec-improve{border-radius:14px;font-size:11.5px;font-weight:700;padding:4px 10px}.dispatch-container .da-rec-line{color:#1e293b;color:var(--text);font-size:13px;line-height:1.5}.dispatch-container .da-rec-desc{color:#475569;font-size:12.5px;line-height:1.55}.dispatch-container .da-rec-desc,.dispatch-container .da-rec-rules{background:#fff;border:1px solid #e0e7ff;border-radius:8px;padding:8px 10px}.dispatch-container .da-rec-rules{display:flex;flex-direction:column;gap:4px}.dispatch-container .da-rec-rules-head{color:#475569;font-size:11px;font-weight:700;letter-spacing:.3px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-rec-rule{color:#334155;font-size:12px}.dispatch-container .da-rec-rule code{background:#f1f5f9;border-radius:4px;color:#1e293b;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 6px}.dispatch-container .da-rec-rule-why{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-timeline-list{grid-gap:10px;display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.dispatch-container .da-timeline-card{background:#f8fafc;border:1px solid #eef2f6;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:10px 12px}.dispatch-container .da-timeline-top{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .da-timeline-name{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:13px;font-weight:700;gap:6px;min-width:0}.dispatch-container .da-timeline-id{color:#64748b;color:var(--text-muted);font-size:10.5px;font-weight:600}.dispatch-container .da-pill{border-radius:12px;font-size:10.5px;font-weight:800;letter-spacing:.3px;padding:3px 9px;text-transform:uppercase}.dispatch-container .da-pill.is-active{background:#dcfce7;color:#166534}.dispatch-container .da-pill.is-idle{background:#fef3c7;color:#92400e}.dispatch-container .da-timeline-mid{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .da-chip{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:12px;color:#334155;display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:3px 8px}.dispatch-container .da-chip.da-chip-link{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8;cursor:pointer;font-family:inherit;text-decoration:none;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .1s ease}.dispatch-container .da-chip.da-chip-link:hover{background:#dbeafe;border-color:#93c5fd;color:#1e40af}.dispatch-container .da-chip.da-chip-link:active{transform:scale(.98)}.dispatch-container .da-chip.da-chip-link:focus-visible{outline:2px solid #3b82f6;outline-offset:1px}.dispatch-container .da-pos-modal-backdrop{align-items:center;animation:da-pos-fade .18s ease;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);background:#0f172a8c;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:2000}@keyframes da-pos-fade{0%{opacity:0}to{opacity:1}}.dispatch-container .da-pos-modal-card{animation:da-pos-rise .22s cubic-bezier(.16,1,.3,1);background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 24px 60px #0f172a47,0 8px 24px #0f172a1f;display:flex;flex-direction:column;overflow:hidden;width:min(720px,100%)}@keyframes da-pos-rise{0%{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .da-pos-modal-head{align-items:center;background:linear-gradient(135deg,#66258208,#9255ab14);border-bottom:1px solid #eef2f6;display:flex;flex:0 0 auto;gap:12px;justify-content:space-between;padding:14px 18px}.dispatch-container .da-pos-modal-title-wrap{align-items:center;display:flex;gap:12px;min-width:0}.dispatch-container .da-pos-modal-avatar{align-items:center;border-radius:12px;display:inline-flex;flex-shrink:0;font-size:22px;height:40px;justify-content:center;width:40px}.dispatch-container .da-pos-modal-title{color:#0f172a;font-size:15.5px;font-weight:800;letter-spacing:-.01em;line-height:1.2}.dispatch-container .da-pos-modal-sub{color:#64748b;font-size:11.5px;font-weight:600;letter-spacing:.01em;margin-top:2px}.dispatch-container .da-pos-modal-actions{align-items:center;display:inline-flex;flex-shrink:0;gap:8px}.dispatch-container .da-pos-modal-close{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:10px;color:#475569;cursor:pointer;display:inline-flex;font-size:18px;height:32px;justify-content:center;transition:background .15s,color .15s,border-color .15s,transform .1s;width:32px}.dispatch-container .da-pos-modal-close:hover{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.dispatch-container .da-pos-modal-close:active{transform:scale(.96)}.dispatch-container .da-pos-modal-map{background:#e2e8f0;flex:0 0 auto;height:420px;position:relative;width:100%}.dispatch-container .da-pos-modal-map .leaflet-container{background:#e2e8f0;height:100%!important;width:100%!important;z-index:1}.dispatch-container .da-pos-modal-foot{align-items:center;background:#f8fafc;border-top:1px solid #eef2f6;display:flex;flex:0 0 auto;gap:12px;justify-content:space-between;padding:12px 18px}.dispatch-container .da-pos-modal-coord{font-feature-settings:"tnum";align-items:center;color:#334155;display:inline-flex;font-size:12.5px;font-variant-numeric:tabular-nums;gap:8px}.dispatch-container .da-pos-modal-coord strong{color:#0f172a;font-weight:700}.dispatch-container .da-pos-modal-sep{color:#cbd5e1;margin:0 8px}.dispatch-container .da-pos-modal-copy{background:#662582;border:1px solid #662582;border-radius:999px;color:#fff;cursor:pointer;font-family:inherit;font-size:11.5px;font-weight:700;padding:6px 14px;transition:background .15s,border-color .15s,transform .1s}.dispatch-container .da-pos-modal-copy:hover{background:#4d1c61;border-color:#4d1c61}.dispatch-container .da-pos-modal-copy:active{transform:scale(.97)}.dispatch-container .da-sub-list{display:flex;flex-direction:column;gap:10px}.dispatch-container .da-sub-card{background:#fff;border:1px solid #e2e8f0;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:12px}.dispatch-container .da-sub-head{align-items:center;display:flex;flex-wrap:wrap;gap:6px;justify-content:space-between}.dispatch-container .da-sub-title{color:#1e293b;color:var(--text);font-size:13px;text-transform:capitalize}.dispatch-container .da-sub-improve{border-radius:12px;font-size:11.5px;font-weight:800;padding:3px 10px}.dispatch-container .da-sub-meta{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .da-sub-relieved{align-items:center;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;color:#166534;display:inline-flex;font-size:12px;gap:6px;padding:6px 10px}.dispatch-container .da-sub-transfers{background:#f8fafc;border:1px solid #eef2f6;border-radius:8px;display:flex;flex-direction:column;gap:4px;padding:8px 10px}.dispatch-container .da-sub-transfers-head{color:#475569;font-size:11px;font-weight:700;letter-spacing:.3px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-transfer-row{grid-gap:8px;align-items:center;border-bottom:1px dashed #e2e8f0;color:#1e293b;color:var(--text);display:grid;font-size:11.5px;gap:8px;grid-template-columns:80px 1fr auto auto;padding:4px 0}.dispatch-container .da-transfer-row:last-child{border-bottom:none}.dispatch-container .da-transfer-id{color:#1e293b;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:800}.dispatch-container .da-transfer-from{color:#64748b;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .da-transfer-time{color:#334155;font-size:11px}.dispatch-container .da-transfer-imp{border-radius:10px;font-size:10.5px;font-weight:800;padding:2px 8px}.dispatch-container .da-hero-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:repeat(3,1fr)}@media (max-width:900px){.dispatch-container .da-hero-row{grid-template-columns:1fr}}.dispatch-container .da-hero-card{align-items:flex-start;background:#fff;border:1px solid #e2e8f0;border-radius:12px;border-top:3px solid #94a3b8;box-shadow:0 1px 2px #0f172a0a;display:flex;flex-direction:column;gap:4px;min-width:0;padding:18px 18px 16px;position:relative}.dispatch-container .da-hero-icon{align-items:center;border-radius:10px;display:inline-flex;font-size:20px;height:36px;justify-content:center;margin-bottom:4px;width:36px}.dispatch-container .da-hero-value{color:#0f172a;font-size:32px;font-weight:800;letter-spacing:-.02em;line-height:1.05}.dispatch-container .da-hero-unit{color:#64748b;font-size:16px;font-weight:600;margin-left:2px}.dispatch-container .da-hero-label{color:#64748b;font-size:11px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container .da-hero-sub{color:#94a3b8;font-size:12px;font-weight:500;margin-top:6px}.dispatch-container .da-health-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:1.2fr repeat(3,1fr)}@media (max-width:1100px){.dispatch-container .da-health-row{grid-template-columns:1fr 1fr}}@media (max-width:600px){.dispatch-container .da-health-row{grid-template-columns:1fr}}.dispatch-container .da-health-card{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 1px 2px #0f172a0a;display:flex;gap:14px;min-width:0;padding:14px 16px}.dispatch-container .da-health-card-stat{align-items:flex-start;flex-direction:column;gap:4px}.dispatch-container .da-health-value{color:#0f172a;font-size:24px;font-weight:800;letter-spacing:-.02em;line-height:1.1}.dispatch-container .da-health-unit{color:#64748b;font-size:13px;font-weight:600;margin-left:2px}.dispatch-container .da-health-label{color:#64748b;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .da-health-sub{color:#94a3b8;font-size:11.5px;font-weight:500}.dispatch-container .da-health-meta{display:flex;flex-direction:column;gap:4px;min-width:0}.dispatch-container .da-ring{--ring-color:#10b981;--ring-pct:0;align-items:center;background:conic-gradient(var(--ring-color) calc(var(--ring-pct)*1%),#f1f5f9 0);border-radius:50%;display:inline-flex;flex-shrink:0;height:72px;justify-content:center;position:relative;width:72px}.dispatch-container .da-ring:after{background:#fff;border-radius:50%;content:"";inset:6px;position:absolute}.dispatch-container .da-ring-num{color:#0f172a;font-size:18px;font-weight:800;letter-spacing:-.02em;position:relative;z-index:1}.dispatch-container .da-ring-unit{color:#64748b;font-size:11px;font-weight:700;margin-left:1px}.dispatch-container .da-rec-banner{align-items:flex-start;border:1px solid;border-radius:12px;display:flex;gap:14px;padding:14px 16px}.dispatch-container .da-rec-banner.is-action{background:#eff6ff;border-color:#bfdbfe;color:#1e3a8a}.dispatch-container .da-rec-banner.is-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}.dispatch-container .da-rec-banner.is-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}.dispatch-container .da-rec-banner.is-info{background:#f8fafc;border-color:#e2e8f0;color:#475569}.dispatch-container .da-rec-banner-icon{align-items:center;background:#ffffff8c;border-radius:8px;display:inline-flex;flex:0 0 auto;font-size:18px;height:32px;justify-content:center;width:32px}.dispatch-container .da-rec-banner-body{display:flex;flex:1 1 auto;flex-direction:column;gap:6px;min-width:0}.dispatch-container .da-rec-banner .da-rec-action{align-items:center;color:inherit;display:inline-flex;font-size:14px;font-weight:700;gap:6px;letter-spacing:-.005em;text-transform:capitalize}.dispatch-container .da-rec-banner .da-rec-desc,.dispatch-container .da-rec-banner .da-rec-line{color:inherit;font-size:12.5px;line-height:1.5;opacity:.9}.dispatch-container .da-rec-banner .da-rec-assess{background:#0f172a0a;border-radius:8px;color:inherit;font-size:12px;font-weight:500;line-height:1.55;margin-top:2px;opacity:.95;padding:8px 10px}.dispatch-container .da-section-hint{color:#94a3b8;font-size:11px;font-weight:500;letter-spacing:0;margin-left:10px;text-transform:none}.dispatch-container .da-gantt-axis{align-items:center;color:#64748b;display:flex;font-size:11px;font-weight:600;justify-content:space-between;padding:0 4px 6px}.dispatch-container .da-gantt-axis-mid{color:#94a3b8;font-style:italic;font-weight:500}.dispatch-container .da-gantt-row{align-items:center;display:flex;gap:10px;margin:8px 0 4px}.dispatch-container .da-gantt-track{background:#f1f5f9;border-radius:8px;flex:1 1;height:24px;overflow:hidden;position:relative}.dispatch-container .da-gantt-fill{align-items:center;border-radius:8px;bottom:0;box-shadow:0 1px 0 #0f172a14;color:#fff;display:flex;font-size:10.5px;font-weight:700;justify-content:space-between;letter-spacing:.01em;overflow:hidden;padding:0 8px;position:absolute;top:0;white-space:nowrap}.dispatch-container .da-gantt-fill-end,.dispatch-container .da-gantt-fill-start{flex-shrink:0;text-shadow:0 1px 1px #0f172a2e}.dispatch-container .da-gantt-idle{background-image:repeating-linear-gradient(135deg,#e2e8f0 0 6px,#f1f5f9 6px 12px);border-left:1px dashed #cbd5e1;bottom:0;position:absolute;top:0}.dispatch-container .da-gantt-util{border-radius:6px;flex:0 0 auto;font-size:11.5px;font-weight:800;letter-spacing:.01em;min-width:44px;padding:4px 8px;text-align:center}.dispatch-container .da-conf-dot{border-radius:50%;display:inline-block;flex-shrink:0;height:7px;margin-left:4px;width:7px}.dispatch-container .da-conf-dot.is-ok{background:#10b981;box-shadow:0 0 0 2px #10b9812e}.dispatch-container .da-conf-dot.is-low{background:#f59e0b;box-shadow:0 0 0 2px #f59e0b33}.dispatch-container .da-chip.da-chip-orders{align-items:center;display:inline-flex;gap:8px}.dispatch-container .da-orders-label{color:#0f172a;font-size:11.5px;font-weight:700}.dispatch-container .da-orders-bar{background:#e2e8f0;border-radius:4px;flex-shrink:0;height:6px;overflow:hidden;position:relative;width:56px}.dispatch-container .da-orders-bar-fill{background:linear-gradient(90deg,#10b981,#34d399);border-radius:4px;inset:0;position:absolute;transition:width .3s ease;width:0}.dispatch-container .da-orders-pending{color:#b45309;font-size:10.5px;font-weight:600} \ No newline at end of file +.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;user-select:none}.leaflet-tile::selection{background:#0000}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-height:none!important;max-width:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important;padding:0;width:auto}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:focus,.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;line-height:1.4;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:focus,.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;height:.6669em;vertical-align:initial!important;width:1em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fffc;border:2px solid #777;border-top:none;box-sizing:border-box;line-height:1.1;padding:2px 5px 1px;text-shadow:1px 1px #fff;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{font-size:13px;font-size:1.08333em;line-height:1.3;margin:13px 24px 13px 20px;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;margin-top:-1px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;pointer-events:auto;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px #0006;color:#333}.leaflet-container a.leaflet-popup-close-button{background:#0000;border:none;color:#757575;font:16px/24px Tahoma,Verdana,sans-serif;height:24px;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:24px}.leaflet-container a.leaflet-popup-close-button:focus,.leaflet-container a.leaflet-popup-close-button:hover{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px #0006;color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:#0000;border:6px solid #0000;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--bg:#fff;--bg-sub:#f8fafc;--bg-card:#fff;--border:#e2e8f0;--border-active:#3b82f6;--text:#1e293b;--text-muted:#64748b;--accent:#3b82f6;--accent-soft:#3b82f614;--kitchen:#f59e0b;--kitchen-soft:#f59e0b1a;--success:#22c55e;--shadow:0 4px 12px #0000000d;--shadow-lg:0 10px 25px -5px #00000014}.dispatch-container{background:#fff;background:var(--bg);color:#1e293b;color:var(--text);display:flex;flex-direction:column;font-family:Inter,-apple-system,sans-serif;height:calc(100vh - 88px);margin:-24px;overflow:hidden;position:relative;width:calc(100% + 48px)}.dispatch-container.embedded{flex:1 1;height:100%;margin:0;min-height:0;width:100%}.dispatch-container *{box-sizing:border-box;margin:0;padding:0}.dispatch-container #hdr{align-items:center;background:#fff;background:var(--bg);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;height:56px;justify-content:space-between;padding:0 24px;z-index:1010}.dispatch-container .logo{align-items:center;display:flex;gap:12px}.dispatch-container .logo-badge{align-items:center;background:linear-gradient(135deg,#3b82f6,#2563eb);border-radius:8px;color:#fff;display:flex;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .logo-name{color:#1e293b;color:var(--text);font-size:18px;font-weight:800;letter-spacing:-.02em}.dispatch-container .logo-name em{color:#3b82f6;color:var(--accent);font-style:normal;opacity:.8}.dispatch-container .logo-city-wrap{display:inline-block;position:relative}.dispatch-container .logo-city{align-items:center;background:#7b1fa214;border:1px solid #7b1fa240;border-radius:999px;color:#7b1fa2;cursor:pointer;display:inline-flex;font-family:inherit;font-size:11px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:4px 8px 4px 10px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.dispatch-container .logo-city:hover{background:#7b1fa224;border-color:#7b1fa273}.dispatch-container .logo-city.open{background:#7b1fa22e;border-color:#7b1fa28c;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .logo-city svg{flex-shrink:0;font-size:13px}.dispatch-container .logo-city-caret{font-size:15px;transition:transform .2s ease}.dispatch-container .logo-city.open .logo-city-caret{transform:rotate(180deg)}.dispatch-container .logo-city-text{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .logo-city-menu{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:12px;box-shadow:0 16px 36px #0f172a29;left:0;max-height:320px;min-width:200px;overflow-y:auto;padding:6px;position:absolute;top:calc(100% + 6px);z-index:1000}@keyframes logo-city-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .logo-city-menu::-webkit-scrollbar{width:6px}.dispatch-container .logo-city-menu::-webkit-scrollbar-thumb{background:#7b1fa24d;border-radius:999px}.dispatch-container .logo-city-option{align-items:center;background:#0000;border:0;border-radius:8px;color:#1e293b;cursor:pointer;display:flex;font-family:inherit;font-size:12px;font-weight:600;gap:8px;padding:8px 10px;text-align:left;transition:background .12s ease;width:100%}.dispatch-container .logo-city-option:hover{background:#7b1fa20f}.dispatch-container .logo-city-option.active{background:#7b1fa21a;color:#7b1fa2}.dispatch-container .logo-city-option-icon{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .logo-city-option span:not(.logo-city-option-check){flex:1 1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .logo-city-option-check{color:#7b1fa2;flex-shrink:0;font-weight:800}.dispatch-container .hdr-sep{background:#e2e8f0;background:var(--border);height:20px;margin:0 4px;width:1px}.dispatch-container .hdr-meta{color:#64748b;color:var(--text-muted);font-size:12px;font-weight:500}.dispatch-container #clock{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;color:#1e293b;color:var(--text);font-family:JetBrains Mono,monospace;font-size:13px;font-weight:600;padding:7px 16px}.dispatch-container .hdr-stats{align-items:center;display:flex;flex-wrap:nowrap;gap:16px;margin-left:auto;margin-right:16px;min-width:0}.dispatch-container #strat-row{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;height:54px;padding:0 24px}.dispatch-container #strat-row,.dispatch-container .sbt{align-items:center;background:#fff;background:var(--bg);gap:8px}.dispatch-container .sbt{border:1px solid #0f172a14;border-radius:10px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;font-family:inherit;font-size:13px;font-weight:600;line-height:1;padding:8px 14px;transition:all .2s cubic-bezier(.4,0,.2,1)}.dispatch-container .sbt:hover{background:#f8fafc;background:var(--bg-sub);border-color:#64748b;border-color:var(--text-muted);color:#1e293b;color:var(--text)}.dispatch-container .sbt.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 4px 12px #3b82f640;color:#fff}.dispatch-container .sbt .sbt-icon{align-items:center;color:inherit;display:inline-flex;flex-shrink:0;font-size:18px;height:18px;justify-content:center;line-height:1;width:18px}.dispatch-container .sbt .sbt-icon svg{display:block;height:1em;vertical-align:middle;width:1em}.dispatch-container .strat-stats{align-items:center;border-left:1px solid #e2e8f0;border-left:1px solid var(--border);display:inline-flex;gap:8px;height:32px;margin-left:8px;padding-left:12px}.dispatch-container .strat-stats.strat-stats-right{border-left:none;margin-left:auto;padding-left:0}.dispatch-container .strat-stat{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:12px;font-weight:700;gap:8px;line-height:1;padding:7px 15px;transition:all .15s ease;white-space:nowrap}.dispatch-container .strat-stat-icon{font-size:13px;line-height:1}.dispatch-container .strat-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .strat-stat-value{font-size:13px;font-weight:800}.dispatch-container .strat-stat-orders{background:#3b82f614;background:var(--accent-soft);border-color:#3b82f640}.dispatch-container .strat-stat-orders .strat-stat-value{color:#3b82f6;color:var(--accent)}.dispatch-container .strat-stat-profit{background:#22c55e1a;border-color:#22c55e4d}.dispatch-container .strat-stat-profit .strat-stat-label,.dispatch-container .strat-stat-profit .strat-stat-value{color:#22c55e;color:var(--success)}.dispatch-container .strat-stat-loss{background:#ef44441a;border-color:#ef444459}.dispatch-container .strat-stat-loss .strat-stat-label,.dispatch-container .strat-stat-loss .strat-stat-value{color:#dc2626}.dispatch-container .live-controls{align-items:center;display:flex;gap:12px;margin-left:auto}.dispatch-container .live-status{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);display:inline-flex;font-size:12px;font-weight:600;gap:8px;padding:7px 15px}.dispatch-container .live-status-ready{color:#22c55e;color:var(--success)}.dispatch-container .live-status-error{color:#ef4444}.dispatch-container .live-status-sub{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:500;opacity:.85}.dispatch-container .live-dot{animation:live-pulse 1.2s ease-in-out infinite;background:#3b82f6;background:var(--accent);border-radius:50%;height:8px;width:8px}.dispatch-container .live-dot.ready{animation:none;background:#22c55e;background:var(--success)}.dispatch-container .live-dot.error{animation:none;background:#ef4444}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.dispatch-container .date-chip{align-items:stretch;background:#fff;border:1px solid #0f172a14;border-radius:12px;box-shadow:0 1px 2px #0f172a0a,0 4px 12px #0f172a0f;display:inline-flex;gap:0;position:relative;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.dispatch-container .date-chip.is-open{border-color:#6366f1;box-shadow:0 0 0 3px #6366f133,0 12px 30px #6366f138}.dispatch-container .date-chip:hover{border-color:#6366f173;box-shadow:0 2px 4px #0f172a0f,0 8px 22px #6366f126;transform:translateY(-1px)}.dispatch-container .date-chip:focus-within{border-color:#6366f1;box-shadow:0 0 0 3px #6366f133,0 8px 22px #6366f138}.dispatch-container .date-chip-main{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:10px;min-width:0;padding:8px 18px;position:relative;text-align:left}.dispatch-container .date-chip-main:focus{outline:none}.dispatch-container .date-chip-main:hover{background:#6366f10a}.dispatch-container .date-chip-icon{align-items:center;background:linear-gradient(135deg,#eef2ff,#e0e7ff);border-radius:8px;color:#4338ca;display:inline-flex;flex-shrink:0;font-size:15px;height:28px;justify-content:center;width:28px}.dispatch-container .date-chip-text{align-items:flex-start;display:flex;flex-direction:column;gap:2px;line-height:1.1;min-width:0}.dispatch-container .date-chip-label{color:#94a3b8;font-size:10px;gap:6px;letter-spacing:.08em}.dispatch-container .date-chip-label,.dispatch-container .date-chip-today-pill{align-items:center;display:inline-flex;font-weight:800;text-transform:uppercase}.dispatch-container .date-chip-today-pill{background:linear-gradient(135deg,#6366f1,#3b82f6);border-radius:999px;box-shadow:0 2px 6px #6366f159;color:#fff;font-size:9px;letter-spacing:.06em;padding:1px 6px}.dispatch-container .date-chip-value{color:#0f172a;font-size:13px;font-weight:700;letter-spacing:.01em;white-space:nowrap}.dispatch-container .date-chip-chevron{align-items:center;color:#94a3b8;display:inline-flex;font-size:18px;justify-content:center;margin-left:2px;transition:color .18s ease,transform .18s ease}.dispatch-container .date-chip-main:hover .date-chip-chevron{color:#4338ca}.dispatch-container .date-chip-chevron.is-open{color:#4338ca;transform:rotate(180deg)}.dispatch-container .date-cal-popover{animation:date-cal-in .18s cubic-bezier(.4,0,.2,1);background:#fff;border:1px solid #0f172a14;border-radius:16px;box-shadow:0 18px 44px #0f172a2e,0 4px 12px #0f172a0f;padding:14px 14px 10px;position:absolute;right:0;top:calc(100% + 10px);width:304px;z-index:1000}.dispatch-container .date-cal-popover:after,.dispatch-container .date-cal-popover:before{border-left:8px solid #0000;border-right:8px solid #0000;bottom:100%;content:"";height:0;position:absolute;right:28px;width:0}.dispatch-container .date-cal-popover:before{border-bottom:8px solid #0f172a14}.dispatch-container .date-cal-popover:after{border-bottom:8px solid #fff;margin-bottom:-1px}@keyframes date-cal-in{0%{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .date-cal-header{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:10px}.dispatch-container .date-cal-title{color:#0f172a;flex:1 1;font-size:14px;font-weight:800;letter-spacing:.01em;text-align:center}.dispatch-container .date-cal-nav{align-items:center;-webkit-appearance:none;appearance:none;background:#f8fafce6;border:0;border-radius:8px;color:#475569;cursor:pointer;display:inline-flex;font-size:18px;height:30px;justify-content:center;transition:background .15s ease,color .15s ease;width:30px}.dispatch-container .date-cal-nav:hover:not(:disabled){background:#6366f11a;color:#4338ca}.dispatch-container .date-cal-nav:disabled{cursor:not-allowed;opacity:.35}.dispatch-container .date-cal-grid,.dispatch-container .date-cal-weekdays{grid-gap:2px;display:grid;gap:2px;grid-template-columns:repeat(7,1fr)}.dispatch-container .date-cal-weekdays{margin-bottom:4px}.dispatch-container .date-cal-weekday{color:#94a3b8;font-size:10px;font-weight:800;letter-spacing:.06em;padding:4px 0;text-align:center;text-transform:uppercase}.dispatch-container .date-cal-day{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:9px;color:#0f172a;cursor:pointer;display:inline-flex;font-size:13px;font-weight:600;height:36px;justify-content:center;transition:background .12s ease,color .12s ease,box-shadow .18s ease,transform .12s ease}.dispatch-container .date-cal-day:hover:not(:disabled):not(.is-selected){background:#6366f11a;color:#4338ca}.dispatch-container .date-cal-day.is-other-month{color:#cbd5e1;font-weight:500}.dispatch-container .date-cal-day.is-today{box-shadow:inset 0 0 0 1.5px #6366f18c;color:#4338ca;font-weight:800}.dispatch-container .date-cal-day.is-selected{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 4px 12px #6366f159;color:#fff;font-weight:800}.dispatch-container .date-cal-day.is-selected.is-today{box-shadow:0 4px 12px #6366f159}.dispatch-container .date-cal-day.is-selected:hover{box-shadow:0 6px 16px #6366f173;transform:translateY(-1px)}.dispatch-container .date-cal-day.is-disabled{color:#e2e8f0;cursor:not-allowed;pointer-events:none}.dispatch-container .date-cal-day:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .date-cal-presets{border-top:1px solid #0f172a0f;display:flex;gap:6px;margin-top:10px;padding-top:10px}.dispatch-container .date-cal-preset{-webkit-appearance:none;appearance:none;background:#fff;border:1px solid #0f172a14;border-radius:9px;color:#475569;cursor:pointer;flex:1 1;font-size:11px;font-weight:700;letter-spacing:.02em;padding:7px 10px;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .12s ease}.dispatch-container .date-cal-preset:hover{background:#6366f114;border-color:#6366f159;color:#4338ca;transform:translateY(-1px)}.dispatch-container .date-cal-preset:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .date-chip-nav{align-items:center;-webkit-appearance:none;appearance:none;background:#f8fafcb3;border:0;border-left:1px solid #0f172a0f;border-right:1px solid #0f172a0f;color:#64748b;cursor:pointer;display:inline-flex;font-size:18px;justify-content:center;transition:background .15s ease,color .15s ease;width:34px}.dispatch-container .date-chip-nav:first-child{border-left:0;border-radius:11px 0 0 11px;border-right:1px solid #0f172a0f}.dispatch-container .date-chip-nav:last-child{border-left:1px solid #0f172a0f;border-radius:0 11px 11px 0;border-right:0}.dispatch-container .date-chip-nav:hover:not(:disabled){background:#6366f114;color:#4338ca}.dispatch-container .date-chip-nav:disabled{cursor:not-allowed;opacity:.4}.dispatch-container .date-chip-nav:focus-visible{outline:2px solid #6366f180;outline-offset:-2px}.dispatch-container #batch-row{align-items:center;background:#f8fafc;background:var(--bg-sub);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-shrink:0;gap:12px;min-width:0;padding:12px 24px}.dispatch-container .batch-scroll{-webkit-overflow-scrolling:touch;align-items:center;display:flex;flex:1 1;gap:10px;min-width:0;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scroll-behavior:smooth;scrollbar-color:#64748b66 #0000;scrollbar-width:thin}.dispatch-container .batch-scroll::-webkit-scrollbar{height:6px}.dispatch-container .batch-scroll::-webkit-scrollbar-track{background:#0000}.dispatch-container .batch-scroll::-webkit-scrollbar-thumb{background:#64748b4d;border-radius:999px}.dispatch-container .batch-scroll::-webkit-scrollbar-thumb:hover{background:#64748b8c}.dispatch-container .batch-label{color:#64748b;color:var(--text-muted);flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.08em;margin-right:4px;text-transform:uppercase}.dispatch-container .time-field-wrap{display:inline-block;flex-shrink:0;margin-right:4px;position:relative}.dispatch-container .time-field-btn{align-items:center;background:#7b1fa214;border:1px solid #7b1fa240;border-radius:999px;color:#7b1fa2;cursor:pointer;display:inline-flex;font-family:inherit;font-size:12.5px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:7px 12px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.dispatch-container .time-field-btn:hover{background:#7b1fa224;border-color:#7b1fa273}.dispatch-container .time-field-btn.open{background:#7b1fa22e;border-color:#7b1fa28c;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .time-field-btn svg{flex-shrink:0;font-size:13px}.dispatch-container .time-field-caret{font-size:15px;transition:transform .2s ease}.dispatch-container .time-field-btn.open .time-field-caret{transform:rotate(180deg)}.dispatch-container .time-field-text{white-space:nowrap}.dispatch-container .time-field-menu{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:12px;box-shadow:0 16px 36px #0f172a29;left:0;min-width:180px;padding:6px;position:absolute;top:calc(100% + 6px);z-index:1000}.dispatch-container .time-field-option{align-items:center;background:#0000;border:0;border-radius:8px;color:#1e293b;cursor:pointer;display:flex;font-family:inherit;font-size:12px;font-weight:600;gap:8px;padding:8px 10px;text-align:left;transition:background .12s ease;width:100%}.dispatch-container .time-field-option:hover{background:#7b1fa20f}.dispatch-container .time-field-option.active{background:#7b1fa21a;color:#7b1fa2}.dispatch-container .time-field-option-icon{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .time-field-option-check{color:#7b1fa2;font-weight:800;margin-left:auto}.dispatch-container .slot-edit-wrap{display:inline-block;flex-shrink:0;margin-right:4px;position:relative}.dispatch-container .slot-edit-btn{align-items:center;background:#0f172a0a;border:1px dashed #0f172a2e;border-radius:999px;color:#475569;cursor:pointer;display:inline-flex;font-family:inherit;font-size:12.5px;font-weight:700;gap:6px;letter-spacing:.02em;line-height:1;padding:7px 12px}.dispatch-container .slot-edit-btn:hover{background:#0f172a14;border-color:#0f172a52;color:#0f172a}.dispatch-container .slot-edit-btn.open{background:#7b1fa21a;border-color:#7b1fa280;border-style:solid;color:#7b1fa2}.dispatch-container .slot-edit-btn svg{flex-shrink:0;font-size:13px}.dispatch-container .slot-edit-panel{animation:logo-city-menu-in .14s ease-out;background:#fff;border:1px solid #7b1fa22e;border-radius:14px;box-shadow:0 20px 44px #0f172a33;left:0;min-width:340px;padding:12px;position:absolute;top:calc(100% + 6px);z-index:1000}.dispatch-container .slot-edit-head{margin-bottom:10px}.dispatch-container .slot-edit-title{color:#0f172a;font-size:13px;font-weight:800}.dispatch-container .slot-edit-sub{color:#64748b;font-size:11px;margin-top:2px}.dispatch-container .slot-edit-list{display:flex;flex-direction:column;gap:8px;max-height:260px;overflow-y:auto;padding-right:2px}.dispatch-container .slot-edit-row{grid-gap:8px;align-items:center;display:grid;gap:8px;grid-template-columns:22px 70px 70px 1fr 28px}.dispatch-container .slot-edit-idx{align-items:center;background:#7b1fa21f;border-radius:6px;color:#7b1fa2;display:inline-flex;font-size:11px;font-weight:800;height:22px;justify-content:center;width:22px}.dispatch-container .slot-edit-field{display:flex;flex-direction:column;gap:2px}.dispatch-container .slot-edit-field-label{color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .slot-edit-field input{background:#fff;border:1px solid #0f172a29;border-radius:8px;color:#0f172a;font-family:inherit;font-size:12px;font-weight:700;padding:5px 8px;width:100%}.dispatch-container .slot-edit-field input:focus{border-color:#7b1fa2;box-shadow:0 0 0 3px #7b1fa22e;outline:none}.dispatch-container .slot-edit-preview{color:#475569;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .slot-edit-remove{align-items:center;background:#dc26260f;border:1px solid #dc262652;border-radius:50%;color:#dc2626;cursor:pointer;display:inline-flex;font-size:16px;font-weight:800;height:26px;justify-content:center;line-height:1;padding:0;width:26px}.dispatch-container .slot-edit-remove:hover:not(:disabled){background:#dc262624;border-color:#dc26268c}.dispatch-container .slot-edit-remove:disabled{cursor:not-allowed;opacity:.4}.dispatch-container .slot-edit-actions{border-top:1px dashed #0f172a1a;display:flex;gap:8px;margin-top:12px;padding-top:10px}.dispatch-container .slot-edit-add,.dispatch-container .slot-edit-reset{border:1px solid #0000;border-radius:8px;cursor:pointer;flex:1 1;font-family:inherit;font-size:11px;font-weight:700;letter-spacing:.02em;padding:7px 10px}.dispatch-container .slot-edit-add{background:#7b1fa2;border-color:#7b1fa2;color:#fff}.dispatch-container .slot-edit-add:hover{background:#6a1591}.dispatch-container .slot-edit-reset{background:#fff;border-color:#0f172a29;color:#475569}.dispatch-container .slot-edit-reset:hover{background:#0f172a0a;color:#0f172a}.dispatch-container .batch-btn{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:inherit;font-size:13.5px;font-weight:600;gap:8px;padding:8px 16px;transition:all .15s cubic-bezier(.4,0,.2,1);white-space:nowrap}.dispatch-container .batch-btn:hover{border-color:#64748b;border-color:var(--text-muted);color:#1e293b;color:var(--text)}.dispatch-container .batch-btn.active{border-color:#0000;box-shadow:0 4px 12px #0000001f;color:#fff}.dispatch-container .batch-btn.batch-slot.active{background:linear-gradient(135deg,#3b82f6,#6366f1)}.dispatch-container .batch-btn-icon{font-size:14px;line-height:1}.dispatch-container .batch-btn-label{letter-spacing:.01em}.dispatch-container .batch-btn-count{font-feature-settings:"tnum";align-items:center;background:#f8fafc;background:var(--bg-sub);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:800;height:20px;justify-content:center;min-width:24px;padding:0 7px}.dispatch-container .batch-btn.active .batch-btn-count{background:#ffffff47;color:#fff}.dispatch-container .status-chip{border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em;padding:3px 8px;text-transform:uppercase}.dispatch-container .status-chip,.dispatch-container .step-flag{align-items:center;display:inline-flex;flex-shrink:0;margin-left:8px}.dispatch-container .step-flag{gap:5px}.dispatch-container .step-flag-svg{filter:drop-shadow(0 1px 1px rgba(0,0,0,.15));flex-shrink:0;height:18px;width:14px}.dispatch-container .step-flag-label{font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}.dispatch-container .cmark{display:block;height:100%;position:relative;width:100%}.dispatch-container .cmark.pulse{animation:cmark-pulse .8s ease-out infinite;z-index:1500!important}@keyframes cmark-pulse{0%{filter:drop-shadow(0 2px 4px rgba(59,130,246,.4));transform:scale(1)}50%{filter:drop-shadow(0 4px 8px rgba(59,130,246,.7));transform:scale(1.2)}to{filter:drop-shadow(0 2px 4px rgba(59,130,246,.4));transform:scale(1)}}.dispatch-container .cmark .cmark-flag{display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25));height:100%;pointer-events:none;width:100%}.dispatch-container .cmark.is-rider-focused{align-items:center;border:3px solid #fff;border-radius:50%;box-shadow:0 4px 12px #0006;color:#fff;display:flex;font-weight:800;justify-content:center;letter-spacing:.02em;position:relative}.dispatch-container .cmark.is-rider-focused .cmark-flag{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35));height:22px;left:50%;pointer-events:none;position:absolute;top:-20px;transform:translateX(-2px);width:18px}.dispatch-container .cmark.is-rider-focused.pulse{animation:cmark-focused-pulse .8s ease-out infinite;z-index:1500!important}@keyframes cmark-focused-pulse{0%{box-shadow:0 0 0 0 #3b82f68c,0 4px 12px #0006;transform:scale(1)}70%{box-shadow:0 0 0 14px #3b82f600,0 4px 12px #0006;transform:scale(1.18)}to{box-shadow:0 0 0 0 #3b82f600,0 4px 12px #0006;transform:scale(1)}}.dispatch-container .live-rider-pin{--pin-color:#16a34a;height:41px;position:relative;width:24px}.dispatch-container .live-rider-pin-marker{background:var(--pin-color);border:3px solid #fff;border-radius:50% 50% 50% 0;box-shadow:0 4px 10px #0000004d;height:24px;left:0;position:absolute;top:0;transform:rotate(-45deg);width:24px}.dispatch-container .live-rider-pin-marker:after{background:#fff;border-radius:50%;content:"";inset:4px;position:absolute}.dispatch-container .live-rider-pin-label{background:var(--pin-color);border-radius:4px;box-shadow:0 2px 6px #00000040;color:#fff;font-size:11px;font-weight:700;left:30px;line-height:1.2;padding:3px 8px;position:absolute;top:2px;white-space:nowrap}.dispatch-container .live-rider-pin-label span{font-weight:500;margin-left:4px;opacity:.85}.dispatch-container #body{display:flex;flex:1 1;min-height:0;overflow:hidden;position:relative}.dispatch-container #sidebar{background:#f8fafc;background:var(--bg-sub);border-right:1px solid #e2e8f0;border-right:1px solid var(--border);display:flex;flex:0 0 400px;flex-direction:column;overflow:hidden;transition:width .32s cubic-bezier(.4,0,.2,1),flex-basis .32s cubic-bezier(.4,0,.2,1),border-right-color .2s ease;width:400px;z-index:5}.dispatch-container #body.sidebar-collapsed #sidebar{border-right-color:#0000;flex:0 0;width:0}.dispatch-container .sidebar-toggle-tab{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:10px;box-shadow:0 4px 12px #0f172a1f,0 1px 3px #0f172a0f;color:#1e293b;color:var(--text,#0f172a);cursor:pointer;display:inline-flex;font-size:18px;height:56px;justify-content:center;left:400px;line-height:1;padding:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:left .32s cubic-bezier(.4,0,.2,1),background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;width:22px;z-index:1200}.dispatch-container .sidebar-toggle-tab:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 6px 16px #6366f159;color:#fff;transform:translate(-50%,-50%) scale(1.06)}.dispatch-container .sidebar-toggle-tab:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent,#3b82f6);outline-offset:2px}.dispatch-container .sidebar-toggle-tab.is-collapsed{border-left:none;border-radius:0 10px 10px 0;left:0;transform:translateY(-50%)}.dispatch-container .sidebar-toggle-tab.is-collapsed:hover{transform:translateY(-50%) scale(1.06)}.dispatch-container .sidebar-toggle-tab svg{display:block}.dispatch-container .sb-header{background:linear-gradient(180deg,#fff,#f8fafc);background:linear-gradient(180deg,#fff 0,var(--bg-sub) 100%);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);overflow:hidden;padding:18px 18px 16px;position:relative}.dispatch-container .sb-header:before{background:radial-gradient(circle at center,#3b82f614 0,#0000 70%);background:radial-gradient(circle at center,var(--accent-soft) 0,#0000 70%);border-radius:50%;content:"";height:160px;inset:-40px -40px auto auto;pointer-events:none;position:absolute;width:160px}.dispatch-container .sb-header>*{position:relative}.dispatch-container .sb-header-top{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:12px}.dispatch-container .sb-header-title{align-items:center;display:inline-flex;gap:8px}.dispatch-container .sb-title-bar{background:linear-gradient(180deg,#3b82f6,#6366f1);background:linear-gradient(180deg,var(--accent),#6366f1);border-radius:2px;display:inline-block;height:14px;width:3px}.dispatch-container .sb-title-text{color:#1e293b;color:var(--text);font-size:12px;font-weight:800;letter-spacing:.12em}.dispatch-container .sb-header-scope{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);display:inline-flex;font-size:9px;font-weight:800;gap:5px;letter-spacing:.08em;max-width:60%;overflow:hidden;padding:3px 9px;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .sb-scope-dot{background:#22c55e;background:var(--success);border-radius:50%;box-shadow:0 0 0 2px #22c55e2e;flex-shrink:0;height:6px;width:6px}.dispatch-container .sb-header-area{align-items:center;background:#3b82f614;background:var(--accent-soft);border:1px solid #3b82f638;border-radius:999px;color:#3b82f6;color:var(--accent);display:inline-flex;font-size:11px;font-weight:700;gap:6px;margin-bottom:14px;padding:4px 10px 4px 8px}.dispatch-container .sb-area-icon{align-items:center;display:inline-flex;font-size:14px;line-height:1}.dispatch-container .sb-header-tiles{grid-gap:10px;display:grid;gap:10px;grid-template-columns:1fr 1fr}.dispatch-container .sb-tile{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;box-shadow:0 2px 6px #0f172a0a;display:flex;gap:10px;padding:10px 12px;transition:transform .18s ease,box-shadow .18s ease}.dispatch-container .sb-tile:hover{box-shadow:0 6px 14px #0f172a0f;transform:translateY(-1px)}.dispatch-container .sb-tile-icon{align-items:center;border-radius:10px;display:inline-flex;flex-shrink:0;font-size:18px;height:32px;justify-content:center;width:32px}.dispatch-container .sb-tile-orders .sb-tile-icon{background:#3b82f614;background:var(--accent-soft);color:#3b82f6;color:var(--accent)}.dispatch-container .sb-tile-riders .sb-tile-icon{background:#f59e0b1f;color:#f59e0b;color:var(--kitchen)}.dispatch-container .sb-tile-body{line-height:1.1;min-width:0}.dispatch-container .sb-tile-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.01em}.dispatch-container .sb-tile-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container #stats-strip{grid-gap:12px;background:#fff;background:var(--bg);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:grid;gap:12px;grid-template-columns:repeat(2,1fr);padding:16px}.dispatch-container .sc{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;padding:12px}.dispatch-container .sc-lbl{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.05em;margin-bottom:4px;text-transform:uppercase}.dispatch-container .sc-val{color:#1e293b;color:var(--text);font-size:22px;font-weight:800;line-height:1}.dispatch-container .sc-val.g{color:#22c55e;color:var(--success)}.dispatch-container .sc-sub{color:#64748b;color:var(--text-muted);font-size:11px;margin-top:4px}.dispatch-container #riders-panel{flex:1 1;overflow-y:auto;padding:16px}.dispatch-container .ph{align-items:center;color:#64748b;color:var(--text-muted);display:flex;font-size:11px;font-weight:700;gap:12px;letter-spacing:.05em;margin-bottom:16px;text-transform:uppercase}.dispatch-container .ph:after{background:#e2e8f0;background:var(--border);content:"";flex:1 1;height:1px}.dispatch-container .rcard{background:#fff;background:var(--bg-card);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:14px;box-shadow:0 4px 12px #0000000d;box-shadow:var(--shadow);cursor:pointer;margin-bottom:12px;padding:16px;transition:all .2s cubic-bezier(.4,0,.2,1)}.dispatch-container .rcard:hover{border-color:#3b82f6;border-color:var(--accent);box-shadow:0 10px 25px -5px #00000014;box-shadow:var(--shadow-lg);transform:translateY(-2px)}.dispatch-container .rcard-top{align-items:center;display:flex;gap:12px;margin-bottom:12px}.dispatch-container .kitchen-mark{box-shadow:0 0 20px #f59e0b99,0 0 40px #f59e0b4d;font-size:14px;font-weight:800;height:34px;width:34px}.dispatch-container .rcard-info{flex:1 1}.dispatch-container .rcard-emo{align-items:center;border:1.5px solid #e2e8f0;border:1.5px solid var(--border);border-radius:10px;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.dispatch-container .rcard-name{color:#1e293b;color:var(--text);font-size:15px;font-weight:700}.dispatch-container .rcard-zone{color:#64748b;color:var(--text-muted);font-size:12px;margin-top:2px}.dispatch-container .rcard-badge{font-feature-settings:"tnum","tnum";background:#f8fafc;background:var(--bg-sub);border-radius:8px;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;padding:4px 10px;white-space:nowrap}.dispatch-container .rcard-badge.is-done{background:#16a34a1f;color:#16a34a}.dispatch-container .bar-bg{background:#f8fafc;background:var(--bg-sub);border-radius:4px;height:5px;margin-bottom:12px;overflow:hidden}.dispatch-container .bar-fg{border-radius:4px;height:100%}.dispatch-container .rcard-meta{color:#64748b;color:var(--text-muted);display:flex;font-size:12px;font-weight:500;justify-content:space-between}.dispatch-container .step-ids{display:flex;flex-wrap:wrap;gap:4px;margin-top:10px}.dispatch-container .step-id{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:4px;color:#64748b;color:var(--text-muted);font-size:10px;font-weight:700;padding:2px 6px}.dispatch-container .zone-order-change-rider{align-items:center;align-self:flex-start;background:#fff;border:1px solid #e2e8f0;border-radius:7px;color:#4f46e5;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:15px;height:26px;justify-content:center;margin-left:6px;transition:background .15s,color .15s,border-color .15s;width:26px}.dispatch-container .zone-order-change-rider:hover{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}.dispatch-container #route-detail{background:#fff;background:var(--bg);flex:1 1;overflow-y:auto;padding:20px}.dispatch-container .rd-back{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;color:#1e293b;color:var(--text);cursor:pointer;font-size:12px;font-weight:600;margin-bottom:20px;padding:8px 16px;transition:all .2s}.dispatch-container .rd-back:hover{background:#e2e8f0;background:var(--border)}.dispatch-container .rd-rider-name{font-size:28px;font-weight:800;letter-spacing:-.02em;line-height:1.1;margin-bottom:6px}.dispatch-container .rd-rider-sub{color:#64748b;color:var(--text-muted);display:flex;font-size:13px;gap:16px;margin-bottom:24px}.dispatch-container .rd-stats-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(3,1fr);margin:14px 0 22px}.dispatch-container .rd-stat{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;padding:14px 10px 12px;text-align:center;transition:transform .15s,box-shadow .15s}.dispatch-container .rd-stat:hover{box-shadow:0 4px 10px #0000000d;transform:translateY(-1px)}.dispatch-container .rd-stat-icon{font-size:18px;line-height:1;margin-bottom:6px;opacity:.9}.dispatch-container .rd-stat-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.02em;line-height:1}.dispatch-container .rd-stat-unit{font-size:12px;font-weight:700;margin-left:3px;opacity:.7}.dispatch-container .rd-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:800;letter-spacing:.08em;margin-top:6px;text-transform:uppercase}.dispatch-container .rd-stat-orders{background:linear-gradient(135deg,#3b82f617,#6366f10a);border-color:#3b82f638}.dispatch-container .rd-stat-orders .rd-stat-value{color:#2563eb}.dispatch-container .rd-stat-distance{background:linear-gradient(135deg,#f59e0b1a,#f973160a);border-color:#f59e0b40}.dispatch-container .rd-stat-distance .rd-stat-value{color:#d97706}.dispatch-container .rd-stat-profit.is-gain{background:linear-gradient(135deg,#22c55e1f,#14b8a60a);border-color:#22c55e59}.dispatch-container .rd-stat-profit.is-gain .rd-stat-value{color:#16a34a}.dispatch-container .rd-stat-profit.is-gain .rd-stat-label{color:#16a34a;opacity:.75}.dispatch-container .rd-stat-profit.is-loss{background:linear-gradient(135deg,#ef44441f,#f43f5e0a);border-color:#ef444459}.dispatch-container .rd-stat-profit.is-loss .rd-stat-value{color:#dc2626}.dispatch-container .rd-stat-profit.is-loss .rd-stat-label{color:#dc2626;opacity:.75}.dispatch-container .trip-block{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:16px;margin-bottom:24px;overflow:hidden}.dispatch-container .trip-header{align-items:center;background:#fff;border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-start;padding:10px 14px}.dispatch-container .th-badge{border-radius:6px;color:#fff;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.02em;padding:4px 10px}.dispatch-container .trip-stats{color:#64748b;color:var(--text-muted);display:flex;flex-shrink:0;font-size:12px;font-weight:600;gap:10px}.dispatch-container .trip-sort-toggle{align-items:stretch;background:#f1f5f9;border-radius:10px;display:flex;flex-basis:100%;isolation:isolate;margin-left:0;padding:3px;position:relative;width:100%}.dispatch-container .trip-sort-pill{align-items:center;-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:7px;color:#64748b;cursor:pointer;display:inline-flex;flex:1 1;font-size:11.5px;font-weight:600;gap:6px;justify-content:center;letter-spacing:.01em;line-height:1;min-height:28px;padding:6px 10px;transition:color .18s ease,background .18s ease,box-shadow .18s ease;white-space:nowrap}.dispatch-container .trip-sort-pill svg{color:#94a3b8;display:block;flex:0 0 auto;height:14px;transition:color .18s ease,transform .18s ease;width:14px}.dispatch-container .trip-sort-pill:hover:not(.is-active){color:#0f172a}.dispatch-container .trip-sort-pill:hover:not(.is-active) svg{color:#475569}.dispatch-container .trip-sort-pill:focus-visible{box-shadow:0 0 0 2px #6366f166;outline:none}.dispatch-container .trip-sort-pill.is-active{background:#fff;box-shadow:0 1px 2px #0f172a14,0 0 0 1px #0f172a0a,0 2px 6px #0f172a0f;color:#0f172a}.dispatch-container .trip-sort-toggle[data-mode=planned] .trip-sort-pill.is-active svg{color:#6366f1}.dispatch-container .trip-sort-toggle[data-mode=time] .trip-sort-pill.is-active svg{color:#10b981}.dispatch-container .zone-order-card.is-pending-time{opacity:.72}.dispatch-container .step-wrap{padding:16px}.dispatch-container .step-row{border-radius:8px;display:flex;gap:16px;padding-bottom:20px;position:relative;transition:background .15s ease,box-shadow .15s ease}.dispatch-container .step-row.clickable{cursor:pointer}.dispatch-container .step-row.clickable:hover{background:#6366f10f}.dispatch-container .step-row.clickable:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent);outline-offset:2px}.dispatch-container .step-row.active{background:#6366f11a;box-shadow:inset 3px 0 0 #6366f1;margin-left:-8px;padding-left:8px}.dispatch-container .step-row:not(:last-child):before{background:#e2e8f0;background:var(--border);bottom:0;content:"";left:15px;position:absolute;top:32px;width:2px}.dispatch-container .step-dot{align-items:center;border-radius:50%;display:flex;flex-shrink:0;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px;z-index:2}.dispatch-container .step-dot.kitchen{background:#f59e0b;background:var(--kitchen);color:#fff}.dispatch-container .step-dot.delivery{background:#fff;border:2px solid #e2e8f0;border:2px solid var(--border);color:#64748b;color:var(--text-muted)}.dispatch-container .step-label{font-size:15px;font-weight:700}.dispatch-container .step-label-row{align-items:flex-start;display:flex}.dispatch-container .step-customer{flex:1 1;line-height:1.35;min-width:0;overflow-wrap:anywhere;word-break:break-word}.dispatch-container .kitchen-tag{color:#f59e0b;color:var(--kitchen)}.dispatch-container .step-dest{color:#64748b;color:var(--text-muted);font-size:13px;margin-top:3px}.dispatch-container .step-detail{display:flex;flex-wrap:wrap;font-size:13px;font-weight:600;gap:10px;margin-top:6px}.dispatch-container .step-profit{color:#22c55e;color:var(--success)}.dispatch-container .step-profit.is-loss{color:#dc2626}.dispatch-container .step-location{font-weight:500}.dispatch-container .step-location,.dispatch-container .step-notes{color:#64748b;color:var(--text-muted);font-size:11px;margin-top:3px}.dispatch-container .step-notes{background:#f59e0b14;border-left:2px solid #f59e0b99;border-radius:4px;font-style:italic;max-width:100%;overflow:hidden;padding:4px 8px;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .step-charges{color:#0074e7;font-weight:600}.dispatch-container .step-type{border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.04em;padding:2px 7px;text-transform:uppercase}.dispatch-container .step-type.type-economy{background:#22c55e26;color:#16a34a}.dispatch-container .step-type.type-risky{background:#ef444426;color:#dc2626}.dispatch-container .step-type.type-express{background:#3b82f626;color:#2563eb}.dispatch-container .step-type:not(.type-economy):not(.type-risky):not(.type-express){background:#64748b26;color:#475569}.dispatch-container .rcard.zone-card{background:linear-gradient(180deg,#fff,#fafbff);overflow:hidden;padding:14px 14px 12px;position:relative}.dispatch-container .rcard.zone-card:before{background:linear-gradient(180deg,#3b82f6,#6366f1);content:"";height:100%;left:0;opacity:.55;position:absolute;top:0;transition:opacity .2s,width .2s;width:3px}.dispatch-container .rcard.zone-card:hover{background:linear-gradient(180deg,#fff,#f0f7ff);border-color:#3b82f680;box-shadow:0 8px 22px #3b82f61f}.dispatch-container .rcard.zone-card:hover:before{opacity:1;width:4px}.dispatch-container .zone-card-header{align-items:center;display:flex;gap:10px;margin-bottom:12px}.dispatch-container .zone-card-emoji{align-items:center;background:linear-gradient(135deg,#3b82f61f,#6366f124);border:1px solid #3b82f638;border-radius:10px;display:flex;flex-shrink:0;font-size:18px;height:36px;justify-content:center;width:36px}.dispatch-container .zone-card-titles{flex:1 1;min-width:0}.dispatch-container .zone-card-name{color:#1e293b;color:var(--text);font-size:15px;font-weight:800;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-card-sub{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:500;margin-top:2px}.dispatch-container .zone-card-arrow{color:#3b82f6;color:var(--accent);flex-shrink:0;font-size:18px;font-weight:800;opacity:.4;transition:transform .2s,opacity .2s}.dispatch-container .rcard.zone-card:hover .zone-card-arrow{opacity:1;transform:translateX(4px)}.dispatch-container .zone-progress-row{align-items:center;display:flex;gap:10px;margin:10px 0 4px}.dispatch-container .zone-progress-row .zone-status-bar{flex:1 1;height:6px;margin:0}.dispatch-container .zone-progress-label{font-feature-settings:"tnum";color:#64748b;color:var(--text-muted);font-size:10px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:.02em;white-space:nowrap}.dispatch-container .zone-stat-pills{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.dispatch-container .zone-stat-pill{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:8px;display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:4px 9px;transition:all .15s}.dispatch-container .zone-stat-icon{font-size:12px;opacity:.85}.dispatch-container .zone-stat-value{font-feature-settings:"tnum";color:#1e293b;color:var(--text);font-variant-numeric:tabular-nums;font-weight:800}.dispatch-container .zone-stat-label{color:#64748b;color:var(--text-muted);font-size:10px;font-weight:600}.dispatch-container .zone-stat-pill.profit-positive{background:#22c55e14;border-color:#22c55e40}.dispatch-container .zone-stat-pill.profit-positive .zone-stat-value{color:#22c55e;color:var(--success)}.dispatch-container .zone-stat-pill.profit-negative{background:#ef444414;border-color:#ef444440}.dispatch-container .zone-stat-pill.profit-negative .zone-stat-value{color:#ef4444}.dispatch-container .zone-card-suburbs{align-items:center;border-top:1px dashed #e2e8f0;border-top:1px dashed var(--border);color:#64748b;color:var(--text-muted);display:flex;font-size:11px;gap:6px;line-height:1.4;margin-top:10px;padding-top:10px}.dispatch-container .zone-card-suburbs-text{flex:1 1;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-card-suburbs-more{background:#3b82f614;background:var(--accent-soft);border-radius:999px;color:#3b82f6;color:var(--accent);flex-shrink:0;font-size:10px;font-weight:800;padding:1px 7px}.dispatch-container .zone-status-bar{background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:3px;display:flex;height:5px;margin-top:10px;overflow:hidden}.dispatch-container .zone-status-bar.tall{border-radius:4px;height:16px}.dispatch-container .zone-status-seg{align-items:center;display:flex;height:100%;justify-content:center;min-width:1px;transition:filter .2s}.dispatch-container .zone-status-bar.tall .zone-status-seg{color:#fff;font-size:10px;font-weight:800;text-shadow:0 1px 2px #0000004d}.dispatch-container .zone-status-seg:hover{filter:brightness(1.1)}.dispatch-container .zone-status-seg-label{padding:0 4px}.dispatch-container .zone-status-legend{color:#64748b;color:var(--text-muted);display:flex;flex-wrap:wrap;font-size:11px;gap:10px;margin-top:8px}.dispatch-container .legend-item{align-items:center;display:inline-flex;gap:5px}.dispatch-container .legend-item strong{color:#1e293b;color:var(--text);font-weight:700;margin-left:2px}.dispatch-container .legend-dot{border-radius:50%;flex-shrink:0;height:9px;width:9px}.dispatch-container .zone-detail-section{margin:18px 0}.dispatch-container .zone-section-label{align-items:center;color:#64748b;color:var(--text-muted);display:flex;font-size:10px;font-weight:800;gap:10px;letter-spacing:.06em;margin-bottom:10px;text-transform:uppercase}.dispatch-container .zone-section-label:after{background:#e2e8f0;background:var(--border);content:"";flex:1 1;height:1px}.dispatch-container .section-count{color:#3b82f6;color:var(--accent);font-weight:700}.dispatch-container .zone-chips{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .zone-chip{align-items:center;background:#f8fafc;background:var(--bg-sub);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-weight:600;gap:6px;padding:4px 4px 4px 10px;transition:all .15s}.dispatch-container .zone-chip:hover{background:#3b82f614;background:var(--accent-soft);border-color:#3b82f6;border-color:var(--accent)}.dispatch-container .zone-chip.kitchen{background:#f59e0b0f;border-color:#f59e0b40}.dispatch-container .zone-chip.kitchen:hover{background:#f59e0b1f;border-color:#f59e0b80}.dispatch-container .zone-chip-name{white-space:nowrap}.dispatch-container .zone-chip-count{align-items:center;background:#3b82f6;background:var(--accent);border-radius:999px;color:#fff;display:inline-flex;font-size:10px;font-weight:800;height:18px;justify-content:center;min-width:20px;padding:0 6px}.dispatch-container .zone-chip-count.kitchen{background:#f59e0b;background:var(--kitchen)}.dispatch-container .zone-chip.zone-chip-clickable{cursor:pointer;font-family:inherit}.dispatch-container .zone-chip.zone-chip-clickable.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 2px 8px #3b82f640;color:#fff}.dispatch-container .zone-chip.zone-chip-clickable.active .zone-chip-count{background:#ffffff40;color:#fff}.dispatch-container .zone-suburb-panel{animation:zone-suburb-panel-in .18s ease-out;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:12px;margin-top:12px;overflow:hidden}@keyframes zone-suburb-panel-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .zone-suburb-panel-head{align-items:center;background:#3b82f614;background:var(--accent-soft);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border);display:flex;gap:8px;justify-content:space-between;padding:10px 14px}.dispatch-container .zone-suburb-panel-title{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:13px;font-weight:800;gap:6px;letter-spacing:-.01em}.dispatch-container .zone-suburb-panel-count{background:#3b82f6;background:var(--accent);border-radius:999px;color:#fff;font-size:10px;font-weight:800;letter-spacing:.04em;margin-left:6px;padding:2px 8px}.dispatch-container .zone-suburb-panel-close{background:#0f172a0f;border:none;border-radius:50%;color:#64748b;color:var(--text-muted);cursor:pointer;font-size:18px;font-weight:700;height:24px;line-height:1;transition:all .15s;width:24px}.dispatch-container .zone-suburb-panel-close:hover{background:#ef444426;color:#dc2626}.dispatch-container .zone-suburb-panel-empty{color:#64748b;color:var(--text-muted);font-size:12px;padding:16px;text-align:center}.dispatch-container .zone-order-grid{display:flex;flex-direction:column;gap:10px;padding:4px 2px 12px}.dispatch-container .zone-order-card{background:#fff;border:1px solid #7b1fa224;border-radius:12px;box-shadow:0 1px 2px #0f172a0a;overflow:hidden;padding:12px 14px 12px 18px;position:relative;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.dispatch-container .zone-order-card:before{background:#7b1fa2;content:"";height:100%;left:0;opacity:.85;position:absolute;top:0;transition:width .18s ease,opacity .18s ease;width:4px}.dispatch-container .zone-order-card.clickable{cursor:pointer}.dispatch-container .zone-order-card.clickable:hover{border-color:#7b1fa273;box-shadow:0 8px 20px #7b1fa229;transform:translateY(-1px)}.dispatch-container .zone-order-card.clickable:hover:before{opacity:1;width:5px}.dispatch-container .zone-order-card.active{background:linear-gradient(180deg,#fff,#f7eaff);border-color:#7b1fa2;box-shadow:0 10px 24px #7b1fa238}.dispatch-container .zone-order-card.active:before{opacity:1;width:6px}.dispatch-container .zone-order-card.going-on{background:linear-gradient(180deg,#fff,#ecfdf5);border-color:#22c55e66;box-shadow:0 6px 18px #22c55e26}.dispatch-container .zone-order-card.going-on:before{background:#16a34a;opacity:1}.dispatch-container .zone-order-card.going-on.active{background:linear-gradient(180deg,#fff,#d1fae5);border-color:#16a34a}.dispatch-container .zone-order-card-head{align-items:center;display:flex;gap:10px;margin-bottom:8px}.dispatch-container .zone-order-num{align-items:center;background:#7b1fa2;border:1px solid #7b1fa2;border-radius:8px;box-shadow:0 2px 6px #7b1fa238;color:#fff;display:flex;flex-shrink:0;font-size:13px;font-weight:800;height:28px;justify-content:center;width:28px}.dispatch-container .zone-order-id-block{flex:1 1;min-width:0}.dispatch-container .zone-order-id{color:#1e293b;color:var(--text);font-size:12px;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-rider{color:#7b1fa2;font-size:11px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-status{border-radius:999px;flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.04em;padding:3px 8px;text-transform:uppercase}.dispatch-container .zone-order-status-stack{align-items:flex-end;display:flex;flex-direction:column;flex-shrink:0;gap:3px}.dispatch-container .zone-order-time{font-feature-settings:"tnum";align-items:center;color:#1e293b;display:inline-flex;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;gap:4px;letter-spacing:.01em;white-space:nowrap}.dispatch-container .zone-order-time svg{color:#7b1fa2;flex-shrink:0;font-size:14px}.dispatch-container .zone-order-time.is-expected{color:#64748b;font-weight:600}.dispatch-container .zone-order-time.is-expected svg{color:#94a3b8}.dispatch-container .zone-order-est-drop{font-feature-settings:"tnum";align-items:center;color:#475569;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:600;gap:4px;white-space:nowrap}.dispatch-container .zone-order-est-drop svg{color:#0ea5e9;flex-shrink:0;font-size:13px}.dispatch-container .zone-order-customer{color:#1e293b;color:var(--text);font-size:14px;font-weight:700;letter-spacing:-.01em;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-line{color:#64748b;color:var(--text-muted);font-size:12px;line-height:1.4;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .zone-order-notes{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#475569;display:-webkit-box;font-style:italic;text-overflow:clip;white-space:normal}.dispatch-container .zone-order-stats{border-top:1px dashed #7b1fa224;display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;padding-top:10px}.dispatch-container .zone-order-chip{align-items:center;background:#7b1fa20f;border:1px solid #7b1fa224;border-radius:999px;color:#1e293b;color:var(--text);display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:4px 8px}.dispatch-container .zone-order-chip.is-profit{background:#22c55e1a;border-color:#22c55e40;color:#16a34a}.dispatch-container .zone-order-chip.is-loss{background:#ef44441a;border-color:#ef444440;color:#dc2626}.dispatch-container .zone-order-chip.zone-order-trip{background:#7b1fa21a;border-color:#7b1fa240;color:#7b1fa2}.dispatch-container .zone-order-type{letter-spacing:.05em;text-transform:uppercase}.dispatch-container .kitchen-transition{background:#f59e0b1a;background:var(--kitchen-soft);border:1px dashed #f59e0b;border:1px dashed var(--kitchen);border-radius:10px;font-size:12px;font-weight:600;margin:8px 0 20px 40px;padding:12px}.dispatch-container .zone-order-grid .kitchen-transition{margin:2px 0;padding:8px 12px}.dispatch-container #map-wrap{flex:1 1;position:relative;transition:flex .32s cubic-bezier(.4,0,.2,1)}.dispatch-container #map-wrap.compare-split{border-radius:0 14px 14px 0;border-right:0;box-shadow:0 0 0 1px #0f172a0f;flex-basis:calc(50% - 8px);flex-grow:1;flex-shrink:1;margin-right:16px;min-width:0;overflow:hidden}.dispatch-container .compare-planned-label{align-items:center;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffff2;border:1px solid #6366f14d;border-radius:999px;box-shadow:0 4px 14px #0f172a1a;color:#4338ca;display:inline-flex;font-size:10px;font-weight:800;gap:6px;left:12px;letter-spacing:.06em;padding:5px 12px 5px 9px;pointer-events:none;position:absolute;text-transform:uppercase;top:12px;z-index:1000}.dispatch-container .compare-planned-dot{background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;flex-shrink:0;height:7px;width:7px}.dispatch-container .compare-actual-label{align-items:center;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffff2;border:1px solid #0ea5e959;border-radius:999px;box-shadow:0 4px 14px #0f172a1a;color:#0369a1;display:inline-flex;font-size:10px;font-weight:800;gap:6px;left:12px;letter-spacing:.06em;padding:5px 12px 5px 9px;pointer-events:none;position:absolute;text-transform:uppercase;top:12px;z-index:1000}.dispatch-container .compare-actual-dot{animation:compare-actual-pulse 1.6s ease-in-out infinite;background:linear-gradient(135deg,#0ea5e9,#0369a1);border-radius:50%;box-shadow:0 0 0 2px #0ea5e926;flex-shrink:0;height:7px;width:7px}@keyframes compare-actual-pulse{0%,to{box-shadow:0 0 0 2px #0ea5e926}50%{box-shadow:0 0 0 4px #0ea5e90d}}@keyframes compare-label-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.dispatch-container #compare-map-wrap{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px 0 0 14px;box-shadow:0 0 0 1px #0f172a0f;display:flex;flex-basis:calc(50% - 8px);flex-direction:column;flex-grow:1;flex-shrink:1;min-width:0;overflow:hidden;position:relative}@keyframes compare-slide-in{0%{opacity:0;transform:translateX(18px)}to{opacity:1;transform:translateX(0)}}.dispatch-container #compare-map-wrap .leaflet-container{background:#f0f4f8!important;flex:1 1;min-height:0}.dispatch-container .compare-map-area{display:flex;flex:1 1;flex-direction:column;min-height:0;position:relative}.dispatch-container .compare-ov-br{bottom:12px;display:flex;gap:8px;position:absolute;right:12px;z-index:1000}.dispatch-container .compare-header{background:linear-gradient(180deg,#fff,#f8fafc);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);flex-shrink:0;padding:10px 14px 8px}.dispatch-container .compare-header-top{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:7px}.dispatch-container .compare-title{align-items:center;color:#0f172a;display:inline-flex;font-size:12px;font-weight:800;gap:7px;letter-spacing:.01em;min-width:0}.dispatch-container .compare-title-dot{border-radius:50%;display:inline-block;flex-shrink:0;height:12px;width:12px}.dispatch-container .compare-title-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-title-badge{align-items:center;background:#0ea5e91a;border:1px solid #0ea5e940;border-radius:999px;color:#0284c7;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.07em;padding:3px 9px;text-transform:uppercase}.dispatch-container .compare-progress{align-items:center;display:flex;gap:8px}.dispatch-container .compare-progress-bar-wrap{background:#0f172a12;border-radius:999px;flex:1 1;height:3px;overflow:hidden}.dispatch-container .compare-progress-bar-fill{background:linear-gradient(90deg,#0ea5e9,#6366f1);border-radius:999px;height:100%;transition:width .45s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-progress-bar-fill.is-done{background:linear-gradient(90deg,#22c55e,#16a34a)}.dispatch-container .compare-progress-text{font-feature-settings:"tnum";color:#94a3b8;flex-shrink:0;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}.dispatch-container .compare-track-legend{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a12);flex-shrink:0;max-height:150px;overflow-y:auto;scrollbar-color:#64748b40 #0000;scrollbar-width:thin}.dispatch-container .compare-track-legend::-webkit-scrollbar{width:4px}.dispatch-container .compare-track-legend::-webkit-scrollbar-thumb{background:#64748b40;border-radius:999px}.dispatch-container .compare-track-item{align-items:center;border-bottom:1px solid #0f172a0a;display:flex;gap:9px;padding:5px 14px;transition:background .12s}.dispatch-container .compare-track-item:last-child{border-bottom:0}.dispatch-container .compare-track-item:hover{background:rgba(15,23,42,.025)}.dispatch-container .compare-track-num{align-items:center;border-radius:50%;box-shadow:0 2px 6px #0003;color:#fff;display:inline-flex;flex-shrink:0;font-size:9px;font-weight:800;height:20px;justify-content:center;width:20px}.dispatch-container .compare-track-info{flex:1 1;min-width:0}.dispatch-container .compare-track-customer{color:#1e293b;font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-track-meta{color:#94a3b8;font-size:10px;font-weight:600;margin-top:1px}.dispatch-container .compare-track-right{align-items:flex-end;display:flex;flex-direction:column;flex-shrink:0;gap:3px}.dispatch-container .compare-track-status{align-items:center;border-radius:999px;display:inline-flex;font-size:8px;font-weight:800;letter-spacing:.05em;padding:1px 6px;text-transform:uppercase}.dispatch-container .compare-track-kms{color:#64748b;font-size:10px;font-weight:700}.dispatch-container .compare-track-no-data{align-items:center;color:#cbd5e1;display:inline-flex;font-size:9px;font-weight:600;gap:4px}.dispatch-container .compare-track-spinner{animation:compare-spin .65s linear infinite;border:1.5px solid #64748b2e;border-radius:50%;border-top-color:#94a3b8;flex-shrink:0;height:9px;width:9px}@keyframes compare-spin{to{transform:rotate(1turn)}}.dispatch-container .compare-overall-card{background:linear-gradient(180deg,#fff,#f8fafc);border-top:1px solid #e2e8f0;border-top:1px solid var(--border,#0f172a12);flex-shrink:0;padding:10px 14px}.dispatch-container .compare-overall-head{align-items:center;display:flex;gap:8px;margin-bottom:9px}.dispatch-container .compare-overall-dot{border-radius:50%;flex-shrink:0;height:11px;width:11px}.dispatch-container .compare-overall-name{color:#0f172a;flex:1 1;font-size:12px;font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-overall-rate{align-items:center;background:#22c55e1a;border:1px solid #22c55e38;border-radius:999px;color:#16a34a;display:inline-flex;flex-shrink:0;font-size:9px;font-weight:800;letter-spacing:.06em;padding:2px 8px;text-transform:uppercase}.dispatch-container .compare-overall-rate.is-partial{background:#f59e0b1a;border-color:#f59e0b40;color:#b45309}.dispatch-container .compare-overall-rate.is-zero{background:#64748b14;border-color:#64748b33;color:#64748b}.dispatch-container .compare-overall-stats{grid-gap:6px;display:grid;gap:6px;grid-template-columns:repeat(5,1fr)}.dispatch-container .compare-overall-stat{background:#0f172a08;border:1px solid #0f172a0f;border-radius:10px;padding:7px 6px 6px;text-align:center;transition:background .15s,transform .15s}.dispatch-container .compare-overall-stat:hover{background:rgba(15,23,42,.055);transform:translateY(-1px)}.dispatch-container .compare-overall-stat-icon{align-items:center;color:#94a3b8;display:flex;font-size:13px;justify-content:center;line-height:1;margin-bottom:3px}.dispatch-container .compare-overall-stat-value{color:#0f172a;font-size:14px;font-weight:800;line-height:1.1}.dispatch-container .compare-overall-stat-unit{color:#94a3b8;font-size:9px;font-weight:700;margin-left:2px}.dispatch-container .compare-overall-stat-label{color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container .compare-overall-stat.is-profit{background:#22c55e0f;border-color:#22c55e29}.dispatch-container .compare-overall-stat.is-profit .compare-overall-stat-value{color:#16a34a}.dispatch-container .compare-overall-stat.is-profit .compare-overall-stat-icon{color:#22c55e}.dispatch-container .compare-overall-stat.is-loss{background:#ef44440f;border-color:#ef444429}.dispatch-container .compare-overall-stat.is-loss .compare-overall-stat-value{color:#dc2626}.dispatch-container .compare-overall-stat.is-loss .compare-overall-stat-icon{color:#ef4444}.dispatch-container .compare-header-v2{background:linear-gradient(180deg,#fff,#f8fafc);border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);display:flex;flex-direction:column;flex-shrink:0;gap:10px;padding:12px 14px 10px}.dispatch-container .compare-header-row{align-items:center;display:flex;gap:10px;min-width:0}.dispatch-container .compare-header-row .compare-title{align-items:center;color:#0f172a;display:inline-flex;flex:1 1;font-size:16px;font-weight:800;gap:10px;min-width:0}.dispatch-container .compare-header-tools{align-items:center;display:inline-flex;flex-shrink:0;gap:6px}.dispatch-container .compare-overall-btn{align-items:center;background:linear-gradient(135deg,#6366f114,#3b82f614);border:1px solid #6366f147;border-radius:999px;color:#4338ca;cursor:pointer;display:inline-flex;font-size:12px;font-weight:800;gap:6px;letter-spacing:.04em;padding:6px 12px;text-transform:uppercase;transition:all .18s ease}.dispatch-container .compare-overall-btn:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);border-color:#6366f1;box-shadow:0 4px 12px #6366f147;color:#fff;transform:translateY(-1px)}.dispatch-container .compare-overall-btn svg{font-size:15px}.dispatch-container .compare-sync-toggle{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:999px;color:#64748b;cursor:pointer;display:inline-flex;font-size:12px;font-weight:800;gap:6px;letter-spacing:.04em;padding:6px 12px;text-transform:uppercase;transition:all .18s ease}.dispatch-container .compare-sync-toggle:hover{border-color:#6366f166;color:#4338ca}.dispatch-container .compare-sync-toggle.is-on{background:linear-gradient(135deg,#22c55e,#16a34a);border-color:#16a34a;box-shadow:0 4px 10px #22c55e38;color:#fff}.dispatch-container .compare-sync-toggle svg{font-size:15px}.dispatch-container .compare-timeline-toggle{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:8px;color:#64748b;cursor:pointer;display:inline-flex;height:30px;justify-content:center;padding:0;transition:background .18s ease,color .18s ease,border-color .18s ease;width:30px}.dispatch-container .compare-timeline-toggle:hover{background:#6366f10f;border-color:#6366f166;color:#4338ca}.dispatch-container .compare-timeline-toggle svg{font-size:18px;transition:transform .22s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-timeline-toggle.is-open svg{color:#4338ca;transform:rotate(180deg)}.dispatch-container .compare-timeline-wrap{display:flex;flex-direction:column;gap:6px}.dispatch-container .compare-timeline-container{align-items:stretch;background:#0f172a05;border:1px solid #0f172a0f;border-radius:12px;box-shadow:inset 0 1px 2px #0f172a05;display:flex;gap:16px;padding:18px}.dispatch-container .compare-timeline-labels{border-right:1.5px dashed #0f172a14;display:flex;flex-direction:column;flex-shrink:0;gap:16px;justify-content:space-between;padding-right:14px}.dispatch-container .compare-timeline-label{align-items:center;color:#64748b;display:flex;font-size:11px;font-weight:800;height:32px;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .compare-timeline-scrollable{display:flex;flex:1 1;flex-direction:column;gap:16px;overflow-x:auto;padding-bottom:2px;scrollbar-color:#64748b33 #0000;scrollbar-width:thin}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar{height:4px}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-thumb{background:#64748b40;border-radius:999px}.dispatch-container .compare-timeline-track{align-items:center;display:flex;gap:0;position:relative}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:22px}.dispatch-container .compare-step-spacer{background:linear-gradient(90deg,#94a3b800,#94a3b88c 30%,#94a3b88c 70%,#94a3b800);flex-shrink:0;height:2px;width:16px}.dispatch-container .compare-step{align-items:center;background:#0000;border:0;cursor:pointer;display:inline-flex;flex-direction:column;flex-shrink:0;gap:11px;padding:2px 2px 0;position:relative;transition:transform .18s ease}.dispatch-container .compare-step:hover{transform:translateY(-1px)}.dispatch-container .compare-step-circle{align-items:center;background:#94a3b8;background:var(--step-color,#94a3b8);border-radius:50%;box-shadow:0 2px 6px #0f172a24,0 0 0 1px #fff9;color:#fff;display:inline-flex;font-size:13px;font-weight:800;height:32px;justify-content:center;transition:transform .18s ease,box-shadow .18s ease,background .18s ease;width:32px}.dispatch-container .compare-step:hover .compare-step-circle{box-shadow:0 4px 10px #0f172a33,0 0 0 1px #fff9;transform:scale(1.08)}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 4px 10px #0f172a38,0 0 0 2px #fff,0 0 0 4px #6366f1;box-shadow:0 4px 10px #0f172a38,0 0 0 2px #fff,0 0 0 4px var(--step-color,#6366f1);transform:scale(1.18)}.dispatch-container .compare-step.is-focused .compare-step-tick{color:#4338ca;color:var(--step-color,#4338ca);font-weight:800}.dispatch-container .compare-step.is-pending .compare-step-circle{background:#fff;border:2px solid #cbd5e1;border:2px solid var(--step-color,#cbd5e1);box-shadow:0 1px 3px #0f172a14;color:#94a3b8;color:var(--step-color,#94a3b8)}.dispatch-container .compare-step.is-skipped .compare-step-circle{background:#cbd5e1;opacity:.42}.dispatch-container .compare-step.is-loading .compare-step-circle{background:#fff;border:2px solid #6366f173;color:#0000}.dispatch-container .compare-step.is-no-data .compare-step-circle{background:repeating-linear-gradient(45deg,#e2e8f0 0 4px,#f1f5f9 4px 8px);color:#94a3b8}.dispatch-container .compare-step-spin{animation:compare-step-spin .7s linear infinite;border:2px solid #6366f12e;border-radius:50%;border-top-color:#6366f1;height:14px;width:14px}@keyframes compare-step-spin{to{transform:rotate(1turn)}}.dispatch-container .compare-step-tick{font-feature-settings:"tnum";color:#64748b;font-size:11px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.01em;line-height:1}.dispatch-container .compare-step-flag{background:#dc2626;border:1.5px solid #fff;border-radius:50%;box-shadow:0 2px 4px #dc262673;height:8px;position:absolute;right:-2px;top:-2px;width:8px}.dispatch-container .compare-progress-strip{align-items:center;display:flex;gap:8px}.dispatch-container .compare-legend{align-items:center;border-top:1px dashed #0f172a0f;display:flex;flex-wrap:wrap;gap:14px;padding-top:2px}.dispatch-container .compare-legend-item{align-items:center;color:#64748b;display:inline-flex;font-size:12px;font-weight:700;gap:7px;letter-spacing:.02em}.dispatch-container .compare-legend-swatch{border-radius:2px;flex-shrink:0;height:4px;width:22px}.dispatch-container .compare-legend-swatch.is-planned{background:repeating-linear-gradient(90deg,#6366f1 0 5px,#0000 5px 9px);height:3px}.dispatch-container .compare-legend-swatch.is-actual{background:linear-gradient(90deg,currentColor,currentColor);height:4px}.dispatch-container .compare-legend-swatch.is-step-color{border-radius:2px;height:4px}.dispatch-container .compare-legend-swatch.is-step-color.is-dashed{-webkit-mask-image:repeating-linear-gradient(90deg,#000 0 5px,#0000 5px 9px);mask-image:repeating-linear-gradient(90deg,#000 0 5px,#0000 5px 9px)}.dispatch-container .compare-legend-note{color:#94a3b8;font-size:11px;font-weight:700;letter-spacing:.04em;margin-left:auto;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .compare-legend-swatch.is-transit{background:repeating-linear-gradient(90deg,#94a3b8 0 3px,#0000 3px 6px);height:2px}.dispatch-container .compare-delta{animation:compare-delta-in .22s cubic-bezier(.4,0,.2,1);background:linear-gradient(180deg,#fff,#f8fafc);border-top:1px solid #e2e8f0;border-top:1px solid var(--border,#0f172a12);display:flex;flex-direction:column;flex-shrink:0;gap:10px;padding:12px 14px 14px}.dispatch-container .compare-delta.is-anomaly{background:linear-gradient(180deg,#fff,#fef2f2);border-top-color:#dc262640}@keyframes compare-delta-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .compare-delta-title{align-items:center;display:flex;gap:10px;min-width:0}.dispatch-container .compare-delta-step-badge{align-items:center;background:#6366f1;border-radius:50%;box-shadow:0 3px 10px #0f172a26,0 0 0 1px #ffffff80;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .compare-delta-step-badge svg{font-size:17px}.dispatch-container .compare-delta-title-text{flex:1 1;min-width:0}.dispatch-container .compare-delta-title-main{color:#0f172a;font-size:16px;font-weight:800;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-delta-title-sub{color:#94a3b8;font-size:13px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-delta-status{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.07em;padding:4px 11px;text-transform:uppercase}.dispatch-container .compare-delta-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(3,1fr)}.dispatch-container .compare-delta-cell{background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a14);border-radius:12px;display:flex;flex-direction:column;gap:4px;padding:11px 13px 10px;transition:transform .18s ease,box-shadow .18s ease}.dispatch-container .compare-delta-cell:hover{box-shadow:0 4px 12px #0f172a0f;transform:translateY(-1px)}.dispatch-container .compare-delta-cell.is-anomaly{background:linear-gradient(180deg,#fff,#fef2f2);border-color:#dc26266b;box-shadow:inset 0 0 0 1px #dc26262e}.dispatch-container .compare-delta-cell-label{color:#94a3b8;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.dispatch-container .compare-delta-cell-val{font-feature-settings:"tnum";color:#0f172a;font-size:22px;font-variant-numeric:tabular-nums;font-weight:800;line-height:1.15}.dispatch-container .compare-delta-cell-val.is-over{color:#dc2626}.dispatch-container .compare-delta-cell-val.is-under{color:#16a34a}.dispatch-container .compare-delta-cell-unit{color:#94a3b8;font-size:13px;font-weight:700;margin-left:2px}.dispatch-container .compare-delta-cell-sub{color:#64748b;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .compare-step-pin{align-items:center;background:#475569;background:var(--pin-color,#475569);border:3px solid #fff;border-radius:50%;box-shadow:0 4px 12px #00000052,0 0 0 1px #ffffff2e;color:#fff;cursor:pointer;display:flex;font-size:13px;font-weight:800;height:34px;justify-content:center;position:relative;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s ease;width:34px}.dispatch-container .compare-step-pin:hover{transform:scale(1.08);z-index:1200}.dispatch-container .compare-step-pin-num{line-height:1;position:relative;z-index:1}.dispatch-container .compare-step-pin.is-skipped{filter:grayscale(.6);opacity:.45}.dispatch-container .compare-step-pin.is-focused{animation:compare-pin-pulse 1.6s ease-in-out infinite;box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px #6366f1,0 0 18px 6px color-mix(in srgb,#6366f1 35%,#0000);box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px var(--pin-color,#6366f1),0 0 18px 6px color-mix(in srgb,var(--pin-color,#6366f1) 35%,#0000);transform:scale(1.22);z-index:1300}.dispatch-container .compare-step-pin.is-focused:hover{transform:scale(1.3)}.dispatch-container .compare-step-pin.is-focused:before{animation:compare-pin-halo 1.6s ease-out infinite;border:2px solid #6366f1;border:2px solid var(--pin-color,#6366f1);border-radius:50%;content:"";inset:-6px;opacity:.65;pointer-events:none;position:absolute}@keyframes compare-pin-pulse{0%,to{box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px #6366f1,0 0 18px 6px color-mix(in srgb,#6366f1 35%,#0000);box-shadow:0 8px 22px #0f172a61,0 0 0 3px #fff,0 0 0 5px var(--pin-color,#6366f1),0 0 18px 6px color-mix(in srgb,var(--pin-color,#6366f1) 35%,#0000)}50%{box-shadow:0 10px 28px #0f172a80,0 0 0 3px #fff,0 0 0 6px #6366f1,0 0 28px 10px color-mix(in srgb,#6366f1 55%,#0000);box-shadow:0 10px 28px #0f172a80,0 0 0 3px #fff,0 0 0 6px var(--pin-color,#6366f1),0 0 28px 10px color-mix(in srgb,var(--pin-color,#6366f1) 55%,#0000)}}@keyframes compare-pin-halo{0%{inset:-2px;opacity:.7}to{inset:-16px;opacity:0}}.dispatch-container .compare-step-pin.is-anomaly{box-shadow:0 4px 14px #dc262659,0 0 0 1px #ffffff2e,0 0 0 3px #fff,0 0 0 5px #dc2626}.dispatch-container .compare-step-pin.is-anomaly.is-focused{animation:compare-pin-pulse-anomaly 1.4s ease-in-out infinite;box-shadow:0 8px 22px #dc262680,0 0 0 3px #fff,0 0 0 5px #dc2626,0 0 22px 8px #dc262673}@keyframes compare-pin-pulse-anomaly{0%,to{box-shadow:0 8px 22px #dc262680,0 0 0 3px #fff,0 0 0 5px #dc2626,0 0 22px 8px #dc262673}50%{box-shadow:0 10px 28px #dc2626a6,0 0 0 3px #fff,0 0 0 6px #dc2626,0 0 32px 12px #dc26268c}}.dispatch-container .compare-step-pin-check{background:#16a34a;border:1.5px solid #fff;border-radius:50%;bottom:-3px;box-shadow:0 2px 5px #0f172a57;height:14px;padding:1px;position:absolute;right:-3px;width:14px;z-index:2}.dispatch-container .compare-start-pin{align-items:center;background:#fff;border:3px solid #475569;border:3px solid var(--pin-color,#475569);border-radius:50%;box-shadow:0 5px 14px #0f172a52,0 0 0 1px #fff9;color:#475569;color:var(--pin-color,#475569);cursor:pointer;display:flex;height:40px;justify-content:center;transition:transform .18s ease,box-shadow .18s ease;width:40px}.dispatch-container .compare-start-pin:hover{box-shadow:0 7px 20px #0f172a66,0 0 0 1px #ffffffb3;transform:scale(1.1);z-index:1100}.dispatch-container .compare-start-pin svg{display:block;height:22px;width:22px}.dispatch-container .compare-tooltip{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#0f172af2;border:0;border-radius:12px;box-shadow:0 10px 30px #0f172a66,0 0 0 1px #ffffff0f;color:#f8fafc;font-family:inherit;padding:0;white-space:normal}.dispatch-container .compare-tooltip.leaflet-tooltip-top:before{border-top-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-bottom:before{border-bottom-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-left:before{border-left-color:#0f172af2}.dispatch-container .compare-tooltip.leaflet-tooltip-right:before{border-right-color:#0f172af2}.dispatch-container .cmp-tip{max-width:260px;min-width:200px;padding:9px 12px 8px}.dispatch-container .cmp-tip-header{align-items:center;display:flex;gap:9px;min-width:0}.dispatch-container .cmp-tip-step{align-items:center;background:#6366f1;border-radius:50%;box-shadow:0 2px 6px #0000004d;color:#fff;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;height:24px;justify-content:center;width:24px}.dispatch-container .cmp-tip-step svg{font-size:14px}.dispatch-container .cmp-tip-title-stack{flex:1 1;min-width:0}.dispatch-container .cmp-tip-title{color:#f8fafc;font-size:12px;font-weight:800;letter-spacing:.01em;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-tip-sub{color:#cbd5e1;font-size:10px;font-weight:600;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-tip-tag{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:8px;font-weight:800;letter-spacing:.08em;padding:2px 7px;text-transform:uppercase}.dispatch-container .cmp-tip-anomaly{background:#dc262629;border:1px solid #dc262652;border-radius:8px;color:#fecaca;font-size:10px;font-weight:700;letter-spacing:.02em;margin-top:7px;padding:5px 8px}.dispatch-container .cmp-tip-action{border-top:1px solid #ffffff1a;color:#94a3b8;font-size:9px;font-weight:700;letter-spacing:.08em;margin-top:7px;padding-top:6px;text-align:center;text-transform:uppercase}.dispatch-container .compare-popup .leaflet-popup-content-wrapper{background:#fff;border-radius:14px;box-shadow:0 12px 32px #0f172a38,0 0 0 1px #0f172a0f;overflow:hidden;padding:0}.dispatch-container .compare-popup .leaflet-popup-content{margin:0;min-width:240px;width:auto!important}.dispatch-container .compare-popup .leaflet-popup-tip{background:#fff;box-shadow:0 6px 18px #0f172a2e}.dispatch-container .compare-popup .leaflet-popup-close-button{color:#94a3b8;font-size:18px;font-weight:700;padding:4px 6px;right:6px;top:6px}.dispatch-container .compare-popup .leaflet-popup-close-button:hover{color:#0f172a}.dispatch-container .cmp-pop{color:#0f172a;font-family:Inter,-apple-system,sans-serif;line-height:1.35}.dispatch-container .cmp-pop-head{align-items:center;background:linear-gradient(180deg,#f8fafc,#fff);border-bottom:1px solid #0f172a0f;display:flex;gap:10px;padding:12px 32px 12px 14px}.dispatch-container .cmp-pop-pin{align-items:center;border:2.5px solid #fff;border-radius:50%;box-shadow:0 3px 10px #0003;color:#fff;display:flex;flex-shrink:0;font-size:13px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cmp-pop-titles{flex:1 1;min-width:0}.dispatch-container .cmp-pop-title{color:#0f172a;font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cmp-pop-sub{color:#64748b;font-size:9.5px;font-weight:700;letter-spacing:.05em;margin-top:2px;text-transform:uppercase}.dispatch-container .cmp-pop-tag{background:#e0e7ff;border-radius:999px;color:#4338ca;flex-shrink:0;font-size:9px;font-weight:800;letter-spacing:.06em;padding:3px 8px;text-transform:uppercase;white-space:nowrap}.dispatch-container .cmp-pop-tag-start{background:#ecfeff;color:#0e7490}.dispatch-container .cmp-pop-rows{display:flex;flex-direction:column;padding:8px 14px 12px}.dispatch-container .cmp-pop-row{align-items:center;border-bottom:1px dashed #0f172a12;display:flex;font-size:12px;gap:12px;justify-content:space-between;padding:6px 0}.dispatch-container .cmp-pop-row:last-child{border-bottom:0}.dispatch-container .cmp-pop-k{color:#64748b;font-weight:600;white-space:nowrap}.dispatch-container .cmp-pop-v{font-feature-settings:"tnum";color:#0f172a;font-variant-numeric:tabular-nums;font-weight:700;text-align:right}.dispatch-container .cmp-pop-v.is-loss{color:#dc2626}.dispatch-container .cmp-pop-v.is-profit{color:#16a34a}.dispatch-container .cmp-pop-coord{color:#475569;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10.5px;font-weight:600}.dispatch-container .leaflet-container{background:#f1f5f9!important}.dispatch-container #ov-tl{left:16px;position:absolute;top:16px;z-index:1000}.dispatch-container .ov-card{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffe6;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:16px;box-shadow:0 10px 25px -5px #00000014;box-shadow:var(--shadow-lg);padding:16px 20px}.dispatch-container .ov-stats{display:flex;gap:24px}.dispatch-container .osv{font-size:24px;font-weight:800}.dispatch-container .osv.g{color:#22c55e;color:var(--success)}.dispatch-container .osl{color:#64748b;color:var(--text-muted);font-size:11px;font-weight:700;margin-top:2px;text-transform:uppercase}.dispatch-container #ov-tr{display:flex;flex-direction:column;gap:8px;position:absolute;right:16px;top:16px;width:200px;z-index:1000}.dispatch-container #body.compare-mode #ov-tr{display:none!important}.dispatch-container #ov-br{bottom:20px;position:absolute;right:80px;z-index:1000}.dispatch-container .rchip{align-items:center;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffe6;border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:10px;box-shadow:0 4px 12px #0000000d;box-shadow:var(--shadow);cursor:pointer;display:flex;font-size:12px;font-weight:600;gap:8px;padding:8px 12px;transition:all .2s}.dispatch-container .rchip.active{background:#fff;border-color:#3b82f6;border-color:var(--accent);box-shadow:0 4px 12px #3b82f626}.dispatch-container .rchip-dot{border-radius:50%;height:8px;width:8px}.dispatch-container .rchip-n{font-feature-settings:"tnum","tnum";color:#3b82f6;color:var(--accent);font-variant-numeric:tabular-nums;font-weight:800;margin-left:auto;white-space:nowrap}.dispatch-container .rchip-n.is-done{color:#16a34a}.dispatch-container .kitchen-mark{align-items:center;background:#f59e0b;background:var(--kitchen);border:3px solid #fff;border-radius:50%;box-shadow:0 0 20px #f59e0bcc,0 0 40px #f59e0b66;color:#fff;display:flex;font-size:18px;font-weight:900;height:46px;justify-content:center;width:46px}.dispatch-container .kitchen-mark.is-focused{animation:kitchen-mark-pulse 1.8s ease-in-out infinite;border-width:4px;font-size:22px;height:56px;width:56px}@keyframes kitchen-mark-pulse{0%,to{box-shadow:0 0 20px #f59e0be6,0 0 40px #f59e0b80,0 0 0 0 #f59e0b8c}50%{box-shadow:0 0 30px #f59e0b,0 0 60px #f59e0bb3,0 0 0 18px #f59e0b00}}.dispatch-container .leaflet-popup-content-wrapper{background:#fff;border-radius:12px;box-shadow:0 10px 25px -5px #00000026;color:#1e293b;padding:0}.dispatch-container .leaflet-popup-tip-container{bottom:-10px;height:10px;left:50%;margin-left:-10px;overflow:hidden;position:absolute;width:20px}.dispatch-container .leaflet-popup-tip{background:#fff;box-shadow:none;height:14px;margin:-10px auto 0;padding:0;transform:rotate(45deg);width:14px}.dispatch-container .pu-id{align-items:center;background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;color:#64748b;display:flex;font-size:10px;font-weight:800;gap:6px;letter-spacing:.08em;padding:10px 14px}.dispatch-container .pu-live-dot{animation:pu-pulse 1.2s ease-in-out infinite;background:#22c55e;border-radius:50%;box-shadow:0 0 0 2px #22c55e33;height:6px;width:6px}@keyframes pu-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.2)}}.dispatch-container .pu-rider-wrap{align-items:center;display:flex;gap:8px;padding:14px 14px 8px}.dispatch-container .pu-rider-indicator{border-radius:50%;box-shadow:0 0 6px #00000026;flex-shrink:0;height:8px;width:8px}.dispatch-container .pu-rider-name{color:#0f172a;font-size:14.5px;font-weight:800;letter-spacing:-.01em}.dispatch-container .pu-body-content{display:flex;flex-direction:column;gap:6px;padding:0 14px 12px}.dispatch-container .pu-row{align-items:center;color:#64748b;display:flex;font-size:12px;justify-content:space-between;padding:2px 0}.dispatch-container .pu-row span:first-child{color:#64748b;flex-shrink:0;font-size:11px;font-weight:600;letter-spacing:.02em;margin-right:12px;text-transform:uppercase}.dispatch-container .pu-row span:last-child{color:#334155;font-weight:600;max-width:70%;overflow-wrap:anywhere;text-align:right;word-break:break-word}.dispatch-container .pu-status-tag{align-items:center;border-radius:6px;display:inline-flex;font-size:10.5px;font-weight:800;letter-spacing:.02em;padding:2px 8px;text-transform:uppercase}.dispatch-container .pu-status-tag.is-idle{background:#f1f5f9;color:#475569}.dispatch-container .pu-status-tag.is-active{background:#e0f2fe;color:#0284c7}.dispatch-container .pu-status-tag.is-delivered{background:#dcfce7;color:#16a34a}.dispatch-container .pu-status-tag.is-generic{background:#f1f5f9;color:#475569}.dispatch-container .pu-order-tag{background:#f5f3ff;border-radius:4px;color:#4f46e5!important;font-family:JetBrains Mono,monospace;font-size:11px;font-weight:700!important;padding:1px 6px}.dispatch-container .pu-phone-tag{color:#334155;font-family:JetBrains Mono,monospace;font-size:11.5px}.dispatch-container .pu-coord-tag{color:#64748b!important;font-family:JetBrains Mono,monospace;font-size:10.5px}.dispatch-container .live-rider-popup .leaflet-popup-content-wrapper{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#fffffff2;border:1px solid #ffffffd9;border-radius:16px;box-shadow:0 20px 48px #0f172a38;max-width:280px;min-width:260px;overflow:hidden;padding:0}.dispatch-container .live-rider-popup .leaflet-popup-content{margin:0;min-width:260px}.dispatch-container .live-rider-popup .pu-hdr-live{align-items:center;background:#f8fafc;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;padding:10px 14px}.dispatch-container .live-rider-popup .pu-hdr-left{align-items:center;display:flex;gap:8px}.dispatch-container .live-rider-popup .pu-live-indicator{align-items:center;display:inline-flex;justify-content:center;position:relative}.dispatch-container .live-rider-popup .pu-live-dot{background-color:#dc2626;background-color:var(--pulse-color,#dc2626);border-radius:50%;height:7px;width:7px;z-index:2}.dispatch-container .live-rider-popup .pu-live-indicator:after{animation:pu-pulse-ring 1.8s cubic-bezier(.4,0,.2,1) infinite;border:2px solid #dc2626;border:2px solid var(--pulse-color,#dc2626);border-radius:50%;content:"";height:15px;opacity:0;position:absolute;width:15px;z-index:1}@keyframes pu-pulse-ring{0%{opacity:.8;transform:scale(.5)}to{opacity:0;transform:scale(1.6)}}.dispatch-container .live-rider-popup .pu-hdr-title{color:#64748b;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-status-badge{border-radius:999px;box-shadow:0 1px 3px #0000000d;font-size:9px;font-weight:800;letter-spacing:.04em;padding:2px 8px;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-status-badge.active{background:#e0f2fe;color:#0369a1}.dispatch-container .live-rider-popup .pu-status-badge.idle{background:#f1f5f9;color:#475569}.dispatch-container .live-rider-popup .pu-rider-profile{align-items:center;background:linear-gradient(180deg,#f8fafc80,#fff0);display:flex;gap:12px;padding:14px 16px 10px}.dispatch-container .live-rider-popup .pu-avatar{align-items:center;border-radius:10px;box-shadow:inset 0 1px 2px #fff3;display:flex;font-size:20px;height:38px;justify-content:center;width:38px}.dispatch-container .live-rider-popup .pu-rider-info-text{display:flex;flex-direction:column;gap:2px}.dispatch-container .live-rider-popup .pu-rider-name{color:#0f172a;font-size:15px;font-weight:800;letter-spacing:-.01em;line-height:1.2}.dispatch-container .live-rider-popup .pu-rider-name-row{align-items:center;display:flex;flex-wrap:wrap;gap:8px}.dispatch-container .live-rider-popup .pu-rider-meta{color:#94a3b8;font-size:10px;font-weight:600;letter-spacing:.02em}.dispatch-container .live-rider-popup .pu-body-content{display:flex;flex-direction:column;gap:8px;padding:4px 16px 16px}.dispatch-container .live-rider-popup .pu-info-row{align-items:center;border-bottom:1px dashed #f1f5f9;display:flex;justify-content:space-between;padding:4px 0}.dispatch-container .live-rider-popup .pu-info-row:last-child{border-bottom:none;padding-bottom:0}.dispatch-container .live-rider-popup .pu-info-label{color:#94a3b8;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.dispatch-container .live-rider-popup .pu-info-value{color:#334155;font-size:12px;font-weight:700;text-align:right}.dispatch-container .live-rider-popup .pu-order-badge{background:#f5f3ff;border:1px solid #4f46e51f;border-radius:6px;color:#4f46e5;font-family:JetBrains Mono,monospace;font-size:11px;font-weight:800;padding:2px 8px}.dispatch-container .live-rider-popup .pu-phone-link{color:#0284c7;font-family:JetBrains Mono,monospace;font-weight:700;text-decoration:none;transition:color .15s ease}.dispatch-container .live-rider-popup .pu-phone-link:hover{color:#0369a1;text-decoration:underline}.dispatch-container .live-rider-popup .pu-time-stamp{align-items:center;color:#475569;display:inline-flex;gap:4px}.dispatch-container .live-rider-popup .pu-time-stamp .inline-icon{color:#64748b;font-size:13px}.dispatch-container .live-rider-popup .pu-coordinates{background:#f8fafc;border:1px solid #e2e8f0;border-radius:4px;color:#64748b;font-family:JetBrains Mono,monospace;font-size:11px;padding:2px 6px}.dispatch-container .pu-section-label{border-bottom:1px solid #7b1fa22e;color:#7b1fa2;font-size:10px;font-weight:700;letter-spacing:.06em;margin:10px 14px 4px;padding-bottom:4px;text-transform:uppercase}.dispatch-container .pu-timeline{display:flex;flex-direction:column;gap:5px;padding:4px 14px 4px 16px;position:relative}.dispatch-container .pu-timeline:before{background:#7b1fa22e;bottom:8px;content:"";left:19px;position:absolute;top:8px;width:1px}.dispatch-container .pu-tl-row{align-items:center;display:flex;font-size:11px;gap:8px;position:relative;z-index:1}.dispatch-container .pu-tl-dot{background:#fff;border:2px solid #7b1fa273;border-radius:50%;box-sizing:border-box;flex-shrink:0;height:8px;width:8px}.dispatch-container .pu-tl-row.delivered .pu-tl-dot{background:#16a34a;border-color:#16a34a;box-shadow:0 0 0 3px #16a34a2e}.dispatch-container .pu-tl-label{color:#64748b;flex:1 1;font-weight:500}.dispatch-container .pu-tl-row.delivered .pu-tl-label{color:#16a34a;font-weight:700}.dispatch-container .pu-tl-time{font-feature-settings:"tnum","tnum";color:#1e293b;font-variant-numeric:tabular-nums;font-weight:700}.dispatch-container .dispatch-popup .leaflet-popup-content{margin:0;width:auto!important}.dispatch-container .dispatch-popup .leaflet-popup-content-wrapper{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);border-radius:14px;box-shadow:0 18px 40px #0f172a2e;min-width:580px;overflow:hidden;padding:0}.dispatch-container .dispatch-popup .leaflet-popup-tip{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1)}@keyframes dispatch-popup-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .dispatch-popup .leaflet-popup-content{min-width:580px}.dispatch-container .dispatch-popup-center{animation:dispatch-popup-in .18s cubic-bezier(.4,0,.2,1);display:flex;left:50%;max-height:calc(100vh - 32px);max-width:calc(100vw - 32px);pointer-events:auto;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:1700}.dispatch-container .dispatch-popup-center .dispatch-popup-card{background:#fff;border-radius:14px;box-shadow:0 24px 60px #0f172a47;max-height:calc(100vh - 32px);max-width:680px;min-width:min(580px,calc(100vw - 32px));overflow-x:hidden;overflow-y:auto;position:relative}.dispatch-container .dispatch-popup-center-close{align-items:center;background:#fff3;border:0;border-radius:50%;color:#fff;cursor:pointer;display:flex;font-size:20px;font-weight:700;height:26px;justify-content:center;line-height:1;padding:0;position:absolute;right:8px;top:8px;transition:background .15s ease;width:26px;z-index:2}.dispatch-container .dispatch-popup-center-close:hover{background:#ffffff59}.dispatch-container .dispatch-popup-center .dispatch-popup .pu-header{padding-right:44px}.dispatch-container .dispatch-popup .pu-header{background:linear-gradient(135deg,#7b1fa2,#9c27b0 50%,#ab47bc);border-radius:12px 12px 0 0;color:#fff;padding:14px 16px 12px}.dispatch-container .dispatch-popup .pu-header-top{align-items:center;display:flex;gap:10px;justify-content:space-between;margin-bottom:8px}.dispatch-container .dispatch-popup .pu-id{background:#0000;border:0;border-radius:0;color:#fffffff2;font-size:12px;font-weight:800;letter-spacing:.06em;overflow:hidden;padding:0;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.dispatch-container .dispatch-popup .pu-status-chip{border-radius:999px;box-shadow:0 2px 6px #0000002e;flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.06em;padding:4px 10px;text-transform:uppercase;white-space:nowrap}.dispatch-container .dispatch-popup .pu-rider{align-items:center;color:#fff!important;display:flex;font-size:16px;font-weight:800;gap:6px;letter-spacing:-.01em;padding:0}.dispatch-container .dispatch-popup .pu-rider svg{font-size:18px;opacity:.9}.dispatch-container .dispatch-popup .pu-rider span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-customer{align-items:center;color:#ffffffeb;display:flex;font-size:13px;font-weight:600;gap:6px;letter-spacing:-.005em;margin-top:4px;max-width:100%;padding:0}.dispatch-container .dispatch-popup .pu-customer svg{flex:0 0 auto;font-size:14px;opacity:.85}.dispatch-container .dispatch-popup .pu-customer span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-delivery-id{color:#ffffffd9;font-size:11px;font-weight:600;letter-spacing:.04em;margin-top:6px}.dispatch-container .dispatch-popup .pu-body{padding:4px 16px 12px}.dispatch-container .dispatch-popup .pu-section{margin-top:8px}.dispatch-container .dispatch-popup .pu-section-label{border-bottom:1px solid #7b1fa22e;color:#7b1fa2;font-size:10px;font-weight:800;letter-spacing:.08em;margin:0 0 6px;padding-bottom:4px;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-timeline{grid-column-gap:14px;grid-row-gap:4px;column-gap:14px;display:grid;grid-template-columns:1fr 1fr;padding:2px 0;position:relative;row-gap:4px}.dispatch-container .dispatch-popup .pu-timeline:before{display:none}.dispatch-container .dispatch-popup .pu-details-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .dispatch-popup .pu-detail{align-items:flex-start;background:#7b1fa20d;border:1px solid #7b1fa21f;border-radius:10px;display:flex;gap:8px;min-width:0;padding:8px 10px}.dispatch-container .dispatch-popup .pu-detail-icon{align-items:center;background:#7b1fa21f;border-radius:7px;color:#7b1fa2;display:flex;flex-shrink:0;font-size:14px;height:26px;justify-content:center;width:26px}.dispatch-container .dispatch-popup .pu-detail-icon svg{font-size:15px}.dispatch-container .dispatch-popup .pu-detail-body{flex:1 1;min-width:0}.dispatch-container .dispatch-popup .pu-detail-label{color:#64748b;font-size:9px;font-weight:700;letter-spacing:.06em;margin-bottom:2px;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-detail-value{color:#1e293b;font-size:12px;font-weight:700;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .dispatch-popup .pu-distance-row{border-top:1px dashed #7b1fa22e;display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;padding-top:8px}.dispatch-container .dispatch-popup .pu-distance-chip{align-items:center;background:linear-gradient(135deg,#7b1fa214,#9c27b00f);border:1px solid #7b1fa233;border-radius:999px;display:inline-flex;font-size:11px;font-weight:600;gap:5px;padding:5px 10px}.dispatch-container .dispatch-popup .pu-distance-icon{color:#7b1fa2;display:inline-flex}.dispatch-container .dispatch-popup .pu-distance-icon svg{font-size:14px}.dispatch-container .dispatch-popup .pu-distance-label{color:#64748b;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.dispatch-container .dispatch-popup .pu-distance-value{font-feature-settings:"tnum";color:#1e293b;font-variant-numeric:tabular-nums;font-weight:800}.dispatch-container .kitchen-popup .kp-header{background:#f8fafc;border-bottom:1px solid #e2e8f0;border-radius:12px 12px 0 0;color:#64748b;font-size:10px;font-weight:800;letter-spacing:.1em;padding:8px 14px}.dispatch-container .kitchen-popup .kp-name{color:#f59e0b;color:var(--kitchen);font-size:16px;font-weight:800;padding:14px 14px 4px}.dispatch-container .kitchen-popup .kp-stat{display:flex;justify-content:space-between;padding:8px 14px 16px}.dispatch-container .kitchen-popup .kp-stat-lbl{color:#64748b;font-size:12px}.dispatch-container .kitchen-popup .kp-stat-val{color:#1e293b;font-size:16px;font-weight:800}.dispatch-container .empty-slot{align-items:center;display:flex;flex-direction:column;gap:10px;justify-content:center;padding:48px 24px;text-align:center}.dispatch-container .empty-slot-icon{color:#e2e8f0;color:var(--border);font-size:36px;line-height:1}.dispatch-container .empty-slot-title{color:#64748b;color:var(--text-muted);font-size:14px;font-weight:700}.dispatch-container .empty-slot-sub{color:#e2e8f0;color:var(--border);font-size:12px;font-weight:500;line-height:1.5;max-width:220px}.dispatch-container #desc{background:#fff;background:var(--bg);border-top:1px solid #e2e8f0;border-top:1px solid var(--border);color:#64748b;color:var(--text-muted);font-size:12px;font-weight:500;padding:16px 20px}@media (max-width:1280px){.dispatch-container #sidebar{flex-basis:360px;width:360px}.dispatch-container .sidebar-toggle-tab{left:360px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}}@media (max-width:1180px){.dispatch-container #sidebar{flex-basis:320px;width:320px}.dispatch-container .sidebar-toggle-tab{left:320px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .rd-rider-name{font-size:24px}.dispatch-container .rd-stat-value,.dispatch-container .sb-tile-value{font-size:20px}.dispatch-container #hdr{padding:0 16px}.dispatch-container #strat-row{gap:6px;padding:0 16px}.dispatch-container #batch-row{padding:8px 16px}.dispatch-container .sbt{font-size:12px;gap:6px;padding:7px 11px}}@media (max-width:1080px){.dispatch-container #sidebar{flex-basis:290px;width:290px}.dispatch-container .sidebar-toggle-tab{left:290px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .logo-city,.dispatch-container .logo-city-wrap{display:none}.dispatch-container .logo-name{font-size:16px}.dispatch-container #clock{font-size:12px;padding:5px 10px}.dispatch-container .hdr-stats{gap:6px;margin-right:8px}.dispatch-container .strat-stat{font-size:11px;gap:4px;padding:5px 9px}.dispatch-container .strat-stat-label{display:none}.dispatch-container .live-status{font-size:11px;padding:5px 8px}.dispatch-container .live-status-sub{display:none}.dispatch-container .sbt{font-size:12px;gap:5px;padding:7px 10px}.dispatch-container .sbt .sbt-icon{font-size:16px;height:16px;width:16px}.dispatch-container .batch-btn{font-size:11px;gap:4px;padding:5px 9px}.dispatch-container .batch-btn-count{font-size:9px;height:16px;min-width:18px;padding:0 4px}.dispatch-container .sb-header{padding:14px 14px 12px}.dispatch-container .sb-tile-value{font-size:18px}.dispatch-container .sb-tile{gap:8px;padding:8px 10px}.dispatch-container .sb-tile-icon{font-size:16px;height:28px;width:28px}.dispatch-container .rcard{padding:12px}.dispatch-container .rcard-name{font-size:13px}.dispatch-container .rcard-zone{font-size:11px}.dispatch-container .step-wrap{padding:12px}.dispatch-container #route-detail{padding:16px}.dispatch-container .rd-rider-name{font-size:20px}.dispatch-container .rd-stat-value{font-size:17px}.dispatch-container .rd-stat{padding:12px 8px 10px}.dispatch-container #ov-tr{width:160px}.dispatch-container .rchip{font-size:11px;padding:6px 8px}}@media (max-width:960px){.dispatch-container #sidebar{flex-basis:250px;width:250px}.dispatch-container .sidebar-toggle-tab{left:250px}.dispatch-container .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container #strat-row{-webkit-overflow-scrolling:touch;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.dispatch-container #strat-row::-webkit-scrollbar{display:none}.dispatch-container .sbt{flex-shrink:0;font-size:11px;padding:7px 9px}.dispatch-container .zone-stat-label{display:none}.dispatch-container .zone-stat-pill{gap:3px;padding:3px 7px}.dispatch-container .zone-stat-value{font-size:12px}.dispatch-container .rd-stats-grid{gap:6px}.dispatch-container .rd-stat{padding:10px 6px 8px}.dispatch-container .rd-stat-value{font-size:15px}.dispatch-container .rd-stat-label{font-size:9px}.dispatch-container .rd-stat-icon{font-size:15px}.dispatch-container #ov-tr{display:none}.dispatch-container .zone-card-name{font-size:13px}.dispatch-container .zone-card-sub{font-size:10px}.dispatch-container #riders-panel{padding:12px}.dispatch-container .trip-header{padding:10px 12px}}.dispatch-container .rider-info-mode{background:#fff;background:var(--bg);display:flex;flex:1 1;min-height:0;overflow:hidden}.dispatch-container .ri-sidebar{background:#f8fafc;background:var(--bg-sub,#f8fafc);border-right:1px solid #e2e8f0;border-right:1px solid var(--border,#0f172a14);display:flex;flex-direction:column;flex-shrink:0;min-width:280px;overflow:hidden;width:320px}.dispatch-container .ri-sb-head{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);padding:16px 18px 12px}.dispatch-container .ri-sb-title{color:#1e293b;font-size:20px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-sb-sub{color:#64748b;font-size:13px;font-weight:600;margin-top:4px}.dispatch-container .ri-main{background:#fff;flex:1 1;min-width:0;overflow-y:auto;padding:24px 28px}.dispatch-container .ri-main::-webkit-scrollbar{width:6px}.dispatch-container .ri-main::-webkit-scrollbar-thumb{background:#7b1fa240;border-radius:999px}.dispatch-container .ri-placeholder{align-items:center;color:#64748b;display:flex;flex-direction:column;height:100%;justify-content:center;padding:60px 20px;text-align:center}.dispatch-container .ri-placeholder-icon{align-items:center;background:#7b1fa214;border-radius:16px;color:#7b1fa2;display:flex;font-size:32px;height:64px;justify-content:center;margin-bottom:16px;width:64px}.dispatch-container .ri-placeholder-icon svg{font-size:36px}.dispatch-container .ri-placeholder-title{color:#1e293b;font-size:16px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-placeholder-sub{font-size:12px;font-weight:500;line-height:1.5;margin-top:6px;max-width:320px}.dispatch-container .ri-search{padding:12px 14px 4px;position:relative}.dispatch-container .ri-search-icon{color:#94a3b8;font-size:18px;left:26px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.dispatch-container .ri-search-input{background:#f8fafc;border:1px solid #7b1fa22e;border-radius:10px;color:#1e293b;font-family:inherit;font-size:13px;font-weight:500;outline:none;padding:10px 12px 10px 38px;transition:border-color .15s ease,background .15s ease;width:100%}.dispatch-container .ri-search-input:focus{background:#fff;border-color:#7b1fa2}.dispatch-container .ri-rider-list{display:flex;flex:1 1;flex-direction:column;gap:6px;min-height:0;overflow-y:auto;padding:8px 14px 16px}.dispatch-container .ri-rider-list::-webkit-scrollbar{width:6px}.dispatch-container .ri-rider-list::-webkit-scrollbar-thumb{background:#7b1fa240;border-radius:999px}.dispatch-container .ri-rider-item{align-items:center;background:#fff;border:1px solid #7b1fa21f;border-radius:10px;cursor:pointer;display:flex;font-family:inherit;gap:12px;padding:12px 14px;text-align:left;transition:border-color .15s ease,background .15s ease,transform .15s ease;width:100%}.dispatch-container .ri-rider-item:hover{background:#7b1fa20a;border-color:#7b1fa266;transform:translateX(2px)}.dispatch-container .ri-rider-item.active{background:linear-gradient(180deg,#fbf3ff,#f0e0fa);border-color:#7b1fa2;box-shadow:0 4px 12px #7b1fa22e}.dispatch-container .ri-rider-item.active .ri-rider-name{color:#7b1fa2}.dispatch-container .ri-rider-item.active .ri-rider-arrow{opacity:1;transform:translateX(2px)}.dispatch-container .ri-rider-dot{border-radius:50%;box-shadow:0 0 0 2px #fff,0 0 0 3px #0f172a14;flex-shrink:0;height:14px;width:14px}.dispatch-container .ri-rider-info-block{display:flex;flex:1 1;flex-direction:column;gap:3px;min-width:0}.dispatch-container .ri-rider-name{color:#1e293b;font-size:15px;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .ri-rider-meta{color:#64748b;font-size:13px;font-weight:600}.dispatch-container .ri-rider-arrow{color:#7b1fa2;font-size:18px;font-weight:800;opacity:.4;transition:opacity .15s ease,transform .15s ease}.dispatch-container .ri-rider-item:hover .ri-rider-arrow{opacity:1;transform:translateX(2px)}.dispatch-container .ri-empty{color:#64748b;font-size:12px;padding:32px 16px;text-align:center}.dispatch-container .ri-error,.dispatch-container .ri-loading{color:#64748b;font-size:13px;padding:32px 16px;text-align:center}.dispatch-container .ri-error{color:#dc2626}.dispatch-container .ri-snap-head{border-bottom:1px dashed #7b1fa22e;margin-bottom:20px;padding:6px 0 18px}.dispatch-container .ri-snap-name{color:#1e293b;font-size:18px;font-weight:800;letter-spacing:-.01em}.dispatch-container .ri-snap-meta{align-items:center;color:#64748b;display:flex;font-size:12px;font-weight:600;gap:8px;margin-top:4px}.dispatch-container .ri-status{background:#64748b2e;border-radius:999px;color:#475569;font-size:10px;font-weight:800;letter-spacing:.06em;padding:2px 10px;text-transform:uppercase}.dispatch-container .ri-status-idle{background:#f59e0b2e;color:#b45309}.dispatch-container .ri-status-active,.dispatch-container .ri-status-ongoing,.dispatch-container .ri-status-online{background:#22c55e2e;color:#15803d}.dispatch-container .ri-status-offline{background:#ef44442e;color:#b91c1c}.dispatch-container .ri-live{align-items:center;background:#22c55e1f;border-radius:999px;color:#15803d;display:inline-flex;font-size:10px;font-weight:800;gap:5px;letter-spacing:.06em;padding:2px 8px 2px 6px;text-transform:uppercase}.dispatch-container .ri-live.is-refetching{background:#7b1fa21f;color:#7b1fa2}.dispatch-container .ri-live-dot{animation:ri-live-pulse 1.6s ease-in-out infinite;background:#16a34a;border-radius:50%;box-shadow:0 0 0 0 #22c55e8c;height:6px;width:6px}.dispatch-container .ri-live.is-refetching .ri-live-dot{background:#7b1fa2;box-shadow:0 0 0 0 #7b1fa28c}@keyframes ri-live-pulse{0%,to{box-shadow:0 0 0 0 #22c55e8c}50%{box-shadow:0 0 0 5px #22c55e00}}.dispatch-container .ri-snap-time{font-feature-settings:"tnum";align-items:center;color:#64748b;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:500;gap:4px;margin-top:6px}.dispatch-container .ri-snap-time svg{font-size:13px}.dispatch-container .ri-snap-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .ri-stat{align-items:center;background:#7b1fa20d;border:1px solid #7b1fa21f;border-radius:10px;display:flex;gap:10px;padding:10px 12px}.dispatch-container .ri-stat-warn{background:#ef44440f;border-color:#ef444438}.dispatch-container .ri-stat-icon{align-items:center;background:#7b1fa21f;border-radius:9px;color:#7b1fa2;display:flex;flex-shrink:0;font-size:16px;height:32px;justify-content:center;width:32px}.dispatch-container .ri-stat-warn .ri-stat-icon{background:#ef444429;color:#b91c1c}.dispatch-container .ri-stat-icon svg{font-size:18px}.dispatch-container .ri-stat-body{flex:1 1;min-width:0}.dispatch-container .ri-stat-label{color:#64748b;font-size:10px;font-weight:700;letter-spacing:.05em;margin-bottom:2px;text-transform:uppercase}.dispatch-container .ri-stat-value{align-items:center;color:#1e293b;display:flex;font-size:13px;font-weight:700;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .ri-stat-tag{background:#22c55e2e;border-radius:999px;color:#15803d;font-size:9px;font-weight:800;letter-spacing:.04em;padding:2px 6px;text-transform:uppercase}.dispatch-container .ri-map-section{margin-top:14px}.dispatch-container .ri-coords-label{font-feature-settings:"tnum";align-items:center;background:linear-gradient(180deg,#fff,#fbf5ff);border:1px solid #7b1fa22e;border-bottom:0;border-radius:10px 10px 0 0;box-sizing:border-box;color:#1e293b;display:inline-flex;font-size:12px;font-variant-numeric:tabular-nums;font-weight:700;gap:4px;padding:8px 14px;width:100%}.dispatch-container .ri-coords-label svg{color:#7b1fa2;font-size:16px}.dispatch-container .ri-map{border:1px solid #7b1fa22e;border-radius:0 0 10px 10px;height:260px;overflow:hidden;position:relative;width:100%;z-index:0}.dispatch-container .ri-map .leaflet-container{font-family:inherit;height:100%;width:100%}.dispatch-container .ri-map .leaflet-tooltip.ri-area-banner{background:#7b1fa2;border:0;border-radius:8px;box-shadow:0 4px 10px #0f172a40;color:#fff;font-size:11px;font-weight:700;letter-spacing:.02em;padding:4px 10px;white-space:nowrap}.dispatch-container .ri-map .leaflet-tooltip.ri-area-banner:before{border-top-color:#7b1fa2}@media (max-width:600px){.dispatch-container .rider-info-mode{flex-direction:column}.dispatch-container .ri-sidebar{border-bottom:1px solid #e2e8f0;border-bottom:1px solid var(--border,#0f172a14);border-right:0;max-height:40vh;min-width:0;width:100%}.dispatch-container .ri-main{padding:16px}.dispatch-container .ri-snap-grid{grid-template-columns:1fr}}@media (max-width:1366px){.dispatch-container #hdr{height:48px;padding:0 16px}.dispatch-container .logo-name{font-size:15px}.dispatch-container .logo-badge{border-radius:6px;font-size:13px;height:28px;width:28px}.dispatch-container .logo{gap:8px}.dispatch-container #clock{font-size:11px;padding:4px 10px}.dispatch-container .hdr-stats{gap:8px;margin-right:8px}.dispatch-container .strat-stat{font-size:11px;gap:4px;padding:4px 8px}.dispatch-container .strat-stat-label{display:none}.dispatch-container .live-status{font-size:11px;padding:4px 8px}.dispatch-container .date-chip-label,.dispatch-container .live-status-sub{display:none}.dispatch-container .date-chip-main{gap:8px;padding:6px 10px}.dispatch-container .date-chip-icon{font-size:13px;height:24px;width:24px}.dispatch-container .date-chip-value{font-size:12px}.dispatch-container .date-chip-nav{font-size:16px;width:28px}.dispatch-container #strat-row{gap:8px;height:48px;padding:0 16px}.dispatch-container .sbt{border:1px solid #0f172a14;border-radius:8px;font-size:12px;gap:6px;padding:6px 12px}.dispatch-container .sbt .sbt-icon{font-size:16px;height:16px;width:16px}.dispatch-container #batch-row{gap:6px;padding:6px 16px}.dispatch-container .batch-label{font-size:11px}.dispatch-container .batch-btn{font-size:11px;padding:4px 8px}.dispatch-container #sidebar{flex-basis:320px;width:320px}.dispatch-container .sidebar-toggle-tab{left:320px}.dispatch-container #body.compare-mode #sidebar{flex-basis:250px;width:250px}.dispatch-container #body.compare-mode .sidebar-toggle-tab{left:250px}.dispatch-container #body.compare-mode .sidebar-toggle-tab.is-collapsed{left:0}.dispatch-container .sb-header{padding:10px 12px}.dispatch-container .sb-tile{gap:6px;padding:6px 8px}.dispatch-container .sb-tile-value{font-size:16px}.dispatch-container .rcard{padding:10px}.dispatch-container .rcard-name{font-size:12px}.dispatch-container .rcard-zone{font-size:10px}.dispatch-container .step-wrap{padding:10px}.dispatch-container #route-detail{padding:12px}.dispatch-container .rd-rider-name{font-size:18px}.dispatch-container .rd-stats-grid{gap:4px}.dispatch-container .rd-stat{padding:8px 4px 6px}.dispatch-container .rd-stat-value{font-size:14px}.dispatch-container .rd-stat-label{font-size:9px}.dispatch-container .compare-header-v2{gap:6px;padding:8px 12px 6px}.dispatch-container .compare-header-row .compare-title{font-size:13px;gap:8px}.dispatch-container .compare-title-dot{height:8px;width:8px}.dispatch-container .compare-title-badge{font-size:9px;padding:2px 6px}.dispatch-container .compare-overall-btn,.dispatch-container .compare-sync-toggle{font-size:10px;gap:4px;padding:4px 8px}.dispatch-container .compare-overall-btn svg,.dispatch-container .compare-sync-toggle svg{font-size:12px}.dispatch-container .compare-timeline-wrap{gap:4px}.dispatch-container .compare-timeline-container{border-radius:8px;gap:12px;padding:12px}.dispatch-container .compare-timeline-labels{border-right-width:1px;gap:12px;padding-right:10px}.dispatch-container .compare-timeline-label{font-size:9px;height:24px}.dispatch-container .compare-timeline-scrollable{-ms-overflow-style:none;display:flex;flex:1 1;flex-direction:column;gap:12px;overflow-x:auto;scrollbar-width:none}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar{height:4px}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-track{background:#0000}.dispatch-container .compare-timeline-scrollable::-webkit-scrollbar-thumb{background:#6366f140;border-radius:999px}.dispatch-container .compare-timeline-scrollable:hover::-webkit-scrollbar-thumb{background:#6366f180}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:14px}.dispatch-container .compare-step{gap:4px}.dispatch-container .compare-step-circle{box-shadow:0 1px 4px #0f172a1a,0 0 0 1px #fff9;font-size:10px;height:24px;width:24px}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px #6366f1;box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px var(--step-color,#6366f1);transform:scale(1.1)}.dispatch-container .compare-step-spacer{margin-bottom:14px;width:10px}.dispatch-container .compare-step-tick{font-size:9px}.dispatch-container .compare-step-flag{border-width:1px;height:8px;right:-3px;top:-3px;width:8px}.dispatch-container .compare-progress-strip{margin-top:2px}.dispatch-container .compare-progress-text{font-size:9px}.dispatch-container .compare-legend{gap:8px;margin-top:0;padding-top:2px}.dispatch-container .compare-legend-item{font-size:9px}.dispatch-container .compare-legend-swatch{height:10px;width:10px}.dispatch-container .compare-legend-note{display:none}.dispatch-container .compare-delta{gap:6px;padding:8px 12px}.dispatch-container .compare-delta-title{gap:8px;margin-bottom:4px}.dispatch-container .compare-delta-step-badge{font-size:11px;height:20px;width:20px}.dispatch-container .compare-delta-title-main{font-size:12px}.dispatch-container .compare-delta-title-sub{font-size:9px}.dispatch-container .compare-delta-status{font-size:9px;padding:2px 6px}.dispatch-container .compare-delta-grid{gap:6px}.dispatch-container .compare-delta-cell{border-radius:8px;padding:5px 8px 4px}.dispatch-container .compare-delta-cell-label{font-size:9px;margin-bottom:1px}.dispatch-container .compare-delta-cell-val{font-size:13px}.dispatch-container .compare-delta-cell-unit{font-size:8px}.dispatch-container .compare-delta-cell-sub{font-size:9px;margin-top:1px}}@media (max-height:750px){.dispatch-container #hdr,.dispatch-container #strat-row{height:42px}.dispatch-container #strat-row .sbt{border:1px solid #0f172a14;border-radius:6px;font-size:11px;padding:5px 10px}.dispatch-container #batch-row{padding:4px 16px}.dispatch-container .compare-header-v2{gap:6px;padding:8px 12px 6px}.dispatch-container .compare-header-row .compare-title{font-size:13px;gap:8px}.dispatch-container .compare-title-dot{height:8px;width:8px}.dispatch-container .compare-title-badge{font-size:9px;padding:2px 6px}.dispatch-container .compare-overall-btn,.dispatch-container .compare-sync-toggle{font-size:10px;gap:4px;padding:4px 8px}.dispatch-container .compare-overall-btn svg,.dispatch-container .compare-sync-toggle svg{font-size:12px}.dispatch-container .compare-timeline-wrap{gap:4px}.dispatch-container .compare-timeline-container{border-radius:8px;gap:12px;padding:12px}.dispatch-container .compare-timeline-labels{border-right-width:1px;gap:12px;padding-right:10px}.dispatch-container .compare-timeline-label{font-size:9px;height:24px}.dispatch-container .compare-timeline-scrollable{display:flex;flex:1 1;flex-direction:column;gap:12px;overflow-x:auto;padding-bottom:2px}.dispatch-container .compare-timeline-track.is-actual .compare-step-spacer,.dispatch-container .compare-timeline-track.is-planned .compare-step-spacer{margin-bottom:14px}.dispatch-container .compare-step{gap:4px}.dispatch-container .compare-step-circle{box-shadow:0 1px 4px #0f172a1a,0 0 0 1px #fff9;font-size:10px;height:24px;width:24px}.dispatch-container .compare-step.is-focused .compare-step-circle{box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px #6366f1;box-shadow:0 2px 6px #0f172a26,0 0 0 2px #fff,0 0 0 3px var(--step-color,#6366f1);transform:scale(1.1)}.dispatch-container .compare-step-spacer{margin-bottom:14px;width:10px}.dispatch-container .compare-step-tick{font-size:9px}.dispatch-container .compare-progress-strip{margin-top:2px}.dispatch-container .compare-progress-text{font-size:9px}.dispatch-container .compare-legend{gap:8px;margin-top:0;padding-top:2px}.dispatch-container .compare-legend-item{font-size:9px}.dispatch-container .compare-legend-swatch{height:10px;width:10px}.dispatch-container .compare-legend-note{display:none}.dispatch-container .compare-delta{gap:6px;padding:8px 12px}.dispatch-container .compare-delta-title{gap:8px;margin-bottom:4px}.dispatch-container .compare-delta-step-badge{font-size:11px;height:20px;width:20px}.dispatch-container .compare-delta-title-main{font-size:12px}.dispatch-container .compare-delta-title-sub{font-size:9px}.dispatch-container .compare-delta-status{font-size:9px;padding:2px 6px}.dispatch-container .compare-delta-grid{gap:6px}.dispatch-container .compare-delta-cell{border-radius:8px;padding:5px 8px 4px}.dispatch-container .compare-delta-cell-label{font-size:9px;margin-bottom:1px}.dispatch-container .compare-delta-cell-val{font-size:13px}.dispatch-container .compare-delta-cell-unit{font-size:8px}.dispatch-container .compare-delta-cell-sub{font-size:9px;margin-top:1px}}.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:12px}.dispatch-container .compare-delta-toggle-icon{align-items:center;color:#64748b;color:var(--text-muted,#64748b);display:inline-flex;font-size:18px;justify-content:center;transition:transform .22s cubic-bezier(.4,0,.2,1),color .15s ease}.dispatch-container .compare-delta-title:hover .compare-delta-toggle-icon{color:#3b82f6;color:var(--accent,#6366f1)}@media (max-width:1366px){.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:8px}.dispatch-container .compare-delta-toggle-icon{font-size:15px}}@media (max-height:750px){.dispatch-container .compare-delta.is-collapsible.is-collapsed{padding-bottom:8px}.dispatch-container .compare-delta-toggle-icon{font-size:15px}}.dispatch-container #body.compare-mode{grid-gap:12px;background:linear-gradient(180deg,#f8fafc,#eef2ff);display:grid;gap:12px;grid-template-columns:minmax(0,1fr) minmax(360px,440px);grid-template-rows:auto minmax(0,1fr);padding:12px;position:relative;transition:grid-template-columns .32s cubic-bezier(.4,0,.2,1)}.dispatch-container #body.compare-mode #sidebar,.dispatch-container #body.compare-mode .sidebar-toggle-tab{display:none!important}.dispatch-container #body.compare-mode.compare-data-collapsed{gap:0;grid-template-columns:minmax(0,1fr) 0}.dispatch-container #body.compare-mode.compare-data-collapsed .compare-data-panel{opacity:0;pointer-events:none;transform:translateX(20px)}.dispatch-container .compare-data-panel{transition:opacity .24s ease,transform .32s cubic-bezier(.4,0,.2,1)}.dispatch-container .compare-data-toggle-tab{align-items:center;background:#fff;border:1px solid #e2e8f0;border:1px solid var(--border,#0f172a1f);border-radius:10px;box-shadow:0 4px 12px #0f172a1f,0 1px 3px #0f172a0f;color:#1e293b;color:var(--text,#0f172a);cursor:pointer;display:inline-flex;font-size:18px;height:56px;justify-content:center;line-height:1;padding:0;position:absolute;right:452px;top:50%;transform:translate(50%,-50%);transition:right .32s cubic-bezier(.4,0,.2,1),background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;width:22px;z-index:1200}.dispatch-container .compare-data-toggle-tab:hover{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 6px 16px #6366f159;color:#fff;transform:translate(50%,-50%) scale(1.06)}.dispatch-container .compare-data-toggle-tab:focus-visible{outline:2px solid #3b82f6;outline:2px solid var(--accent,#3b82f6);outline-offset:2px}.dispatch-container .compare-data-toggle-tab.is-collapsed{border-radius:10px 0 0 10px;border-right:none;right:0;transform:translateY(-50%)}.dispatch-container .compare-data-toggle-tab.is-collapsed:hover{transform:translateY(-50%) scale(1.06)}.dispatch-container .compare-data-toggle-tab svg{display:block}.dispatch-container #body.compare-mode #compare-map-wrap{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;flex:none;grid-column:1;grid-row:1;margin:0;min-width:0;overflow:hidden}.dispatch-container #body.compare-mode #compare-map-wrap .compare-header-v2{background:#0000;border-bottom:0}.dispatch-container #body.compare-mode #map-wrap,.dispatch-container #body.compare-mode #map-wrap.compare-split{border-radius:14px;border-right:0;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;flex:none;grid-column:1;grid-row:2;margin:0;min-height:0;min-width:0;overflow:hidden}.dispatch-container .compare-view-switcher{align-items:stretch;animation:compare-label-in .22s ease-out;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fffffffa;border-radius:10px;box-shadow:0 6px 20px #0f172a1f,0 0 0 1px #0f172a14;display:inline-flex;gap:2px;left:12px;padding:4px;position:absolute;top:12px;z-index:600}.dispatch-container .compare-view-switcher button{-webkit-appearance:none;appearance:none;background:#0000;border:0;border-radius:7px;color:#475569;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.04em;padding:6px 14px;text-transform:uppercase;transition:background .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease;white-space:nowrap}.dispatch-container .compare-view-switcher button:hover{background:#6366f114;color:#4338ca}.dispatch-container .compare-view-switcher button:focus-visible{outline:2px solid #6366f180;outline-offset:1px}.dispatch-container .compare-view-switcher button.is-active{background:linear-gradient(135deg,#6366f1,#3b82f6);box-shadow:0 2px 8px #6366f159;color:#fff}.dispatch-container .compare-view-switcher button.is-active:hover{color:#fff;transform:translateY(-.5px)}.dispatch-container .compare-data-panel{animation:compare-slide-in .3s cubic-bezier(.4,0,.2,1);background:#fff;border-radius:14px;box-shadow:0 6px 24px #0f172a14,0 0 0 1px #0f172a0f;display:flex;flex-direction:column;grid-column:2;grid-row:1/3;min-height:0;min-width:0;overflow:hidden}.dispatch-container .cdp-head{align-items:center;background:linear-gradient(135deg,#6366f1,#3b82f6);border-bottom:1px solid #0f172a14;color:#fff;display:flex;flex-shrink:0;gap:12px;padding:14px 16px}.dispatch-container .cdp-head-title{align-items:center;display:flex;flex:1 1;gap:10px;min-width:0}.dispatch-container .cdp-rider-dot{border-radius:50%;box-shadow:0 0 0 2px #fff6;flex-shrink:0;height:14px;width:14px}.dispatch-container .cdp-head-text{display:flex;flex-direction:column;min-width:0}.dispatch-container .cdp-rider-name{color:#fff;font-size:15px;font-weight:800;letter-spacing:.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-head-badge{color:#ffffffd9;font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-close{align-items:center;background:#ffffff2e;border:0;border-radius:8px;color:#fff;cursor:pointer;display:inline-flex;font-size:18px;height:32px;justify-content:center;transition:background .15s ease,transform .15s ease;width:32px}.dispatch-container .cdp-close:hover{background:#ffffff52;transform:rotate(90deg)}.dispatch-container .cdp-scroll{display:flex;flex:1 1;flex-direction:column;gap:14px;min-height:0;overflow-y:auto;padding:14px 14px 18px}.dispatch-container .cdp-scroll::-webkit-scrollbar{width:8px}.dispatch-container .cdp-scroll::-webkit-scrollbar-track{background:#0000}.dispatch-container .cdp-scroll::-webkit-scrollbar-thumb{background:#0f172a24;border-radius:999px}.dispatch-container .cdp-section{background:#f8fafc;border:1px solid #0f172a0f;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:12px}.dispatch-container .cdp-section-head{align-items:center;color:#475569;display:flex;font-size:11px;font-weight:800;gap:8px;letter-spacing:.08em;text-transform:uppercase}.dispatch-container .cdp-section-icon{align-items:center;background:#6366f11f;border-radius:6px;color:#4338ca;display:inline-flex;font-size:14px;height:22px;justify-content:center;width:22px}.dispatch-container .cdp-section-icon.cdp-icon-warn{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-section-title{flex:1 1;min-width:0}.dispatch-container .cdp-section-sub{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:none}.dispatch-container .cdp-section-clear{background:#6366f11a;border:0;border-radius:999px;color:#4338ca;cursor:pointer;font-size:10px;font-weight:700;letter-spacing:.04em;padding:3px 9px;text-transform:none}.dispatch-container .cdp-section-clear:hover{background:#6366f133}.dispatch-container .cdp-tiles{grid-gap:8px;display:grid;gap:8px;grid-template-columns:1fr 1fr}.dispatch-container .cdp-tile{background:#fff;border:1px solid #0f172a12;border-radius:10px;display:flex;flex-direction:column;gap:4px;padding:10px 12px;transition:transform .15s ease,box-shadow .15s ease}.dispatch-container .cdp-tile:hover{box-shadow:0 4px 12px #0f172a0f;transform:translateY(-1px)}.dispatch-container .cdp-tile.is-warn{background:linear-gradient(180deg,#fff7ed,#fff);border-color:#f9731640}.dispatch-container .cdp-tile.is-loss{background:linear-gradient(180deg,#fef2f2,#fff);border-color:#ef444440}.dispatch-container .cdp-tile.is-gain{background:linear-gradient(180deg,#ecfdf5,#fff);border-color:#10b98140}.dispatch-container .cdp-tile-label{align-items:center;color:#64748b;display:flex;font-size:10px;font-weight:800;gap:5px;letter-spacing:.05em;text-transform:uppercase}.dispatch-container .cdp-tile-label svg{font-size:13px}.dispatch-container .cdp-tile-value{color:#0f172a;font-size:20px;font-weight:800;letter-spacing:-.01em;line-height:1.1}.dispatch-container .cdp-tile-value.is-over{color:#dc2626}.dispatch-container .cdp-tile-value.is-under{color:#16a34a}.dispatch-container .cdp-tile-unit{color:#94a3b8;font-size:12px;font-weight:700;margin-left:2px}.dispatch-container .cdp-tile-sub{color:#94a3b8;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-dev-list,.dispatch-container .cdp-step-list{display:flex;flex-direction:column;gap:6px;list-style:none;margin:0;padding:0}.dispatch-container .cdp-dev-item{align-items:center;background:#fff;border:1px solid #ef444433;border-radius:10px;cursor:pointer;display:flex;gap:10px;padding:8px 10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-dev-item:hover{box-shadow:0 3px 10px #ef44441f;transform:translateX(2px)}.dispatch-container .cdp-dev-item.is-focused{background:#fef2f2;border-color:#ef444499}.dispatch-container .cdp-dev-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #fff9,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cdp-dev-body{display:flex;flex:1 1;flex-direction:column;gap:5px;min-width:0}.dispatch-container .cdp-dev-title{color:#0f172a;font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-dev-meta{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .cdp-dev-chip{align-items:center;background:#ef44441a;border-radius:999px;color:#dc2626;display:inline-flex;font-size:12px;font-weight:700;padding:3px 9px}.dispatch-container .cdp-dev-chip.is-over{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-step{align-items:flex-start;background:#fff;border:1px solid #0f172a12;border-radius:10px;cursor:pointer;display:flex;gap:10px;padding:10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-step:hover{border-color:#6366f14d;box-shadow:0 4px 12px #0f172a14;transform:translateY(-1px)}.dispatch-container .cdp-step.is-focused{background:linear-gradient(180deg,#eef2ff,#fff);border-color:#6366f1a6;box-shadow:0 4px 14px #6366f12e}.dispatch-container .cdp-step.is-correct{border-color:#10b98140}.dispatch-container .cdp-step.is-anomaly{background:linear-gradient(180deg,#fef2f2,#fff);border-color:#ef444466}.dispatch-container .cdp-step.is-skipped{opacity:.65}.dispatch-container .cdp-step.is-loading{opacity:.7}.dispatch-container .cdp-step-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #fff9,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:15px;font-weight:800;height:34px;justify-content:center;position:relative;width:34px}.dispatch-container .cdp-step-check,.dispatch-container .cdp-step-flag{align-items:center;background:#fff;border-radius:50%;bottom:-3px;box-shadow:0 1px 3px #0f172a33;display:inline-flex;font-size:13px;height:16px;justify-content:center;position:absolute;right:-3px;width:16px}.dispatch-container .cdp-step-check{color:#16a34a}.dispatch-container .cdp-step-flag{color:#dc2626}.dispatch-container .cdp-step-body{display:flex;flex:1 1;flex-direction:column;gap:4px;min-width:0}.dispatch-container .cdp-step-title-row{align-items:center;display:flex;gap:6px;min-width:0}.dispatch-container .cdp-step-title{color:#0f172a;flex:1 1;font-size:15px;font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-step-status{align-items:center;border-radius:999px;display:inline-flex;flex-shrink:0;font-size:11px;font-weight:800;letter-spacing:.05em;padding:3px 9px;text-transform:uppercase}.dispatch-container .cdp-step-sub{color:#94a3b8;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-step-deltas{display:flex;flex-wrap:wrap;gap:6px 12px;margin-top:3px}.dispatch-container .cdp-step-delta{align-items:center;color:#475569;display:inline-flex;font-size:13px;font-weight:700;gap:4px}.dispatch-container .cdp-step-delta svg{color:#94a3b8;font-size:15px}.dispatch-container .cdp-step-delta small{color:#94a3b8;font-size:12px;font-weight:700}.dispatch-container .cdp-step-delta small.is-over,.dispatch-container .cdp-step-delta.is-over,.dispatch-container .cdp-step-delta.is-over svg{color:#dc2626}.dispatch-container .cdp-step-delta.is-under,.dispatch-container .cdp-step-delta.is-under svg{color:#16a34a}@media (max-width:1100px){.dispatch-container #body.compare-mode{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(360px,1fr) auto}.dispatch-container #body.compare-mode #compare-map-wrap{grid-column:1;grid-row:1}.dispatch-container #body.compare-mode #map-wrap,.dispatch-container #body.compare-mode #map-wrap.compare-split{grid-column:1;grid-row:2}.dispatch-container .compare-data-panel{grid-column:1;grid-row:3;max-height:50vh}.dispatch-container .compare-data-toggle-tab{display:none}}.dispatch-container.compare-open #batch-row,.dispatch-container.compare-open #strat-row{display:none!important}.dispatch-container .cdp-score-section{background:linear-gradient(135deg,#f8fafc,#eef2ff);border-color:#6366f12e;padding:14px}.dispatch-container .cdp-score-wrap{align-items:center;display:flex;gap:16px}.dispatch-container .cdp-score-ring{align-items:center;border-radius:50%;box-shadow:0 4px 14px #0f172a1a;display:inline-flex;flex-shrink:0;height:84px;justify-content:center;transition:background .5s ease;width:84px}.dispatch-container .cdp-score-inner{align-items:center;background:#fff;border-radius:50%;display:flex;flex-direction:column;gap:1px;height:70px;justify-content:center;width:70px}.dispatch-container .cdp-score-value{font-size:26px;font-weight:900;letter-spacing:-.02em;line-height:1}.dispatch-container .cdp-score-unit{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.05em}.dispatch-container .cdp-score-body{display:flex;flex:1 1;flex-direction:column;gap:2px;min-width:0}.dispatch-container .cdp-score-label{font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-score-title{color:#0f172a;font-size:15px;font-weight:800;letter-spacing:-.01em}.dispatch-container .cdp-score-sub{color:#64748b;font-size:11px;font-weight:600}.dispatch-container .cdp-timing-section .cdp-section-head{align-items:center;display:flex;gap:8px}.dispatch-container .cdp-timing-active-tag{align-items:center;background:#10b9811a;border-radius:999px;color:#16a34a;display:inline-flex;font-size:9px;font-weight:800;gap:5px;letter-spacing:.06em;margin-left:auto;padding:2px 8px 2px 6px;text-transform:uppercase}.dispatch-container .cdp-timing-active-pulse{animation:cdp-timing-pulse 1.8s cubic-bezier(.4,0,.6,1) infinite;background:#10b981;border-radius:50%;box-shadow:0 0 0 0 #10b9818c;height:6px;width:6px}@keyframes cdp-timing-pulse{0%{box-shadow:0 0 0 0 #10b9818c}70%{box-shadow:0 0 0 8px #10b98100}to{box-shadow:0 0 0 0 #10b98100}}.dispatch-container .cdp-timing-clock{grid-gap:8px;align-items:center;background:radial-gradient(120% 80% at 50% 0,#6366f112 0,#0000 60%),linear-gradient(180deg,#fbfcff,#fff);border:1px solid #0f172a12;border-radius:14px;box-shadow:0 1px 2px #0f172a08;display:grid;gap:8px;grid-template-columns:1fr minmax(70px,1.3fr) 1fr;padding:18px 14px 16px;position:relative}.dispatch-container .cdp-clock-card{align-items:center;display:flex;flex-direction:column;gap:6px;min-width:0}.dispatch-container .cdp-clock-label{align-items:center;color:#64748b;display:inline-flex;font-size:10px;font-weight:800;gap:4px;letter-spacing:.07em;text-transform:uppercase}.dispatch-container .cdp-clock-label svg{font-size:13px}.dispatch-container .cdp-clock-card.is-start .cdp-clock-label svg{color:#10b981}.dispatch-container .cdp-clock-card.is-end .cdp-clock-label svg{color:#f59e0b}.dispatch-container .cdp-clock-face{align-items:baseline;background:linear-gradient(180deg,#1e293b,#0b1220);border-radius:12px;box-shadow:0 2px 4px #0f172a2e,0 8px 18px #0f172a1f,inset 0 1px 0 #ffffff12,inset 0 -1px 0 #0006;display:inline-flex;gap:5px;padding:10px 14px;position:relative}.dispatch-container .cdp-clock-face:after{background:linear-gradient(180deg,#ffffff0a,#0000 50%);border-radius:11px;content:"";inset:1px;pointer-events:none;position:absolute}.dispatch-container .cdp-clock-card.is-start .cdp-clock-face{border-top:1px solid #10b98166}.dispatch-container .cdp-clock-card.is-end .cdp-clock-face{border-top:1px solid #f59e0b66}.dispatch-container .cdp-clock-time{font-feature-settings:"tnum";color:#f1f5f9;font-family:SF Mono,Roboto Mono,Menlo,Consolas,monospace;font-size:24px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.02em;line-height:1;text-shadow:0 0 12px #a7c3ff2e}.dispatch-container .cdp-clock-period{background:#ffffff14;border-radius:4px;color:#cbd5e1;font-size:10px;font-weight:800;letter-spacing:.1em;padding:1px 5px}.dispatch-container .cdp-clock-caption{color:#94a3b8;font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.dispatch-container .cdp-clock-card.is-start .cdp-clock-caption{color:#16a34a}.dispatch-container .cdp-clock-card.is-end .cdp-clock-caption{color:#d97706}.dispatch-container .cdp-clock-track{align-items:center;display:flex;height:60px;justify-content:center;min-width:70px;position:relative}.dispatch-container .cdp-clock-track-line{background:linear-gradient(90deg,#10b981,#6366f1 50%,#f59e0b);border-radius:999px;box-shadow:0 1px 2px #6366f12e;height:4px;left:4px;position:absolute;right:4px;top:50%;transform:translateY(-50%)}.dispatch-container .cdp-clock-track-dot{border-radius:50%;height:11px;position:absolute;top:50%;transform:translateY(-50%);width:11px;z-index:1}.dispatch-container .cdp-clock-track-dot.is-start{background:#10b981;box-shadow:0 0 0 2px #fff,0 0 0 5px #10b98140;left:0}.dispatch-container .cdp-clock-track-dot.is-end{background:#f59e0b;box-shadow:0 0 0 2px #fff,0 0 0 5px #f59e0b40;right:0}.dispatch-container .cdp-clock-duration{align-items:center;background:#fff;border:1px solid #6366f133;border-radius:12px;box-shadow:0 4px 12px #0f172a14,0 1px 3px #6366f11f;display:inline-flex;flex-direction:column;gap:0;min-width:56px;padding:6px 10px 5px;position:relative;white-space:nowrap;z-index:2}.dispatch-container .cdp-clock-duration-icon{align-items:center;background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;box-shadow:0 2px 4px #6366f159;color:#fff;display:inline-flex;font-size:12px;height:20px;justify-content:center;margin-bottom:3px;width:20px}.dispatch-container .cdp-clock-duration-val{font-feature-settings:"tnum";color:#0f172a;font-size:14px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.01em;line-height:1.1}.dispatch-container .cdp-clock-duration-sub{color:#94a3b8;font-size:8px;font-weight:800;letter-spacing:.1em;margin-top:1px;text-transform:uppercase}.dispatch-container .cdp-timing-stats{grid-gap:10px;display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-top:12px}.dispatch-container .cdp-timing-stat{background:#fff;border:1px solid #0f172a12;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:12px;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.dispatch-container .cdp-timing-stat:hover{border-color:#6366f14d;box-shadow:0 4px 12px #6366f11a;transform:translateY(-1px)}.dispatch-container .cdp-timing-stat-head{align-items:center;display:flex;gap:10px}.dispatch-container .cdp-timing-stat-icon{align-items:center;background:linear-gradient(135deg,#6366f126,#4338ca1a);border-radius:10px;box-shadow:inset 0 0 0 1px #6366f11f;color:#4338ca;display:inline-flex;flex-shrink:0;font-size:20px;height:36px;justify-content:center;width:36px}.dispatch-container .cdp-timing-stat-body{display:flex;flex-direction:column;gap:1px;min-width:0}.dispatch-container .cdp-timing-stat-value{font-feature-settings:"tnum";color:#0f172a;font-size:18px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:-.02em;line-height:1.1}.dispatch-container .cdp-timing-stat-unit{color:#94a3b8;font-size:11px;font-weight:700;margin-left:3px}.dispatch-container .cdp-timing-stat-label{color:#94a3b8;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .cdp-timing-stat-viz{align-items:center;border-top:1px dashed #0f172a14;display:flex;gap:6px;padding-top:8px}.dispatch-container .cdp-timing-stat-viz-label{color:#94a3b8;font-size:10px;font-weight:700;margin-left:auto;white-space:nowrap}.dispatch-container .cdp-stops-dots{flex-wrap:wrap}.dispatch-container .cdp-stop-dot{background:linear-gradient(135deg,#6366f1,#4338ca);border-radius:50%;box-shadow:0 1px 2px #6366f14d;flex-shrink:0;height:6px;width:6px}.dispatch-container .cdp-speed-gauge{align-items:stretch;flex-direction:column;gap:4px}.dispatch-container .cdp-speed-gauge-track{background:#0f172a0f;border-radius:999px;height:6px;overflow:hidden;position:relative}.dispatch-container .cdp-speed-gauge-fill{background:linear-gradient(90deg,#10b981,#6366f1 60%,#f59e0b);border-radius:999px;box-shadow:0 1px 3px #6366f14d;height:100%;transition:width .4s cubic-bezier(.4,0,.2,1)}.dispatch-container .cdp-speed-gauge-scale{font-feature-settings:"tnum";color:#94a3b8;display:flex;font-size:9px;font-variant-numeric:tabular-nums;font-weight:700;justify-content:space-between;letter-spacing:.04em}.dispatch-container .cdp-highlights{display:flex;flex-direction:column;gap:10px}.dispatch-container .cdp-highlight{align-items:stretch;background:#fff;border:1px solid #0f172a12;border-radius:12px;cursor:pointer;display:flex;overflow:hidden;padding:0;position:relative;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-highlight:hover{box-shadow:0 6px 16px #0f172a14;transform:translateX(2px)}.dispatch-container .cdp-highlight-rail{align-self:stretch;flex-shrink:0;width:4px}.dispatch-container .cdp-highlight-content{display:flex;flex:1 1;flex-direction:column;gap:8px;min-width:0;padding:12px 14px}.dispatch-container .cdp-highlight.is-best{background:linear-gradient(90deg,#10b98112,#fff 65%);border-color:#10b98147}.dispatch-container .cdp-highlight.is-best:hover{border-color:#10b98180}.dispatch-container .cdp-highlight.is-best .cdp-highlight-rail{background:linear-gradient(180deg,#10b981,#16a34a)}.dispatch-container .cdp-highlight.is-worst{background:linear-gradient(90deg,#ef444412,#fff 65%);border-color:#ef444447}.dispatch-container .cdp-highlight.is-worst:hover{border-color:#ef444480}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-rail{background:linear-gradient(180deg,#ef4444,#dc2626)}.dispatch-container .cdp-highlight-top{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .cdp-highlight-label{align-items:center;display:inline-flex;font-size:11px;font-weight:800;gap:6px;letter-spacing:.06em;min-width:0;text-transform:uppercase}.dispatch-container .cdp-highlight.is-best .cdp-highlight-label{color:#16a34a}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-label{color:#dc2626}.dispatch-container .cdp-highlight-chip{align-items:center;border-radius:7px;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;height:22px;justify-content:center;width:22px}.dispatch-container .cdp-highlight.is-best .cdp-highlight-chip{background:linear-gradient(135deg,#10b981,#16a34a);box-shadow:0 1px 3px #10b98159}.dispatch-container .cdp-highlight.is-worst .cdp-highlight-chip{background:linear-gradient(135deg,#ef4444,#dc2626);box-shadow:0 1px 3px #ef444459}.dispatch-container .cdp-highlight-step-chip{align-items:center;border-radius:999px;box-shadow:0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.05em;padding:3px 9px;text-transform:uppercase}.dispatch-container .cdp-highlight-title{color:#0f172a;font-size:15px;font-weight:700;letter-spacing:-.01em;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-highlight-meta{align-items:center;display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .cdp-highlight-pill{font-feature-settings:"tnum";align-items:center;border-radius:999px;display:inline-flex;font-size:11px;font-variant-numeric:tabular-nums;font-weight:800;letter-spacing:.01em;padding:3px 9px}.dispatch-container .cdp-highlight-pill.is-bad{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-highlight-pill.is-good{background:#10b9811f;color:#16a34a}.dispatch-container .cdp-trips{display:flex;flex-direction:column;gap:8px}.dispatch-container .cdp-trip{background:#fff;border:1px solid #0f172a12;border-left:3px solid #6366f199;border-radius:10px;display:flex;flex-direction:column;gap:6px;padding:10px 12px}.dispatch-container .cdp-trip-head{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .cdp-trip-badge{align-items:center;background:#6366f11f;border-radius:999px;color:#4338ca;display:inline-flex;font-size:10px;font-weight:800;letter-spacing:.05em;padding:2px 8px;text-transform:uppercase}.dispatch-container .cdp-trip-meta{color:#64748b;font-size:11px;font-weight:700}.dispatch-container .cdp-trip-stats{display:flex;flex-wrap:wrap;gap:6px 14px}.dispatch-container .cdp-trip-stats span{align-items:center;color:#475569;display:inline-flex;font-size:12px;font-weight:700;gap:4px}.dispatch-container .cdp-trip-stats span svg{color:#94a3b8;font-size:13px}.dispatch-container .cdp-trip-stats span small{color:#94a3b8;font-size:10px;font-weight:700}.dispatch-container .cdp-trip-stats span.is-over,.dispatch-container .cdp-trip-stats span.is-over svg{color:#dc2626}.dispatch-container .cdp-section-head-clickable{cursor:pointer;-webkit-user-select:none;user-select:none}.dispatch-container .cdp-section-head-clickable:hover .cdp-section-title{color:#4338ca}.dispatch-container .cdp-seq-status{border-radius:999px;flex-shrink:0;font-size:12px;font-weight:800;letter-spacing:.05em;padding:3px 10px;text-transform:uppercase}.dispatch-container .cdp-seq-status.is-good{background:#10b9811f;color:#16a34a}.dispatch-container .cdp-seq-status.is-warn{background:#ef44441f;color:#dc2626}.dispatch-container .cdp-seq-toggle{align-items:center;color:#94a3b8;display:inline-flex;font-size:18px;justify-content:center;transition:transform .22s cubic-bezier(.4,0,.2,1)}.dispatch-container .cdp-seq-toggle.is-open{color:#4338ca;transform:rotate(180deg)}.dispatch-container .cdp-seq{animation:cdp-seq-in .22s cubic-bezier(.4,0,.2,1);background:#fff;border:1px solid #0f172a12;border-radius:10px;display:flex;flex-direction:column;gap:10px;padding:12px}@keyframes cdp-seq-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .cdp-seq-diffs{display:flex;flex-direction:column;gap:6px;list-style:none;margin:4px 0 0;padding:0}.dispatch-container .cdp-seq-diff{align-items:center;background:linear-gradient(180deg,#fef2f2,#fff);border:1px solid #ef444433;border-radius:8px;cursor:pointer;display:flex;gap:10px;padding:8px 10px;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}.dispatch-container .cdp-seq-diff:hover{box-shadow:0 3px 10px #ef44441f;transform:translateX(2px)}.dispatch-container .cdp-seq-diff.is-focused{border-color:#ef444499;box-shadow:0 3px 12px #ef444433}.dispatch-container .cdp-seq-diff-num{align-items:center;border-radius:50%;box-shadow:0 0 0 2px #ffffffb3,0 1px 3px #0f172a26;color:#fff;display:inline-flex;flex-shrink:0;font-size:14px;font-weight:800;height:30px;justify-content:center;width:30px}.dispatch-container .cdp-seq-diff-body{display:flex;flex:1 1;flex-direction:column;gap:2px;min-width:0}.dispatch-container .cdp-seq-diff-title{color:#0f172a;font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .cdp-seq-diff-sub{color:#64748b;font-size:13px;font-weight:600}.dispatch-container .cdp-seq-diff-tag{background:#ef44441f;border-radius:999px;color:#dc2626;flex-shrink:0;font-size:13px;font-weight:800;padding:3px 10px}.dispatch-container .cdp-seq-good{align-items:center;background:#10b98114;border-radius:8px;color:#16a34a;display:inline-flex;font-size:14px;font-weight:700;gap:6px;padding:6px 10px}.dispatch-container .cdp-seq-good svg{font-size:18px}.dispatch-container .cdp-seq-diff.is-group{background:linear-gradient(180deg,#eef2ff,#fff);border-color:#6366f14d;padding-right:40px;position:relative}.dispatch-container .cdp-seq-diff.is-group:hover{border-color:#6366f18c;box-shadow:0 3px 10px #6366f126}.dispatch-container .cdp-seq-diff.is-group.is-expanded{background:linear-gradient(180deg,#e0e7ff,#f5f7ff);border-bottom-left-radius:0;border-bottom-right-radius:0;border-color:#6366f199}.dispatch-container .cdp-seq-group-num{align-items:center;display:inline-flex;flex-shrink:0;height:30px;justify-content:center;position:relative;width:30px}.dispatch-container .cdp-seq-group-num-bg{border-radius:8px;box-shadow:0 0 0 2px #ffffffb3,0 1px 3px #0f172a26;inset:0;position:absolute}.dispatch-container .cdp-seq-group-num-label{color:#fff;font-size:13px;font-weight:800;letter-spacing:-.01em;position:relative;text-shadow:0 1px 2px #00000040}.dispatch-container .cdp-seq-group-delta{align-items:center;background:#6366f126;border-radius:999px;color:#4338ca;display:inline-flex;font-size:13px;font-weight:800;margin-left:4px;padding:2px 8px;vertical-align:1px}.dispatch-container .cdp-seq-group-toggle{align-items:center;background:#ffffffb3;border-radius:6px;color:#4338ca;display:inline-flex;font-size:18px;height:22px;justify-content:center;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%);transition:transform .22s cubic-bezier(.4,0,.2,1);width:22px}.dispatch-container .cdp-seq-group-toggle.is-open{background:#6366f12e;transform:translateY(-50%) rotate(180deg)}.dispatch-container .cdp-seq-group-children-wrap{animation:cdp-seq-group-in .22s cubic-bezier(.4,0,.2,1);background:#6366f10d;border-bottom:1px solid #6366f133;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border-left:2px solid #6366f159;border-right:1px solid #6366f133;list-style:none;margin:-2px 0 0 4px;padding:0}@keyframes cdp-seq-group-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.dispatch-container .cdp-seq-group-children{display:flex;flex-direction:column;gap:4px;list-style:none;margin:0;padding:8px 8px 8px 14px}.dispatch-container .cdp-seq-diff.is-nested{background:#fff;border-color:#6366f126;border-radius:8px;padding:6px 8px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-num{font-size:13px;height:26px;width:26px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-title{font-size:13.5px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-sub{font-size:12.5px}.dispatch-container .cdp-seq-diff.is-nested .cdp-seq-diff-tag{font-size:12px;padding:2px 8px}.dispatch-container .compare-data-panel.cdp-is-mobile{border-radius:0}.dispatch-container .compare-data-panel.cdp-is-mobile .cdp-timing-clock{gap:14px;grid-template-columns:1fr}.dispatch-container .compare-data-panel.cdp-is-mobile .cdp-clock-track{height:48px;min-width:0}.dispatch-container .compare-data-panel.cdp-is-mobile .cdp-timing-stats{grid-template-columns:1fr}.dispatch-container .rcard-est-meters{align-items:center;background:#3b82f614;background:var(--accent-soft,#3b82f614);border-radius:6px;color:#3b82f6;color:var(--accent,#3b82f6);display:inline-flex;font-size:11px;font-weight:700;gap:3px;padding:2px 8px}.dispatch-container .zone-order-chip.est-meters-chip{background:#2563eb14;border-color:#2563eb33;color:#2563eb}.dispatch-container .pu-distance-chip.pu-est-meters{background:#2563eb14;border-color:#2563eb33}.dispatch-container .pu-distance-chip.pu-est-meters .pu-distance-icon{color:#2563eb}.dispatch-container .pu-distance-chip.pu-est-meters .pu-distance-value{color:#2563eb;font-weight:700}.dispatch-container #dispatch-top-tabs{align-items:center;background:#0000;display:inline-flex;flex-shrink:0;gap:4px;padding:0}.dispatch-container #dispatch-top-tabs.dtt-inline{margin-right:4px}.dispatch-container .dtt-tab{align-items:center;background:#fff;background:var(--bg);border:1px solid #e2e8f0;border:1px solid var(--border);border-radius:999px;color:#64748b;color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:12px;font-weight:700;gap:6px;line-height:1;padding:6px 12px;transition:color .15s,background .15s,border-color .15s}.dispatch-container .dtt-tab:hover{background:#f8fafc;background:var(--bg-sub);color:#1e293b;color:var(--text)}.dispatch-container .dtt-tab.active{background:#3b82f6;background:var(--accent);border-color:#3b82f6;border-color:var(--accent);box-shadow:0 2px 6px #3b82f640;color:#fff}.dispatch-container .dtt-icon{align-items:center;display:inline-flex;font-size:14px}.dispatch-container #dispatch-analysis{background:#f8fafc;display:flex;flex:1 1;flex-direction:column;gap:18px;overflow:auto;padding:20px}.dispatch-container .da-intro-title{color:#1e293b;color:var(--text);font-size:16px;font-weight:700;margin-bottom:4px}.dispatch-container .da-intro-sub{color:#64748b;color:var(--text-muted);font-size:12.5px;line-height:1.5}.dispatch-container .da-code{background:#eef2ff;border-radius:4px;color:#4f46e5;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;margin:0 4px;padding:1px 6px}.dispatch-container .da-picker-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width:720px){.dispatch-container .da-picker-row{grid-template-columns:1fr}}.dispatch-container .da-picker{background:#fff;border:1px solid #e2e8f0;border-radius:12px;cursor:pointer;font-family:inherit;padding:14px;text-align:left;transition:box-shadow .15s,transform .15s,border-color .15s}.dispatch-container .da-picker:hover:not(.is-loading){box-shadow:0 4px 14px -6px #0f172a26;transform:translateY(-1px)}.dispatch-container .da-picker.is-loading{cursor:wait;opacity:.7}.dispatch-container .da-picker-head{align-items:center;display:flex;gap:10px;margin-bottom:6px}.dispatch-container .da-picker-badge{align-items:center;border-radius:8px;display:inline-flex;font-size:13px;font-weight:800;height:32px;justify-content:center;width:32px}.dispatch-container .da-picker-meta{flex:1 1;min-width:0}.dispatch-container .da-picker-name{color:#1e293b;color:var(--text);font-size:14px;font-weight:700;line-height:1.2}.dispatch-container .da-picker-range{color:#64748b;color:var(--text-muted);font-size:11px}.dispatch-container .da-picker-status{border-radius:12px;flex-shrink:0;font-size:10.5px;font-weight:700;padding:4px 8px}.dispatch-container .da-picker-sub{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-empty{background:#fff;border:1px dashed #cbd5e1;border-radius:12px;color:#94a3b8;font-size:13px;padding:40px;text-align:center}.dispatch-container .da-result-row{grid-gap:14px;align-items:stretch;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}.dispatch-container .da-result-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;border-top:4px solid #6366f1;display:flex;flex-direction:column;gap:12px;padding:16px}.dispatch-container .da-result-head{align-items:center;display:flex;justify-content:space-between}.dispatch-container .da-result-title{color:#1e293b;color:var(--text);font-size:15px;font-weight:700}.dispatch-container .da-result-sub{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-result-refresh{align-items:center;border:none;border-radius:8px;cursor:pointer;display:inline-flex;font-size:16px;height:30px;justify-content:center;transition:filter .15s;width:30px}.dispatch-container .da-result-refresh:hover{filter:brightness(.95)}.dispatch-container .da-result-refresh:disabled{cursor:wait;opacity:.5}.dispatch-container .da-detail-actions{align-items:center;display:inline-flex;gap:10px}.dispatch-container .da-live-tag{align-items:center;background:#ecfdf5;border:1px solid #a7f3d0;border-radius:999px;color:#166534;display:inline-flex;font-size:11px;font-weight:700;gap:6px;letter-spacing:.02em;padding:4px 9px 4px 8px;transition:background .15s,color .15s,border-color .15s;-webkit-user-select:none;user-select:none}.dispatch-container .da-live-tag.is-active{background:#fffbeb;border-color:#fde68a;color:#92400e}.dispatch-container .da-live-dot{animation:da-live-pulse 1.8s ease-in-out infinite;background:#10b981;border-radius:50%;box-shadow:0 0 0 2px #10b9812e;height:7px;width:7px}.dispatch-container .da-live-tag.is-active .da-live-dot{animation:da-live-pulse .9s ease-in-out infinite;background:#f59e0b;box-shadow:0 0 0 2px #f59e0b38}@keyframes da-live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.dispatch-container .da-metric-grid{grid-gap:8px;display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}.dispatch-container .da-metric{background:#f8fafc;border:1px solid #eef2f6;border-radius:8px;padding:8px 10px}.dispatch-container .da-metric-label{color:#94a3b8;font-size:10px;font-weight:700;letter-spacing:.4px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-metric-value{color:#1e293b;color:var(--text);font-size:14px;font-weight:800;line-height:1.3}.dispatch-container .da-riders-label{color:#475569;font-size:11px;font-weight:700;letter-spacing:.4px;margin-bottom:6px;text-transform:uppercase}.dispatch-container .da-riders-list{display:flex;flex-direction:column;gap:4px}.dispatch-container .da-rider-row{align-items:center;background:#f8fafc;border:1px solid #eef2f6;border-radius:6px;display:flex;justify-content:space-between;padding:5px 10px}.dispatch-container .da-rider-name{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:12px;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .da-rider-stat{color:#64748b;color:var(--text-muted);flex-shrink:0;font-size:11px}.dispatch-container .da-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;color:#991b1b;display:flex;flex-direction:column;gap:4px;padding:12px}.dispatch-container .da-error-title{align-items:center;color:#b91c1c;display:inline-flex;font-size:12.5px;font-weight:800;gap:6px;letter-spacing:.3px;text-transform:uppercase}.dispatch-container .da-error-msg{color:#7f1d1d;font-size:13px;line-height:1.5}.dispatch-container .da-error-meta{color:#b45353;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.dispatch-container .da-detail{display:flex;flex-direction:column;gap:16px}.dispatch-container .da-detail-head{align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;border-top:4px solid #6366f1;display:flex;justify-content:space-between;padding:14px 16px}.dispatch-container .da-detail-title{color:#1e293b;color:var(--text);font-size:16px;font-weight:800;text-transform:capitalize}.dispatch-container .da-detail-sub-inline{color:#64748b;color:var(--text-muted);font-size:12.5px;font-weight:600;margin-left:6px}.dispatch-container .da-detail-sub{color:#64748b;color:var(--text-muted);font-size:11.5px;margin-top:2px}.dispatch-container .da-section{background:#fff;border:1px solid #e2e8f0;border-radius:12px;display:flex;flex-direction:column;gap:10px;padding:14px}.dispatch-container .da-section-label{color:#475569;font-size:12px;font-weight:800;letter-spacing:.4px;text-transform:uppercase}.dispatch-container .da-section-count{color:#94a3b8;font-weight:700;margin-left:4px}.dispatch-container .da-metric-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}@media (max-width:720px){.dispatch-container .da-metric-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}}.dispatch-container .da-rec{background:linear-gradient(135deg,#eef2ff,#f0fdf4);border:1px solid #c7d2fe;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:12px 14px}.dispatch-container .da-rec.da-rec-empty{background:#f8fafc;border:1px dashed #e2e8f0;color:#64748b}.dispatch-container .da-rec.da-rec-empty .da-rec-action{color:#64748b;font-weight:500;letter-spacing:0;text-transform:none}.dispatch-container .da-rec-head{align-items:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}.dispatch-container .da-rec-action{align-items:center;color:#4338ca;display:inline-flex;font-size:13px;font-weight:800;gap:6px;text-transform:capitalize}.dispatch-container .da-rec-improve{border-radius:14px;font-size:11.5px;font-weight:700;padding:4px 10px}.dispatch-container .da-rec-line{color:#1e293b;color:var(--text);font-size:13px;line-height:1.5}.dispatch-container .da-rec-desc{color:#475569;font-size:12.5px;line-height:1.55}.dispatch-container .da-rec-desc,.dispatch-container .da-rec-rules{background:#fff;border:1px solid #e0e7ff;border-radius:8px;padding:8px 10px}.dispatch-container .da-rec-rules{display:flex;flex-direction:column;gap:4px}.dispatch-container .da-rec-rules-head{color:#475569;font-size:11px;font-weight:700;letter-spacing:.3px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-rec-rule{color:#334155;font-size:12px}.dispatch-container .da-rec-rule code{background:#f1f5f9;border-radius:4px;color:#1e293b;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 6px}.dispatch-container .da-rec-rule-why{color:#64748b;color:var(--text-muted);font-size:11.5px}.dispatch-container .da-timeline-list{grid-gap:10px;display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.dispatch-container .da-timeline-card{background:#f8fafc;border:1px solid #eef2f6;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:10px 12px}.dispatch-container .da-timeline-top{align-items:center;display:flex;gap:8px;justify-content:space-between}.dispatch-container .da-timeline-name{align-items:center;color:#1e293b;color:var(--text);display:inline-flex;font-size:13px;font-weight:700;gap:6px;min-width:0}.dispatch-container .da-timeline-id{color:#64748b;color:var(--text-muted);font-size:10.5px;font-weight:600}.dispatch-container .da-pill{border-radius:12px;font-size:10.5px;font-weight:800;letter-spacing:.3px;padding:3px 9px;text-transform:uppercase}.dispatch-container .da-pill.is-active{background:#dcfce7;color:#166534}.dispatch-container .da-pill.is-idle{background:#fef3c7;color:#92400e}.dispatch-container .da-timeline-mid{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .da-chip{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:12px;color:#334155;display:inline-flex;font-size:11px;font-weight:600;gap:4px;padding:3px 8px}.dispatch-container .da-chip.da-chip-link{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8;cursor:pointer;font-family:inherit;text-decoration:none;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .1s ease}.dispatch-container .da-chip.da-chip-link:hover{background:#dbeafe;border-color:#93c5fd;color:#1e40af}.dispatch-container .da-chip.da-chip-link:active{transform:scale(.98)}.dispatch-container .da-chip.da-chip-link:focus-visible{outline:2px solid #3b82f6;outline-offset:1px}.dispatch-container .da-pos-modal-backdrop{align-items:center;animation:da-pos-fade .18s ease;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);background:#0f172a8c;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:2000}@keyframes da-pos-fade{0%{opacity:0}to{opacity:1}}.dispatch-container .da-pos-modal-card{animation:da-pos-rise .22s cubic-bezier(.16,1,.3,1);background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 24px 60px #0f172a47,0 8px 24px #0f172a1f;display:flex;flex-direction:column;overflow:hidden;width:min(720px,100%)}@keyframes da-pos-rise{0%{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dispatch-container .da-pos-modal-head{align-items:center;background:linear-gradient(135deg,#66258208,#9255ab14);border-bottom:1px solid #eef2f6;display:flex;flex:0 0 auto;gap:12px;justify-content:space-between;padding:14px 18px}.dispatch-container .da-pos-modal-title-wrap{align-items:center;display:flex;gap:12px;min-width:0}.dispatch-container .da-pos-modal-avatar{align-items:center;border-radius:12px;display:inline-flex;flex-shrink:0;font-size:22px;height:40px;justify-content:center;width:40px}.dispatch-container .da-pos-modal-title{color:#0f172a;font-size:15.5px;font-weight:800;letter-spacing:-.01em;line-height:1.2}.dispatch-container .da-pos-modal-sub{color:#64748b;font-size:11.5px;font-weight:600;letter-spacing:.01em;margin-top:2px}.dispatch-container .da-pos-modal-actions{align-items:center;display:inline-flex;flex-shrink:0;gap:8px}.dispatch-container .da-pos-modal-close{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:10px;color:#475569;cursor:pointer;display:inline-flex;font-size:18px;height:32px;justify-content:center;transition:background .15s,color .15s,border-color .15s,transform .1s;width:32px}.dispatch-container .da-pos-modal-close:hover{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.dispatch-container .da-pos-modal-close:active{transform:scale(.96)}.dispatch-container .da-pos-modal-map{background:#e2e8f0;flex:0 0 auto;height:420px;position:relative;width:100%}.dispatch-container .da-pos-modal-map .leaflet-container{background:#e2e8f0;height:100%!important;width:100%!important;z-index:1}.dispatch-container .da-pos-modal-foot{align-items:center;background:#f8fafc;border-top:1px solid #eef2f6;display:flex;flex:0 0 auto;gap:12px;justify-content:space-between;padding:12px 18px}.dispatch-container .da-pos-modal-coord{font-feature-settings:"tnum";align-items:center;color:#334155;display:inline-flex;font-size:12.5px;font-variant-numeric:tabular-nums;gap:8px}.dispatch-container .da-pos-modal-coord strong{color:#0f172a;font-weight:700}.dispatch-container .da-pos-modal-sep{color:#cbd5e1;margin:0 8px}.dispatch-container .da-pos-modal-copy{background:#662582;border:1px solid #662582;border-radius:999px;color:#fff;cursor:pointer;font-family:inherit;font-size:11.5px;font-weight:700;padding:6px 14px;transition:background .15s,border-color .15s,transform .1s}.dispatch-container .da-pos-modal-copy:hover{background:#4d1c61;border-color:#4d1c61}.dispatch-container .da-pos-modal-copy:active{transform:scale(.97)}.dispatch-container .da-sub-list{display:flex;flex-direction:column;gap:10px}.dispatch-container .da-sub-card{background:#fff;border:1px solid #e2e8f0;border-radius:10px;display:flex;flex-direction:column;gap:8px;padding:12px}.dispatch-container .da-sub-head{align-items:center;display:flex;flex-wrap:wrap;gap:6px;justify-content:space-between}.dispatch-container .da-sub-title{color:#1e293b;color:var(--text);font-size:13px;text-transform:capitalize}.dispatch-container .da-sub-improve{border-radius:12px;font-size:11.5px;font-weight:800;padding:3px 10px}.dispatch-container .da-sub-meta{display:flex;flex-wrap:wrap;gap:6px}.dispatch-container .da-sub-relieved{align-items:center;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;color:#166534;display:inline-flex;font-size:12px;gap:6px;padding:6px 10px}.dispatch-container .da-sub-transfers{background:#f8fafc;border:1px solid #eef2f6;border-radius:8px;display:flex;flex-direction:column;gap:4px;padding:8px 10px}.dispatch-container .da-sub-transfers-head{color:#475569;font-size:11px;font-weight:700;letter-spacing:.3px;margin-bottom:2px;text-transform:uppercase}.dispatch-container .da-transfer-row{grid-gap:8px;align-items:center;border-bottom:1px dashed #e2e8f0;color:#1e293b;color:var(--text);display:grid;font-size:11.5px;gap:8px;grid-template-columns:80px 1fr auto auto;padding:4px 0}.dispatch-container .da-transfer-row:last-child{border-bottom:none}.dispatch-container .da-transfer-id{color:#1e293b;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:800}.dispatch-container .da-transfer-from{color:#64748b;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dispatch-container .da-transfer-time{color:#334155;font-size:11px}.dispatch-container .da-transfer-imp{border-radius:10px;font-size:10.5px;font-weight:800;padding:2px 8px}.dispatch-container .da-hero-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:repeat(3,1fr)}@media (max-width:900px){.dispatch-container .da-hero-row{grid-template-columns:1fr}}.dispatch-container .da-hero-card{align-items:flex-start;background:#fff;border:1px solid #e2e8f0;border-radius:12px;border-top:3px solid #94a3b8;box-shadow:0 1px 2px #0f172a0a;display:flex;flex-direction:column;gap:4px;min-width:0;padding:18px 18px 16px;position:relative}.dispatch-container .da-hero-icon{align-items:center;border-radius:10px;display:inline-flex;font-size:20px;height:36px;justify-content:center;margin-bottom:4px;width:36px}.dispatch-container .da-hero-value{color:#0f172a;font-size:32px;font-weight:800;letter-spacing:-.02em;line-height:1.05}.dispatch-container .da-hero-unit{color:#64748b;font-size:16px;font-weight:600;margin-left:2px}.dispatch-container .da-hero-label{color:#64748b;font-size:11px;font-weight:700;letter-spacing:.06em;margin-top:2px;text-transform:uppercase}.dispatch-container .da-hero-sub{color:#94a3b8;font-size:12px;font-weight:500;margin-top:6px}.dispatch-container .da-health-row{grid-gap:12px;display:grid;gap:12px;grid-template-columns:1.2fr repeat(3,1fr)}@media (max-width:1100px){.dispatch-container .da-health-row{grid-template-columns:1fr 1fr}}@media (max-width:600px){.dispatch-container .da-health-row{grid-template-columns:1fr}}.dispatch-container .da-health-card{align-items:center;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 1px 2px #0f172a0a;display:flex;gap:14px;min-width:0;padding:14px 16px}.dispatch-container .da-health-card-stat{align-items:flex-start;flex-direction:column;gap:4px}.dispatch-container .da-health-value{color:#0f172a;font-size:24px;font-weight:800;letter-spacing:-.02em;line-height:1.1}.dispatch-container .da-health-unit{color:#64748b;font-size:13px;font-weight:600;margin-left:2px}.dispatch-container .da-health-label{color:#64748b;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.dispatch-container .da-health-sub{color:#94a3b8;font-size:11.5px;font-weight:500}.dispatch-container .da-health-meta{display:flex;flex-direction:column;gap:4px;min-width:0}.dispatch-container .da-ring{--ring-color:#10b981;--ring-pct:0;align-items:center;background:conic-gradient(var(--ring-color) calc(var(--ring-pct)*1%),#f1f5f9 0);border-radius:50%;display:inline-flex;flex-shrink:0;height:72px;justify-content:center;position:relative;width:72px}.dispatch-container .da-ring:after{background:#fff;border-radius:50%;content:"";inset:6px;position:absolute}.dispatch-container .da-ring-num{color:#0f172a;font-size:18px;font-weight:800;letter-spacing:-.02em;position:relative;z-index:1}.dispatch-container .da-ring-unit{color:#64748b;font-size:11px;font-weight:700;margin-left:1px}.dispatch-container .da-rec-banner{align-items:flex-start;border:1px solid;border-radius:12px;display:flex;gap:14px;padding:14px 16px}.dispatch-container .da-rec-banner.is-action{background:#eff6ff;border-color:#bfdbfe;color:#1e3a8a}.dispatch-container .da-rec-banner.is-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}.dispatch-container .da-rec-banner.is-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}.dispatch-container .da-rec-banner.is-info{background:#f8fafc;border-color:#e2e8f0;color:#475569}.dispatch-container .da-rec-banner-icon{align-items:center;background:#ffffff8c;border-radius:8px;display:inline-flex;flex:0 0 auto;font-size:18px;height:32px;justify-content:center;width:32px}.dispatch-container .da-rec-banner-body{display:flex;flex:1 1 auto;flex-direction:column;gap:6px;min-width:0}.dispatch-container .da-rec-banner .da-rec-action{align-items:center;color:inherit;display:inline-flex;font-size:14px;font-weight:700;gap:6px;letter-spacing:-.005em;text-transform:capitalize}.dispatch-container .da-rec-banner .da-rec-desc,.dispatch-container .da-rec-banner .da-rec-line{color:inherit;font-size:12.5px;line-height:1.5;opacity:.9}.dispatch-container .da-rec-banner .da-rec-assess{background:#0f172a0a;border-radius:8px;color:inherit;font-size:12px;font-weight:500;line-height:1.55;margin-top:2px;opacity:.95;padding:8px 10px}.dispatch-container .da-section-hint{color:#94a3b8;font-size:11px;font-weight:500;letter-spacing:0;margin-left:10px;text-transform:none}.dispatch-container .da-gantt-axis{align-items:center;color:#64748b;display:flex;font-size:11px;font-weight:600;justify-content:space-between;padding:0 4px 6px}.dispatch-container .da-gantt-axis-mid{color:#94a3b8;font-style:italic;font-weight:500}.dispatch-container .da-gantt-row{align-items:center;display:flex;gap:10px;margin:8px 0 4px}.dispatch-container .da-gantt-track{background:#f1f5f9;border-radius:8px;flex:1 1;height:24px;overflow:hidden;position:relative}.dispatch-container .da-gantt-fill{align-items:center;border-radius:8px;bottom:0;box-shadow:0 1px 0 #0f172a14;color:#fff;display:flex;font-size:10.5px;font-weight:700;justify-content:space-between;letter-spacing:.01em;overflow:hidden;padding:0 8px;position:absolute;top:0;white-space:nowrap}.dispatch-container .da-gantt-fill-end,.dispatch-container .da-gantt-fill-start{flex-shrink:0;text-shadow:0 1px 1px #0f172a2e}.dispatch-container .da-gantt-idle{background-image:repeating-linear-gradient(135deg,#e2e8f0 0 6px,#f1f5f9 6px 12px);border-left:1px dashed #cbd5e1;bottom:0;position:absolute;top:0}.dispatch-container .da-gantt-util{border-radius:6px;flex:0 0 auto;font-size:11.5px;font-weight:800;letter-spacing:.01em;min-width:44px;padding:4px 8px;text-align:center}.dispatch-container .da-conf-dot{border-radius:50%;display:inline-block;flex-shrink:0;height:7px;margin-left:4px;width:7px}.dispatch-container .da-conf-dot.is-ok{background:#10b981;box-shadow:0 0 0 2px #10b9812e}.dispatch-container .da-conf-dot.is-low{background:#f59e0b;box-shadow:0 0 0 2px #f59e0b33}.dispatch-container .da-chip.da-chip-orders{align-items:center;display:inline-flex;gap:8px}.dispatch-container .da-orders-label{color:#0f172a;font-size:11.5px;font-weight:700}.dispatch-container .da-orders-bar{background:#e2e8f0;border-radius:4px;flex-shrink:0;height:6px;overflow:hidden;position:relative;width:56px}.dispatch-container .da-orders-bar-fill{background:linear-gradient(90deg,#10b981,#34d399);border-radius:4px;inset:0;position:absolute;transition:width .3s ease;width:0}.dispatch-container .da-orders-pending{color:#b45309;font-size:10.5px;font-weight:600}@media (max-width:768px){.dispatch-container{height:auto;min-height:calc(100vh - 88px);overflow-x:hidden;overflow-y:auto}.dispatch-container #body{flex-direction:column;overflow:visible}.dispatch-container #map-wrap,.dispatch-container #map-wrap.compare-split{border-radius:0;flex:0 0 auto;height:48vh;margin-right:0;min-height:320px;min-width:0;order:1;width:100%}.dispatch-container #body.sidebar-collapsed #sidebar,.dispatch-container #sidebar{-webkit-overflow-scrolling:touch;border-right:0;border-right-color:#e2e8f0;border-right-color:var(--border);border-top:1px solid #e2e8f0;border-top:1px solid var(--border);flex:1 1 auto;flex-basis:auto;max-height:none;min-width:0;order:2;overflow-y:auto;width:100%}.dispatch-container .sidebar-toggle-tab{display:none}.dispatch-container #hdr{flex-wrap:wrap;gap:8px;height:auto;min-height:42px;padding:8px 16px}.dispatch-container #dispatch-analysis{overflow-y:visible}} \ No newline at end of file diff --git a/build/static/js/1148.f9207a95.chunk.js b/build/static/js/1148.f9207a95.chunk.js deleted file mode 100644 index 9748835..0000000 --- a/build/static/js/1148.f9207a95.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1148],{11148:(l,d,e)=>{e.r(d),e.d(d,{default:()=>h});var t=e(82053),a=e(60899),i=e(29925),n=e(36150),s=e(94826),r=e(52351),c=e(50027),o=e(81425),m=e(44414);const h=()=>{const{data:l,isLoading:d}=(0,n.I)({queryKey:["getuser"],queryFn:o.ts});return(0,m.jsxs)(m.Fragment,{children:[d&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r.A,{}),(0,m.jsx)(s.A,{})]}),(0,m.jsx)(c.A,{title:(0,m.jsx)(t.A,{variant:"h3",sx:{m:3},children:"User Profile"}),children:(0,m.jsxs)(a.Ay,{container:!0,spacing:4,children:[(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"User ID",value:(null===l||void 0===l?void 0:l.userid)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"User Name",value:(null===l||void 0===l?void 0:l.fullname)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"App Location ",value:(null===l||void 0===l?void 0:l.applocation)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"Auth Name",value:(null===l||void 0===l?void 0:l.authname)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"Contact No",value:(null===l||void 0===l?void 0:l.contactno)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"E-Mail",value:(null===l||void 0===l?void 0:l.email)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"Address",value:(null===l||void 0===l?void 0:l.address)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"Location",value:(null===l||void 0===l?void 0:l.suburb)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"City",value:(null===l||void 0===l?void 0:l.city)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"State",value:(null===l||void 0===l?void 0:l.state)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,m.jsx)(a.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,m.jsx)(i.A,{fullWidth:!0,label:"Postcode",value:(null===l||void 0===l?void 0:l.postcode)||"",InputProps:{readOnly:!0},variant:"standard"})})]})})]})}},62217:l=>{l.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},94826:(l,d,e)=>{e.d(d,{A:()=>c});var t=e(59254),a=e(46639),i=e(62217),n=e(44414);const s=(0,t.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),r=(0,t.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,n.jsxs)(s,{children:[(0,n.jsx)(a.A,{color:"primary",size:80,thickness:6}),(0,n.jsx)(r,{children:(0,n.jsx)("img",{src:i,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/1148.ffa93df1.chunk.js b/build/static/js/1148.ffa93df1.chunk.js new file mode 100644 index 0000000..bb02fa9 --- /dev/null +++ b/build/static/js/1148.ffa93df1.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1148],{11148:(d,l,e)=>{e.r(l),e.d(l,{default:()=>v});var t=e(47223),a=e(82053),i=e(60899),n=e(29925),s=e(14857),r=e(36150),o=e(94826),c=e(52351),m=e(50027),h=e(81425),u=e(44414);const v=()=>{const d=(0,s.A)(),l=(0,t.A)(d.breakpoints.down("md")),{data:e,isLoading:v}=(0,r.I)({queryKey:["getuser"],queryFn:h.ts});return(0,u.jsxs)(u.Fragment,{children:[v&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{}),(0,u.jsx)(o.A,{})]}),(0,u.jsx)(m.A,{contentSX:{p:l?2:3},title:(0,u.jsx)(a.A,{variant:"h3",sx:{m:{xs:1.5,md:3}},children:"User Profile"}),children:(0,u.jsxs)(i.Ay,{container:!0,spacing:{xs:2.5,md:4},children:[(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"User ID",value:(null===e||void 0===e?void 0:e.userid)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"User Name",value:(null===e||void 0===e?void 0:e.fullname)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"App Location ",value:(null===e||void 0===e?void 0:e.applocation)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"Auth Name",value:(null===e||void 0===e?void 0:e.authname)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"Contact No",value:(null===e||void 0===e?void 0:e.contactno)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"E-Mail",value:(null===e||void 0===e?void 0:e.email)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"Address",value:(null===e||void 0===e?void 0:e.address)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"Location",value:(null===e||void 0===e?void 0:e.suburb)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"City",value:(null===e||void 0===e?void 0:e.city)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"State",value:(null===e||void 0===e?void 0:e.state)||"",InputProps:{readOnly:!0},variant:"standard"})}),(0,u.jsx)(i.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,u.jsx)(n.A,{fullWidth:!0,label:"Postcode",value:(null===e||void 0===e?void 0:e.postcode)||"",InputProps:{readOnly:!0},variant:"standard"})})]})})]})}},62217:d=>{d.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},94826:(d,l,e)=>{e.d(l,{A:()=>o});var t=e(59254),a=e(46639),i=e(62217),n=e(44414);const s=(0,t.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),r=(0,t.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),o=()=>(0,n.jsxs)(s,{children:[(0,n.jsx)(a.A,{color:"primary",size:80,thickness:6}),(0,n.jsx)(r,{children:(0,n.jsx)("img",{src:i,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/1504.1fb0366f.chunk.js b/build/static/js/1504.1fb0366f.chunk.js deleted file mode 100644 index 6d8c5ac..0000000 --- a/build/static/js/1504.1fb0366f.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1504],{56311:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(89379),s=i(9950),r=i(2660),o=i(2046),l=i(83274),a=i(25333),c=i(97125),d=i(7762),x=i(52097),h=i(44414);const p=e=>{let{value:t,onChange:i,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:A}=e;const m=(0,s.useRef)(null),[j]=(0,x.d7)(t,g);return(0,s.useEffect)((()=>{p&&p(j)}),[j,p]),(0,s.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=m.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(r.A,{sx:(0,n.A)({},A),inputRef:m,placeholder:u,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>i(e.target.value),startAdornment:(0,h.jsx)(o.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>i(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,i)=>{i.d(t,{A:()=>h});var n=i(89379),s=i(9950),r=i(93230),o=i(41413),l=i(77922),a=i(29925),c=i(26910),d=i(31222),x=i(44414);const h=(0,s.forwardRef)(((e,t)=>{let{setAppId:i,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:A,pill:m=!1,accentColor:j="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:y}=e;const[v,S]=(0,s.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,s.useEffect)((()=>{0===v.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[v.length]);const w=e=>"".concat(j).concat(e),C=w("08"),k=w("26"),W=w("55"),z=w("18"),I=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(k)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},P=m&&(0,x.jsx)(r.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(o.A,{sx:{width:24,height:24,bgcolor:z,color:j,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:v||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:y,sx:(0,n.A)({},g),onChange:(e,t,n)=>{"clear"===n?(null===i||void 0===i||i(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):t&&(null===i||void 0===i||i(t.applocationid),null===h||void 0===h||h(t.locationname),null===p||void 0===p||p(0))},renderInput:e=>m?(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,n.A)((0,n.A)({},I),A||u||{})})):(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,n.A)({},A||u||{})}))})}))},71504:(e,t,i)=>{i.r(t),i.d(t,{default:()=>_e});var n=i(89379),s=i(9950),r=i(50027),o=i(26910),l=i(14857),a=i(52351),c=i(13838),d=i(4159),x=i.n(d),h=i(8881),p=i(99459),g=i(28217),u=i(55471),A=i.n(u),m=i(21209),j=i(2235),f=i(41413),b=i(93230),y=i(82053),v=i(16491),S=i(60899),w=i(82917),C=i(1320),k=i(15769),W=i(69780),z=i(9213),I=i(21671),P=i(34075),M=i(83274),R=i(25333),K=i(33738),_=i(48159),E=i(84142),L=i(48089),D=i(82223),O=i(50704),Y=i(29925),T=i(77922),B=i(25713),H=i(74745),q=i(6258),F=i(96583),N=i(40033),V=i(28170),X=i(29277),J=i(79739),U=i(9083),Z=i(8203),G=i(4729),Q=i(12678),$=i(94118),ee=i(24513),te=i(37476),ie=i(54826),ne=i(63057),se=i(85527),re=i(74930),oe=i(31222),le=i(21636),ae=i(39174),ce=i(59212),de=i(56311),xe=i(36150),he=i(81425),pe=i(96646),ge=i(44414);const ue=16,Ae="0 8px 24px rgba(15, 23, 42, 0.08)",me="0 18px 50px rgba(15, 23, 42, 0.18)",je="#0f172a",fe="#64748b",be="#94a3b8",ye="#e2e8f0",ve="#f1f5f9",Se="#f8fafc",we=(e,t)=>"".concat(e).concat(t),Ce=e=>we(e,"08"),ke=e=>we(e,"18"),We=e=>we(e,"26"),ze=e=>we(e,"55"),Ie={active:{label:"Active",color:"#10b981",icon:oe.mU9,statusKey:"active"},pending:{label:"Pending",color:"#f59e0b",icon:oe.tX0,statusKey:"pending"},inactive:{label:"Inactive",color:"#ef4444",icon:oe.uDv,statusKey:"inactive"}},Pe=[{status:"active",countKey:"active",tabStatus:"Active"},{status:"pending",countKey:"pending",tabStatus:"Pending"},{status:"inactive",countKey:"inactive",tabStatus:"InActive"}],Me=[{key:"active",label:"Active Tenants",color:"#10b981",icon:oe.mU9,countKey:"active"},{key:"pending",label:"Pending Approval",color:"#f59e0b",icon:oe.tX0,countKey:"pending"},{key:"inactive",label:"Inactive Tenants",color:"#ef4444",icon:oe.uDv,countKey:"inactive"}],Re=e=>(0,ge.jsx)(j.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:me,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Ke=e=>{let{color:t,selected:i,size:n=24,children:s}=e;return(0,ge.jsx)(f.A,{sx:{width:n,height:n,bgcolor:i?t:ke(t),color:i?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:s})},_e=()=>{var e;const t=(0,s.useRef)(null),[i,d]=(0,s.useState)(""),[u,me]=(0,s.useState)(""),[we,_e]=s.useState(10),[Ee,Le]=((0,l.A)(),(0,s.useState)(!1)),[De,Oe]=(0,s.useState)(0),[Ye,Te]=(0,s.useState)(""),[Be]=(0,s.useState)("All"),[He,qe]=s.useState(null),[Fe,Ne]=(0,s.useState)(0),[Ve,Xe]=(0,s.useState)(0),[Je,Ue]=(0,s.useState)(0),[Ze,Ge]=(0,s.useState)(null),[Qe,$e]=(0,s.useState)([]),[et,tt]=(0,s.useState)("active"),[it,nt]=(0,s.useState)({}),[st,rt]=(0,s.useState)(!1),[ot,lt]=(0,s.useState)([]),[at,ct]=(0,s.useState)({}),[dt,xt]=(0,s.useState)(!0),[ht,pt]=(0,s.useState)(""),[gt,ut]=(0,s.useState)(""),[At,mt]=(0,s.useState)(""),[jt,ft]=(0,s.useState)({}),[bt,yt]=(0,s.useState)({}),[vt,St]=(0,s.useState)(0),[wt,Ct]=(0,s.useState)("Active"),kt=()=>{rt(!1)},Wt=(e,t)=>{Ct(0==t?"Active":1==t?"Pending":"InActive"),Ne(t),d(""),St(0)},zt=(e,t)=>{console.log("newValue1",t),Xe(t)},It=(e,t)=>{console.log("newValue2",t),Ue(t)},[Pt,Mt]=(0,s.useState)(null),[Rt,Kt]=(0,s.useState)(null);(0,s.useEffect)((()=>{console.log("selectedCustomer",it)}),[it]),(0,s.useEffect)((()=>{Mt(-1),Kt(-1)}),[Fe]);const _t=(e,t,i)=>{(0,h.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:i})};const Et={current:null},[Lt,Dt]=(0,s.useState)(""),[Ot,Yt]=(0,s.useState)([]),Tt=(0,s.useRef)(!1);"undefined"===typeof window||Tt.current||(document.querySelector("#google-maps")||function(e,t,i){if(!t)return;const n=document.createElement("script");n.setAttribute("async",""),n.setAttribute("id",i),n.src=e,t.appendChild(n)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places"),document.querySelector("head"),"google-maps"),Tt.current=!0);const Bt=(0,s.useMemo)((()=>(0,m.A)(((e,t)=>{Et.current.getPlacePredictions(e,t)}),400)),[]);(0,s.useEffect)((()=>{let e=!0;if(!Et.current&&window.google&&(Et.current=new window.google.maps.places.AutocompleteService),Et.current){if(""!==Lt)return Bt({input:Lt},(t=>{if(e){let e=[];He&&(e=[He]),t&&(e=[...e,...t]),Yt(e)}})),()=>{e=!1};Yt(He?[He]:[])}}),[He,Lt,Bt]),p.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,s.useEffect)((()=>{try{console.log("selected address =>",ht),p.A.fromAddress(ht).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:i}=e.results[0].geometry.location;if(ft({lat:t,lng:i}),yt((0,n.A)((0,n.A)({},bt),{},{latitude:t.toString(),longitude:i.toString()})),e.results[0].address_components){let t,i,s,r,o=e.results[0];for(let e=0;e{console.log(e)}))}catch(e){console.log(e)}}),[ht]),(0,s.useEffect)((()=>{it&&ft({lat:it.latitude,lng:it.longitude})}),[it]),(0,s.useEffect)((()=>{const e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t.current.focus()),"Escape"===e.key&&document.activeElement===t.current&&t.current.blur()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[]);const{data:Ht,isLoading:qt,refetch:Ft}=(0,xe.I)({queryKey:["tenantList",De,u,et,vt,we],queryFn:he.ry}),{data:Nt=[],isLoading:Vt,refetch:Xt}=(0,xe.I)({queryKey:["gettenantsummary",De,et],queryFn:he.bd}),Jt=async()=>{await o.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/getpricinglist/?tenantid=").concat(Ze)).then((e=>{console.log("getpricinglist",e),e.data.status&&$e(e.data.details)})).catch((e=>{console.log(e)}))};(0,s.useEffect)((()=>{Ze&&Jt()}),[Ze]);(0,s.useEffect)((()=>{Ze&&(async e=>{try{let t=await o.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("tenantPricing",t.data.details),setTenanatPricing(t.data.details)}catch(t){console.log("fetchTenanatPricing",t)}})(Ze)}),[Ze]);const Ut=async e=>{let t;Le(!0),t=-1==e?{tenantid:Ze,approved:1}:{tenantid:e,status:"active"===et?"InActive":"Active"},await o.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),t).then((e=>{e.data.status&&(_t(0==Fe?"Inactivated Successfully":1==Fe?"Approved Successfully":"Activate Successfully","success",2e3),Ft(),Xt(),Le(!1))})).catch((e=>{console.log(e),_t(e.message,"error",1500),Le(!1)}))},Zt=async e=>{console.log("id",e);try{let t=await o.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapppricing/?applocationid=").concat(e));console.log("appPricingRes",t.data.details),lt(t.data.details)}catch(t){console.log("appPricingRes",t)}},Gt=async()=>{Le(!0),await o.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/createpricing"),{tenantpricingid:0,applocationid:De,pricingid:at.pricingid,tenantid:Ze,pricingdate:x()().format("YYYY-MM-DD HH:mm:ss"),configid:at.configid,pricingtypeid:at.pricingtypeid,slab:at.slab,baseprice:+at.baseprice,priceperkm:+at.priceperkm,minkm:+at.minkm,maxkm:+at.maxkm,orders:+at.minorder,othercharges:0}).then((e=>{e.data.status&&((0,h.M8)("Price Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),kt(),ct({}),Ut(-1),Jt())})).catch((e=>{console.log(e)}))},Qt=Ie[null===(e=Pe[Fe])||void 0===e?void 0:e.status]||Ie.active;return(0,ge.jsxs)(ge.Fragment,{children:[(qt||Vt||Ee)&&(0,ge.jsx)(a.A,{}),(0,ge.jsx)(j.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:ue/8,border:"1px solid",borderColor:ye,background:"linear-gradient(135deg, ".concat(Ce("#6366f1")," 0%, ").concat(Ce("#0ea5e9")," 100%)"),boxShadow:Ae},children:(0,ge.jsxs)(b.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,ge.jsxs)(b.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,ge.jsx)(f.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,ge.jsx)(oe.Itr,{size:22})}),(0,ge.jsxs)(b.A,{children:[(0,ge.jsx)(y.A,{variant:"h3",sx:{fontWeight:800,color:je,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Tenants"}),(0,ge.jsxs)(b.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,ge.jsx)(v.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,ge.jsxs)(y.A,{variant:"caption",sx:{color:fe,fontWeight:600},children:["Live \xb7 ",Ye||"All Zones"]})]})]})]}),(0,ge.jsx)(ce.A,{locations:Be,locaName:Ye,setAppId:Oe,setLocoName:Te,setPage:St,pill:!0,accentColor:"#6366f1",icon:(0,ge.jsx)(oe.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Re,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,ge.jsx)(S.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Me.map((e=>{var t;const i=e.icon,n=null!==(t=null===Nt||void 0===Nt?void 0:Nt[e.countKey])&&void 0!==t?t:0;return(0,ge.jsx)(S.Ay,{item:!0,xs:12,sm:4,children:(0,ge.jsxs)(j.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:ue/8,border:"1px solid",borderColor:ye,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:Ae,borderColor:ze(e.color)}},onClick:()=>{const t=Pe.findIndex((t=>t.countKey===e.countKey));t>=0&&Wt(0,t)},children:[(0,ge.jsx)(v.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(ke(e.color)," 100%)")}}),(0,ge.jsxs)(b.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,ge.jsxs)(b.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,ge.jsx)(y.A,{variant:"caption",sx:{color:fe,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Vt?(0,ge.jsx)(w.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,ge.jsx)(y.A,{sx:{fontWeight:800,color:je,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:n})]}),(0,ge.jsx)(f.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:ke(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(ze(e.color)),flexShrink:0},children:(0,ge.jsx)(i,{size:20})})]})]})},e.key)}))}),(0,ge.jsx)(j.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:ue/8,borderTopRightRadius:ue/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:ye,borderBottom:0,background:"#fff"},children:(0,ge.jsxs)(b.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,ge.jsx)(b.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:ye,borderRadius:4}},children:Pe.map(((e,t)=>{var i;const n=Ie[e.status],s=n.icon,r=Fe===t,o=null!==(i=null===Nt||void 0===Nt?void 0:Nt[e.countKey])&&void 0!==i?i:0;return(0,ge.jsxs)(v.A,{onClick:()=>{tt(e.status),Wt(0,t)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(r?n.color:ze(n.color)),bgcolor:r?n.color:Ce(n.color),color:r?"#fff":n.color,fontWeight:700,boxShadow:r?"0 6px 18px ".concat(We(n.color)):"none",transition:"all 0.18s","&:hover":{borderColor:n.color,boxShadow:r?"0 6px 18px ".concat(We(n.color)):"0 0 0 3px ".concat(We(n.color))}},children:[(0,ge.jsx)(f.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:r?"rgba(255,255,255,0.22)":ke(n.color),color:r?"#fff":n.color},children:(0,ge.jsx)(s,{size:13})}),(0,ge.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:n.label}),(0,ge.jsx)(v.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:r?"rgba(255,255,255,0.22)":"#fff",color:r?"#fff":n.color,border:r?"none":"1px solid ".concat(ze(n.color))},children:Vt?(0,ge.jsx)(w.A,{variant:"text",width:14,height:10}):o})]},e.status)}))}),(0,ge.jsx)(v.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,ge.jsx)(de.A,{value:i,onChange:d,onDebouncedChange:me,sx:{m:0,width:"100%",borderRadius:999,bgcolor:Ce("#6366f1"),"& fieldset":{borderColor:ze("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}})})]})}),(0,ge.jsxs)(j.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:ue/8,borderBottomRightRadius:ue/8,border:"1px solid",borderColor:ye,overflow:"hidden",background:"#fff"},children:[(0,ge.jsx)(C.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:"10px",height:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:ze("#6366f1"),borderRadius:"8px","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:Se}},children:(0,ge.jsxs)(k.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,ge.jsx)(W.A,{children:(0,ge.jsxs)(z.A,{sx:{"& th":{backgroundColor:Se,color:fe,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(ye),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,ge.jsx)(I.A,{children:"#"}),(0,ge.jsx)(I.A,{children:"Status"}),(0,ge.jsx)(I.A,{children:"Client"}),(0,ge.jsx)(I.A,{children:"Contact"}),(0,ge.jsx)(I.A,{children:"Address"}),(0,ge.jsx)(I.A,{align:"right",children:"Actions"})]})}),(0,ge.jsxs)(P.A,{children:[qt&&(0,ge.jsx)(pe.r,{}),0!=(null===Ht||void 0===Ht?void 0:Ht.length)||Ee?null===Ht||void 0===Ht?void 0:Ht.map(((e,t)=>{var i;const l=Ie[0===Fe?"active":1===Fe?"pending":"inactive"],a=l.icon;return(0,ge.jsxs)(s.Fragment,{children:[(0,ge.jsxs)(z.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(ve),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:Se}},children:[(0,ge.jsx)(I.A,{children:(0,ge.jsx)(y.A,{variant:"caption",sx:{fontWeight:700,color:be},children:String(t+1+vt*we).padStart(2,"0")})}),(0,ge.jsx)(I.A,{children:(0,ge.jsxs)(b.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:Ce(l.color),border:"1px solid ".concat(ze(l.color)),color:l.color},children:[(0,ge.jsx)(Ke,{color:l.color,size:20,children:(0,ge.jsx)(a,{size:12})}),(0,ge.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:l.label})]})}),(0,ge.jsx)(I.A,{children:(0,ge.jsxs)(b.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,ge.jsx)(Ke,{color:"#6366f1",size:32,children:(0,ge.jsx)(oe.Azs,{size:16})}),(0,ge.jsxs)(b.A,{children:[(0,ge.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:je,whiteSpace:"nowrap"},children:e.tenantname}),(0,ge.jsxs)(y.A,{variant:"caption",sx:{color:fe},children:["ID #",e.tenantid]})]})]})}),(0,ge.jsx)(I.A,{children:(0,ge.jsxs)(b.A,{children:[(0,ge.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:je,whiteSpace:"nowrap"},children:e.primarycontact||"\u2014"}),(0,ge.jsx)(y.A,{variant:"caption",sx:{color:fe},children:e.primaryemail||"\u2014"})]})}),(0,ge.jsx)(I.A,{sx:{maxWidth:280},children:(0,ge.jsx)(M.A,{title:e.address||"",placement:"top",children:(0,ge.jsx)(y.A,{variant:"caption",sx:{color:fe,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,ge.jsx)(I.A,{align:"right",children:(0,ge.jsxs)(b.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[0==Fe&&(0,ge.jsx)(M.A,{title:"Inactivate",placement:"top",children:(0,ge.jsx)(R.A,{size:"small",sx:{bgcolor:ke("#ef4444"),color:"#ef4444",border:"1px solid ".concat(ze("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{nt(e),Ge(e.tenantid),Oe(e.applocationid),setTimeout((()=>{Ut(e.tenantid)}),100)},children:(0,ge.jsx)(U.A,{style:{fontSize:14}})})}),1==Fe&&(0,ge.jsx)(M.A,{title:"Approve",placement:"top",children:(0,ge.jsx)(R.A,{size:"small",sx:{bgcolor:ke("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(ze("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{nt(e),rt(!0),Ge(e.tenantid),Oe(e.applocationid),Zt(e.applolcationid)},children:(0,ge.jsx)(Z.A,{style:{fontSize:14}})})}),2==Fe&&(0,ge.jsx)(M.A,{title:"Activate",placement:"top",children:(0,ge.jsx)(R.A,{size:"small",sx:{bgcolor:ke("#10b981"),color:"#10b981",border:"1px solid ".concat(ze("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{nt(e),Ge(e.tenantid),Oe(e.applocationid),setTimeout((()=>{Ut(e.tenantid)}),100)},children:(0,ge.jsx)(ie.yjt,{style:{fontSize:14}})})}),(0,ge.jsx)(M.A,{title:Pt===t?"Hide details":"View details",placement:"top",children:(0,ge.jsx)(R.A,{size:"small",sx:{bgcolor:Pt===t?"#6366f1":ke("#6366f1"),color:Pt===t?"#fff":"#6366f1",border:"1px solid ".concat(ze("#6366f1")),"&:hover":{bgcolor:"#6366f1",color:"#fff"}},onClick:()=>{var i;nt(e),i=t,Mt((e=>e===i?null:i)),Kt(-1),Ge(e.tenantid)},children:Pt===t?(0,ge.jsx)(G.A,{style:{fontSize:14}}):(0,ge.jsx)(Q.A,{style:{fontSize:14}})})}),1!==Fe&&(0,ge.jsx)(M.A,{title:Rt===t?"Close":"Edit",placement:"top",children:(0,ge.jsx)(R.A,{size:"small",sx:{bgcolor:Rt===t?"#8b5cf6":ke("#8b5cf6"),color:Rt===t?"#fff":"#8b5cf6",border:"1px solid ".concat(ze("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{var i;nt(e),i=t,Kt((e=>e===i?null:i)),Mt(-1),Ge(e.tenantid),Oe(e.applocationid)},children:Rt===t?(0,ge.jsx)($.A,{style:{fontSize:14}}):(0,ge.jsx)(ee.A,{style:{fontSize:14}})})})]})})]}),Pt===t&&(0,ge.jsx)(z.A,{children:(0,ge.jsx)(I.A,{sx:{"&:hover":{backgroundColor:"white !important"}},colSpan:15,children:(0,ge.jsx)(K.A,{in:open,timeout:800,easing:"ease-in-out",mountOnEnter:!0,unmountOnExit:!1,sx:{"& .MuiCollapse-wrapperInner":{transition:"transform 800ms ease, opacity 800ms ease"}},children:(0,ge.jsxs)(r.A,{content:!1,sx:{transform:open?"translateY(0)":"translateY(-8px)",opacity:open?1:0},title:(0,ge.jsxs)(_.A,{sx:{bgcolor:"primary.lighter"},value:Ve,onChange:zt,"aria-label":"basic tabs example",children:[(0,ge.jsx)(E.A,{label:" Details",icon:(0,ge.jsx)(ne.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),(0,ge.jsx)(E.A,{label:"Pricing",icon:(0,ge.jsx)(se.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}})]}),children:[0==Ve&&(0,ge.jsxs)(S.Ay,{container:!0,sx:{m:1},spacing:2.5,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(re.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.tenantname}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Tenant"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(re.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.firstname}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Contact Person"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(re.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.primarycontact}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Phone"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(le.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.primaryemail}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"E-Mail"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ie.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.address}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Address"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(se.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.city}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"City"})]}),(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(oe.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.postcode}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"PostCode"})]})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ne.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",children:e.latitude}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Latitude"})]}),(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ne.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsxs)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,ge.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.longitude}),(0,ge.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Longitude"})]})]})})]}),1==Ve&&(0,ge.jsx)(L.A,{variant:"outlined",sx:{},children:(0,ge.jsx)(C.A,{children:(0,ge.jsxs)(k.A,{children:[(0,ge.jsx)(W.A,{children:(0,ge.jsxs)(z.A,{children:[(0,ge.jsx)(I.A,{children:"#"}),(0,ge.jsx)(I.A,{children:"Date"}),(0,ge.jsx)(I.A,{children:"Slab"}),(0,ge.jsx)(I.A,{children:"Base Price"}),(0,ge.jsx)(I.A,{children:"Min Kms"}),(0,ge.jsx)(I.A,{children:"Price/Km"}),(0,ge.jsx)(I.A,{children:"Other Charges"})]})}),(0,ge.jsx)(P.A,{children:0===(null===Qe||void 0===Qe?void 0:Qe.length)?(0,ge.jsx)(z.A,{children:(0,ge.jsx)(I.A,{colSpan:7,align:"center",children:(0,ge.jsx)(c.A,{description:"No Pricing List"})})}):Qe.map(((e,t)=>(0,ge.jsxs)(z.A,{sx:{bgcolor:"white"},children:[(0,ge.jsx)(I.A,{children:t+1}),(0,ge.jsx)(I.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,ge.jsx)(I.A,{children:e.slab}),(0,ge.jsx)(I.A,{children:e.baseprice}),(0,ge.jsx)(I.A,{children:e.minkm}),(0,ge.jsx)(I.A,{children:e.priceperkm}),(0,ge.jsx)(I.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})}),Rt===t&&(0,ge.jsx)(z.A,{children:(0,ge.jsx)(I.A,{sx:{backgroundColor:"white!important","&:hover":{backgroundColor:"white!important"}},colSpan:15,children:(0,ge.jsxs)(r.A,{content:!1,title:(0,ge.jsxs)(v.A,{sx:{bgcolor:"primary.lighter",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,ge.jsxs)(_.A,{value:Je,onChange:It,"aria-label":"basic tabs example",children:[(0,ge.jsx)(E.A,{label:"Edit Details",icon:(0,ge.jsx)(ne.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),1!==Fe&&(0,ge.jsx)(E.A,{label:"Edit Pricing",icon:(0,ge.jsx)(se.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"},onClick:()=>{Zt(it.applolcationid)}})]}),1==Je&&(0,ge.jsx)(D.A,{variant:"contained",color:"error",size:"smaller",startIcon:(0,ge.jsx)(ee.A,{size:"small"}),sx:{mr:1.8,height:"30px"},onClick:()=>{rt(!0)},children:"Add Pricing"})]}),children:[0==Je&&(0,ge.jsx)(L.A,{variant:"outlined",sx:{m:2},children:(0,ge.jsx)(S.Ay,{container:!0,spacing:0,children:(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(L.A,{variant:"outlined",children:[(0,ge.jsx)(O.A,{children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ae.PY8,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{fullWidth:!0,id:"outlined-basic",label:"Tenant Name",defaultValue:it.tenantname,variant:"outlined",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{tenantname:e.target.value}))},sx:{mt:2}})})]})})," ",(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(re.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{fullWidth:!0,id:"outlined-basic",label:"Contact Person",defaultValue:e.firstname,variant:"outlined",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{firstname:e.target.value}))},sx:{mt:2}})})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(re.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{inputProps:{maxLength:10},fullWidth:!0,id:"outlined-basic",label:"Contact Number",defaultValue:it.primarycontact,variant:"outlined",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{primarycontact:e.target.value}))},sx:{mt:2}})})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:6,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(le.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{fullWidth:!0,id:"outlined-basic",label:"E-Mail",defaultValue:it.primaryemail,variant:"outlined",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{primaryemail:e.target.value}))},sx:{mt:2}})})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ie.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(T.A,{id:"google-map-demo",sx:{},fullWidth:!0,label:"Address",getOptionLabel:e=>"string"===typeof e?e:e.description,filterOptions:e=>e,options:Ot,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,defaultValue:it.address,noOptionsText:"No locations",onChange:(e,t)=>{Yt(t?[t,...Ot]:Ot),qe(t||""),console.log("newValue",t),pt((null===t||void 0===t?void 0:t.description)||""),yt((0,n.A)((0,n.A)({},bt),{},{address:(null===t||void 0===t?void 0:t.description)||""}))},onInputChange:(e,t)=>{Dt(t)},renderInput:e=>(0,ge.jsx)(Y.A,(0,n.A)((0,n.A)({},e),{},{fullWidth:!0,label:"Address",variant:"outlined"})),renderOption:(e,t)=>{const i=t.structured_formatting.main_text_matched_substrings||[],s=A()(t.structured_formatting.main_text,i.map((e=>[e.offset,e.offset+e.length])));return(0,ge.jsx)("li",(0,n.A)((0,n.A)({},e),{},{children:(0,ge.jsxs)(S.Ay,{container:!0,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,ge.jsx)(g.A,{sx:{color:"text.secondary"}})}),(0,ge.jsxs)(S.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[s.map(((e,t)=>(0,ge.jsx)(v.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,ge.jsx)(y.A,{variant:"body2",color:"text.secondary",children:t.structured_formatting.secondary_text})]})]})}))}})})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(se.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{fullWidth:!0,required:!0,id:"outlined-required",label:"City",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{city:e.target.value}))},value:""==gt?it.city:gt})}),(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(oe.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{fullWidth:!0,required:!0,label:" PostCode",id:"outlined-required",onChange:e=>{yt((0,n.A)((0,n.A)({},bt),{},{postcode:e.target.value}))},value:""==At?it.postcode:At})})]})}),(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ne.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{variant:"outlined",readonly:!0,label:"Latitude",fullWidth:!0,value:jt.lat,sx:{cursor:"not-allowed"}})}),(0,ge.jsx)(S.Ay,{item:!0,children:(0,ge.jsx)(ne.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,ge.jsx)(S.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,ge.jsx)(Y.A,{label:"Longitude",readonly:!0,variant:"outlined",fullWidth:!0,value:jt.lng})})]})})]})}),(0,ge.jsx)(B.A,{sx:{display:"flex",justifyContent:"end",mr:3,mb:2},children:(0,ge.jsx)(D.A,{variant:"contained",size:"medium",onClick:()=>{(async()=>{try{const e=(0,n.A)((0,n.A)({},bt),{},{tenantid:Ze});console.log("updateClient",e);const t=await o.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),e);console.log("updateClient",t.data.message),t.data.status&&_t(t.data.message,"success",1500),Ft(),Xt()}catch(e){console.log("updateClient",e)}})()},children:"Update Client"})})]})})})},"left - card"),1==Je&&(0,ge.jsx)(L.A,{variant:"outlined",sx:{},children:(0,ge.jsx)(C.A,{children:(0,ge.jsxs)(k.A,{children:[(0,ge.jsx)(W.A,{children:(0,ge.jsxs)(z.A,{children:[(0,ge.jsx)(I.A,{children:"#"}),(0,ge.jsx)(I.A,{children:"Date"}),(0,ge.jsx)(I.A,{children:"Slab"}),(0,ge.jsx)(I.A,{children:"Base Price"}),(0,ge.jsx)(I.A,{children:"Min Kms"}),(0,ge.jsx)(I.A,{children:"Price/Km"}),(0,ge.jsx)(I.A,{children:"Other Charges"})]})}),(0,ge.jsx)(P.A,{children:0===(null===Qe||void 0===Qe?void 0:Qe.length)?(0,ge.jsx)(z.A,{children:(0,ge.jsx)(I.A,{colSpan:7,align:"center",children:(0,ge.jsx)(c.A,{})})}):Qe.map(((e,t)=>(0,ge.jsxs)(z.A,{sx:{bgcolor:"white"},children:[(0,ge.jsx)(I.A,{children:t+1}),(0,ge.jsx)(I.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,ge.jsx)(I.A,{children:e.slab}),(0,ge.jsx)(I.A,{children:e.baseprice}),(0,ge.jsx)(I.A,{children:e.minkm}),(0,ge.jsx)(I.A,{children:e.priceperkm}),(0,ge.jsx)(I.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,ge.jsx)(z.A,{children:(0,ge.jsx)(I.A,{colSpan:6,sx:{py:6},children:(0,ge.jsxs)(b.A,{alignItems:"center",spacing:1.5,children:[(0,ge.jsx)(f.A,{sx:{width:64,height:64,bgcolor:ke("#94a3b8"),color:be},children:(0,ge.jsx)(oe.Itr,{size:28})}),(0,ge.jsx)(y.A,{variant:"subtitle1",sx:{fontWeight:700,color:je},children:"No tenants to show"}),(0,ge.jsx)(y.A,{variant:"caption",sx:{color:fe},children:"No ".concat(Qt.label.toLowerCase()," tenants for this filter.")})]})})})]})]})}),!i&&(null===Ht||void 0===Ht?void 0:Ht.length)>0&&(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(H.A,{sx:{borderColor:ye}}),(0,ge.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50,100],component:"div",count:0==Fe?null===Nt||void 0===Nt?void 0:Nt.active:1==Fe?null===Nt||void 0===Nt?void 0:Nt.pending:2==Fe?null===Nt||void 0===Nt?void 0:Nt.inactive:0,rowsPerPage:we,page:vt,onPageChange:(e,t)=>{St(t)},onRowsPerPageChange:e=>{_e(parseInt(e.target.value,10)),St(0)}})]})]}),(0,ge.jsxs)(F.A,{fullWidth:!0,open:st,onClose:kt,scroll:"paper",maxWidth:"sm",TransitionComponent:te.s,children:[(0,ge.jsx)(N.A,{sx:{bgcolor:"#662582",color:"#fff",fontSize:"20px"},children:"Client Pricing - (".concat(it.tenantname,")")}),(0,ge.jsx)(V.A,{dividers:!0,children:(0,ge.jsx)(r.A,{sx:{height:"100%"},children:(0,ge.jsxs)(S.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Select Slab"}),(0,ge.jsx)(T.A,{disablePortal:!0,id:"combo-box-demo",options:ot,getOptionLabel:e=>"".concat(e.slab),fullWidth:!0,selectOnFocus:!0,renderInput:e=>(0,ge.jsx)(Y.A,(0,n.A)((0,n.A)({},e),{},{label:"Slab"})),onChange:(e,t,i)=>{ct(t),console.log("pricing",t),xt(!1),"clear"===i&&xt(!0)}})]}),(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Base Price"}),(0,ge.jsx)(Y.A,{type:"number",fullWidth:!0,value:dt?0:at.baseprice,onChange:e=>{ct((0,n.A)((0,n.A)({},at),{},{baseprice:e.target.value}))}})]}),(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Price/Km"}),(0,ge.jsx)(Y.A,{type:"number",fullWidth:!0,value:dt?0:at.priceperkm,onChange:e=>{ct((0,n.A)((0,n.A)({},at),{},{priceperkm:e.target.value}))}})]}),(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Min Kms"}),(0,ge.jsx)(Y.A,{type:"number",fullWidth:!0,value:dt?0:at.minkm,onChange:e=>{ct((0,n.A)((0,n.A)({},at),{},{minkm:e.target.value}))}})]}),(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Max Kms"}),(0,ge.jsx)(Y.A,{type:"number",fullWidth:!0,value:dt?0:at.maxkm,onChange:e=>{ct((0,n.A)((0,n.A)({},at),{},{maxkm:e.target.value}))}})]}),(0,ge.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ge.jsx)(X.A,{children:"Min Orders"}),(0,ge.jsx)(Y.A,{type:"number",fullWidth:!0,value:dt?0:at.minorder,onChange:e=>{ct((0,n.A)((0,n.A)({},at),{},{minorder:e.target.value}))}})]})]})})}),(0,ge.jsx)(J.A,{children:(0,ge.jsx)(S.Ay,{container:!0,children:(0,ge.jsx)(S.Ay,{item:!0,xs:12,children:(0,ge.jsxs)(b.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[1==Je&&(0,ge.jsx)(D.A,{disabled:dt,variant:"contained",onClick:()=>{Gt()},children:"Update Pricing"}),1==Fe&&(0,ge.jsx)(D.A,{disabled:dt,variant:"contained",onClick:()=>{Gt()},children:"Save"}),(0,ge.jsx)(D.A,{variant:"contained",onClick:()=>{xt(!0),setTimeout((()=>{kt()}),100),ct({})},color:"error",children:"Cancel"})]})})})})]})]})}},96646:(e,t,i)=>{i.d(t,{r:()=>a});var n=i(9213),s=i(21671),r=i(82917),o=i(93230),l=i(44414);const a=e=>{let{rowsPerPage:t=5,col:i=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(s.A,{children:(0,l.jsx)(r.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(r.A,{variant:"text",width:30})}),Array.from({length:i}).map(((e,t)=>(0,l.jsx)(s.A,{children:(0,l.jsxs)(o.A,{spacing:.5,children:[(0,l.jsx)(r.A,{variant:"text",width:100}),(0,l.jsx)(r.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(s.A,{children:(0,l.jsx)(r.A,{variant:"text",width:150})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(r.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(s.A,{align:"center",children:(0,l.jsxs)(o.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(r.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(r.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/1504.61c5a37b.chunk.js b/build/static/js/1504.61c5a37b.chunk.js new file mode 100644 index 0000000..e8aa813 --- /dev/null +++ b/build/static/js/1504.61c5a37b.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1504],{23787:(e,t,i)=>{i.d(t,{FG:()=>p,nV:()=>x,pY:()=>g,pg:()=>h});var n=i(89379),o=i(80045),s=i(93230),r=i(2235),l=i(16491),a=i(82053),c=i(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:i=!1,onScroll:r,sx:l}=e,a=(0,o.A)(e,d);return(0,c.jsx)(s.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:r,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},h=e=>{let{accent:t="#662582",header:i,footer:o,selected:s=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(r.A,{elevation:0,onClick:a,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:s?t:"#e2e8f0",background:s?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[i,d,o]})]})},p=e=>{let{children:t,columns:i=2,sx:o}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},o),children:t})},g=e=>{let{label:t,value:i,children:n,full:o=!1,align:s="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:o?"1 / -1":"auto",minWidth:0,textAlign:s},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},56311:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(89379),o=i(9950),s=i(2660),r=i(2046),l=i(83274),a=i(25333),c=i(97125),d=i(7762),x=i(52097),h=i(44414);const p=e=>{let{value:t,onChange:i,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:A}=e;const m=(0,o.useRef)(null),[f]=(0,x.d7)(t,g);return(0,o.useEffect)((()=>{p&&p(f)}),[f,p]),(0,o.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=m.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(s.A,{sx:(0,n.A)({},A),inputRef:m,placeholder:u,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>i(e.target.value),startAdornment:(0,h.jsx)(r.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>i(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,i)=>{i.d(t,{A:()=>h});var n=i(89379),o=i(9950),s=i(93230),r=i(41413),l=i(77922),a=i(29925),c=i(26910),d=i(31222),x=i(44414);const h=(0,o.forwardRef)(((e,t)=>{let{setAppId:i,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:A,pill:m=!1,accentColor:f="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[y,S]=(0,o.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,o.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const w=e=>"".concat(f).concat(e),C=w("08"),z=w("26"),k=w("55"),W=w("18"),I=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:f},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(z)},"&.Mui-focused fieldset":{borderColor:f,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:f}}:{},P=m&&(0,x.jsx)(s.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(r.A,{sx:{width:24,height:24,bgcolor:W,color:f,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,n.A)({},g),onChange:(e,t,n)=>{"clear"===n?(null===i||void 0===i||i(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):t&&(null===i||void 0===i||i(t.applocationid),null===h||void 0===h||h(t.locationname),null===p||void 0===p||p(0))},renderInput:e=>m?(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,n.A)((0,n.A)({},I),A||u||{})})):(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,n.A)({},A||u||{})}))})}))},71504:(e,t,i)=>{i.r(t),i.d(t,{default:()=>_e});var n=i(89379),o=i(9950),s=i(50027),r=i(26910),l=i(14857),a=i(52351),c=i(13838),d=i(4159),x=i.n(d),h=i(8881),p=i(99459),g=i(28217),u=i(55471),A=i.n(u),m=i(21209),f=i(2235),j=i(41413),b=i(47223),v=i(93230),y=i(82053),S=i(16491),w=i(60899),C=i(82917),z=i(1320),k=i(15769),W=i(69780),I=i(9213),P=i(21671),M=i(34075),R=i(83274),Y=i(25333),K=i(33738),L=i(48159),_=i(84142),E=i(48089),T=i(82223),D=i(50704),O=i(29925),H=i(77922),B=i(25713),F=i(74745),N=i(6258),V=i(96583),q=i(40033),X=i(28170),J=i(29277),U=i(79739),Z=i(23787),G=i(9083),Q=i(8203),$=i(4729),ee=i(12678),te=i(94118),ie=i(24513),ne=i(37476),oe=i(54826),se=i(63057),re=i(85527),le=i(74930),ae=i(31222),ce=i(21636),de=i(39174),xe=i(59212),he=i(56311),pe=i(36150),ge=i(81425),ue=i(96646),Ae=i(44414);const me=16,fe="0 8px 24px rgba(15, 23, 42, 0.08)",je="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",ye="#94a3b8",Se="#e2e8f0",we="#f1f5f9",Ce="#f8fafc",ze=(e,t)=>"".concat(e).concat(t),ke=e=>ze(e,"08"),We=e=>ze(e,"18"),Ie=e=>ze(e,"26"),Pe=e=>ze(e,"55"),Me={active:{label:"Active",color:"#10b981",icon:ae.mU9,statusKey:"active"},pending:{label:"Pending",color:"#f59e0b",icon:ae.tX0,statusKey:"pending"},inactive:{label:"Inactive",color:"#ef4444",icon:ae.uDv,statusKey:"inactive"}},Re=[{status:"active",countKey:"active",tabStatus:"Active"},{status:"pending",countKey:"pending",tabStatus:"Pending"},{status:"inactive",countKey:"inactive",tabStatus:"InActive"}],Ye=[{key:"active",label:"Active Tenants",color:"#10b981",icon:ae.mU9,countKey:"active"},{key:"pending",label:"Pending Approval",color:"#f59e0b",icon:ae.tX0,countKey:"pending"},{key:"inactive",label:"Inactive Tenants",color:"#ef4444",icon:ae.uDv,countKey:"inactive"}],Ke=e=>(0,Ae.jsx)(f.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:je,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Le=e=>{let{color:t,selected:i,size:n=24,children:o}=e;return(0,Ae.jsx)(j.A,{sx:{width:n,height:n,bgcolor:i?t:We(t),color:i?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:o})},_e=()=>{var e;const t=(0,o.useRef)(null),[i,d]=(0,o.useState)(""),[u,je]=(0,o.useState)(""),[ze,_e]=o.useState(10),Ee=(0,l.A)(),Te=(0,b.A)(Ee.breakpoints.down("md")),[De,Oe]=(0,o.useState)(!1),[He,Be]=(0,o.useState)(0),[Fe,Ne]=(0,o.useState)(""),[Ve]=(0,o.useState)("All"),[qe,Xe]=o.useState(null),[Je,Ue]=(0,o.useState)(0),[Ze,Ge]=(0,o.useState)(0),[Qe,$e]=(0,o.useState)(0),[et,tt]=(0,o.useState)(null),[it,nt]=(0,o.useState)([]),[ot,st]=(0,o.useState)("active"),[rt,lt]=(0,o.useState)({}),[at,ct]=(0,o.useState)(!1),[dt,xt]=(0,o.useState)([]),[ht,pt]=(0,o.useState)({}),[gt,ut]=(0,o.useState)(!0),[At,mt]=(0,o.useState)(""),[ft,jt]=(0,o.useState)(""),[bt,vt]=(0,o.useState)(""),[yt,St]=(0,o.useState)({}),[wt,Ct]=(0,o.useState)({}),[zt,kt]=(0,o.useState)(0),[Wt,It]=(0,o.useState)("Active"),Pt=()=>{ct(!1)},Mt=(e,t)=>{It(0==t?"Active":1==t?"Pending":"InActive"),Ue(t),d(""),kt(0)},Rt=(e,t)=>{console.log("newValue1",t),Ge(t)},Yt=(e,t)=>{console.log("newValue2",t),$e(t)},[Kt,Lt]=(0,o.useState)(null),[_t,Et]=(0,o.useState)(null),Tt=e=>{Lt((t=>t===e?null:e))};(0,o.useEffect)((()=>{console.log("selectedCustomer",rt)}),[rt]),(0,o.useEffect)((()=>{Lt(-1),Et(-1)}),[Je]);const Dt=(e,t,i)=>{(0,h.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:i})};const Ot={current:null},[Ht,Bt]=(0,o.useState)(""),[Ft,Nt]=(0,o.useState)([]),Vt=(0,o.useRef)(!1);"undefined"===typeof window||Vt.current||(document.querySelector("#google-maps")||function(e,t,i){if(!t)return;const n=document.createElement("script");n.setAttribute("async",""),n.setAttribute("id",i),n.src=e,t.appendChild(n)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places"),document.querySelector("head"),"google-maps"),Vt.current=!0);const qt=(0,o.useMemo)((()=>(0,m.A)(((e,t)=>{Ot.current.getPlacePredictions(e,t)}),400)),[]);(0,o.useEffect)((()=>{let e=!0;if(!Ot.current&&window.google&&(Ot.current=new window.google.maps.places.AutocompleteService),Ot.current){if(""!==Ht)return qt({input:Ht},(t=>{if(e){let e=[];qe&&(e=[qe]),t&&(e=[...e,...t]),Nt(e)}})),()=>{e=!1};Nt(qe?[qe]:[])}}),[qe,Ht,qt]),p.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,o.useEffect)((()=>{try{console.log("selected address =>",At),p.A.fromAddress(At).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:i}=e.results[0].geometry.location;if(St({lat:t,lng:i}),Ct((0,n.A)((0,n.A)({},wt),{},{latitude:t.toString(),longitude:i.toString()})),e.results[0].address_components){let t,i,o,s,r=e.results[0];for(let e=0;e{console.log(e)}))}catch(e){console.log(e)}}),[At]),(0,o.useEffect)((()=>{rt&&St({lat:rt.latitude,lng:rt.longitude})}),[rt]),(0,o.useEffect)((()=>{const e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t.current.focus()),"Escape"===e.key&&document.activeElement===t.current&&t.current.blur()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[]);const{data:Xt,isLoading:Jt,refetch:Ut}=(0,pe.I)({queryKey:["tenantList",He,u,ot,zt,ze],queryFn:ge.ry}),{data:Zt=[],isLoading:Gt,refetch:Qt}=(0,pe.I)({queryKey:["gettenantsummary",He,ot],queryFn:ge.bd}),$t=async()=>{await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/getpricinglist/?tenantid=").concat(et)).then((e=>{console.log("getpricinglist",e),e.data.status&&nt(e.data.details)})).catch((e=>{console.log(e)}))};(0,o.useEffect)((()=>{et&&$t()}),[et]);(0,o.useEffect)((()=>{et&&(async e=>{try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("tenantPricing",t.data.details),setTenanatPricing(t.data.details)}catch(t){console.log("fetchTenanatPricing",t)}})(et)}),[et]);const ei=async e=>{let t;Oe(!0),t=-1==e?{tenantid:et,approved:1}:{tenantid:e,status:"active"===ot?"InActive":"Active"},await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),t).then((e=>{e.data.status&&(Dt(0==Je?"Inactivated Successfully":1==Je?"Approved Successfully":"Activate Successfully","success",2e3),Ut(),Qt(),Oe(!1))})).catch((e=>{console.log(e),Dt(e.message,"error",1500),Oe(!1)}))},ti=async e=>{console.log("id",e);try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapppricing/?applocationid=").concat(e));console.log("appPricingRes",t.data.details),xt(t.data.details)}catch(t){console.log("appPricingRes",t)}},ii=async()=>{Oe(!0),await r.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/createpricing"),{tenantpricingid:0,applocationid:He,pricingid:ht.pricingid,tenantid:et,pricingdate:x()().format("YYYY-MM-DD HH:mm:ss"),configid:ht.configid,pricingtypeid:ht.pricingtypeid,slab:ht.slab,baseprice:+ht.baseprice,priceperkm:+ht.priceperkm,minkm:+ht.minkm,maxkm:+ht.maxkm,orders:+ht.minorder,othercharges:0}).then((e=>{e.data.status&&((0,h.M8)("Price Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Pt(),pt({}),ei(-1),$t())})).catch((e=>{console.log(e)}))},ni=Me[null===(e=Re[Je])||void 0===e?void 0:e.status]||Me.active;return(0,Ae.jsxs)(Ae.Fragment,{children:[(Jt||Gt||De)&&(0,Ae.jsx)(a.A,{}),(0,Ae.jsx)(f.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:me/8,border:"1px solid",borderColor:Se,background:"linear-gradient(135deg, ".concat(ke("#6366f1")," 0%, ").concat(ke("#0ea5e9")," 100%)"),boxShadow:fe},children:(0,Ae.jsxs)(v.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Ae.jsx)(j.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,Ae.jsx)(ae.Itr,{size:22})}),(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Tenants"}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Ae.jsx)(S.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Ae.jsxs)(y.A,{variant:"caption",sx:{color:ve,fontWeight:600},children:["Live \xb7 ",Fe||"All Zones"]})]})]})]}),(0,Ae.jsx)(xe.A,{locations:Ve,locaName:Fe,setAppId:Be,setLocoName:Ne,setPage:kt,pill:!0,accentColor:"#6366f1",icon:(0,Ae.jsx)(ae.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Ke,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,Ae.jsx)(w.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ye.map((e=>{var t;const i=e.icon,n=null!==(t=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==t?t:0;return(0,Ae.jsx)(w.Ay,{item:!0,xs:12,sm:4,children:(0,Ae.jsxs)(f.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:me/8,border:"1px solid",borderColor:Se,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:fe,borderColor:Pe(e.color)}},onClick:()=>{const t=Re.findIndex((t=>t.countKey===e.countKey));t>=0&&Mt(0,t)},children:[(0,Ae.jsx)(S.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(We(e.color)," 100%)")}}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Ae.jsxs)(v.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Gt?(0,Ae.jsx)(C.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,Ae.jsx)(y.A,{sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:n})]}),(0,Ae.jsx)(j.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:We(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(Pe(e.color)),flexShrink:0},children:(0,Ae.jsx)(i,{size:20})})]})]})},e.key)}))}),(0,Ae.jsx)(f.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:me/8,borderTopRightRadius:me/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:Se,borderBottom:0,background:"#fff"},children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,Ae.jsx)(v.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:Se,borderRadius:4}},children:Re.map(((e,t)=>{var i;const n=Me[e.status],o=n.icon,s=Je===t,r=null!==(i=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==i?i:0;return(0,Ae.jsxs)(S.A,{onClick:()=>{st(e.status),Mt(0,t)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(s?n.color:Pe(n.color)),bgcolor:s?n.color:ke(n.color),color:s?"#fff":n.color,fontWeight:700,boxShadow:s?"0 6px 18px ".concat(Ie(n.color)):"none",transition:"all 0.18s","&:hover":{borderColor:n.color,boxShadow:s?"0 6px 18px ".concat(Ie(n.color)):"0 0 0 3px ".concat(Ie(n.color))}},children:[(0,Ae.jsx)(j.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:s?"rgba(255,255,255,0.22)":We(n.color),color:s?"#fff":n.color},children:(0,Ae.jsx)(o,{size:13})}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:n.label}),(0,Ae.jsx)(S.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:s?"rgba(255,255,255,0.22)":"#fff",color:s?"#fff":n.color,border:s?"none":"1px solid ".concat(Pe(n.color))},children:Gt?(0,Ae.jsx)(C.A,{variant:"text",width:14,height:10}):r})]},e.status)}))}),(0,Ae.jsx)(S.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,Ae.jsx)(he.A,{value:i,onChange:d,onDebouncedChange:je,sx:{m:0,width:"100%",borderRadius:999,bgcolor:ke("#6366f1"),"& fieldset":{borderColor:Pe("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Ie("#6366f1"))}}})})]})}),(0,Ae.jsxs)(f.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:me/8,borderBottomRightRadius:me/8,border:"1px solid",borderColor:Se,overflow:"hidden",background:"#fff"},children:[(0,Ae.jsx)(z.A,{sx:{display:{xs:"none",md:"block"},maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:"10px",height:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:Pe("#6366f1"),borderRadius:"8px","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:Ce}},children:(0,Ae.jsxs)(k.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{sx:{"& th":{backgroundColor:Ce,color:ve,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Se),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Status"}),(0,Ae.jsx)(P.A,{children:"Client"}),(0,Ae.jsx)(P.A,{children:"Contact"}),(0,Ae.jsx)(P.A,{children:"Address"}),(0,Ae.jsx)(P.A,{align:"right",children:"Actions"})]})}),(0,Ae.jsxs)(M.A,{children:[Jt&&(0,Ae.jsx)(ue.r,{}),0!=(null===Xt||void 0===Xt?void 0:Xt.length)||De?null===Xt||void 0===Xt?void 0:Xt.map(((e,t)=>{var i;const l=Me[0===Je?"active":1===Je?"pending":"inactive"],a=l.icon;return(0,Ae.jsxs)(o.Fragment,{children:[(0,Ae.jsxs)(I.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(we),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:Ce}},children:[(0,Ae.jsx)(P.A,{children:(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:700,color:ye},children:String(t+1+zt*ze).padStart(2,"0")})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ke(l.color),border:"1px solid ".concat(Pe(l.color)),color:l.color},children:[(0,Ae.jsx)(Le,{color:l.color,size:20,children:(0,Ae.jsx)(a,{size:12})}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:l.label})]})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,Ae.jsx)(Le,{color:"#6366f1",size:32,children:(0,Ae.jsx)(ae.Azs,{size:16})}),(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.tenantname}),(0,Ae.jsxs)(y.A,{variant:"caption",sx:{color:ve},children:["ID #",e.tenantid]})]})]})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.primarycontact||"\u2014"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve},children:e.primaryemail||"\u2014"})]})}),(0,Ae.jsx)(P.A,{sx:{maxWidth:280},children:(0,Ae.jsx)(R.A,{title:e.address||"",placement:"top",children:(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,Ae.jsx)(P.A,{align:"right",children:(0,Ae.jsxs)(v.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[0==Je&&(0,Ae.jsx)(R.A,{title:"Inactivate",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Pe("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(G.A,{style:{fontSize:14}})})}),1==Je&&(0,Ae.jsx)(R.A,{title:"Approve",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Pe("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{lt(e),ct(!0),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid)},children:(0,Ae.jsx)(Q.A,{style:{fontSize:14}})})}),2==Je&&(0,Ae.jsx)(R.A,{title:"Activate",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#10b981"),color:"#10b981",border:"1px solid ".concat(Pe("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(oe.yjt,{style:{fontSize:14}})})}),(0,Ae.jsx)(R.A,{title:Kt===t?"Hide details":"View details",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:Kt===t?"#6366f1":We("#6366f1"),color:Kt===t?"#fff":"#6366f1",border:"1px solid ".concat(Pe("#6366f1")),"&:hover":{bgcolor:"#6366f1",color:"#fff"}},onClick:()=>{lt(e),Tt(t),Et(-1),tt(e.tenantid)},children:Kt===t?(0,Ae.jsx)($.A,{style:{fontSize:14}}):(0,Ae.jsx)(ee.A,{style:{fontSize:14}})})}),1!==Je&&(0,Ae.jsx)(R.A,{title:_t===t?"Close":"Edit",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:_t===t?"#8b5cf6":We("#8b5cf6"),color:_t===t?"#fff":"#8b5cf6",border:"1px solid ".concat(Pe("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{var i;lt(e),i=t,Et((e=>e===i?null:i)),Lt(-1),tt(e.tenantid),Be(e.applocationid)},children:_t===t?(0,Ae.jsx)(te.A,{style:{fontSize:14}}):(0,Ae.jsx)(ie.A,{style:{fontSize:14}})})})]})})]}),Kt===t&&(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{sx:{"&:hover":{backgroundColor:"white !important"}},colSpan:15,children:(0,Ae.jsx)(K.A,{in:open,timeout:800,easing:"ease-in-out",mountOnEnter:!0,unmountOnExit:!1,sx:{"& .MuiCollapse-wrapperInner":{transition:"transform 800ms ease, opacity 800ms ease"}},children:(0,Ae.jsxs)(s.A,{content:!1,sx:{transform:open?"translateY(0)":"translateY(-8px)",opacity:open?1:0},title:(0,Ae.jsxs)(L.A,{sx:{bgcolor:"primary.lighter"},value:Ze,onChange:Rt,"aria-label":"basic tabs example",children:[(0,Ae.jsx)(_.A,{label:" Details",icon:(0,Ae.jsx)(se.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),(0,Ae.jsx)(_.A,{label:"Pricing",icon:(0,Ae.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}})]}),children:[0==Ze&&(0,Ae.jsxs)(w.Ay,{container:!0,sx:{m:1},spacing:2.5,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.tenantname}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Tenant"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.firstname}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Contact Person"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.primarycontact}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Phone"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.primaryemail}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"E-Mail"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(oe.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.address}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Address"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.city}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"City"})]}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.postcode}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"PostCode"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.latitude}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Latitude"})]}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.longitude}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Longitude"})]})]})})]}),1==Ze&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{},children:(0,Ae.jsx)(z.A,{children:(0,Ae.jsxs)(k.A,{children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Date"}),(0,Ae.jsx)(P.A,{children:"Slab"}),(0,Ae.jsx)(P.A,{children:"Base Price"}),(0,Ae.jsx)(P.A,{children:"Min Kms"}),(0,Ae.jsx)(P.A,{children:"Price/Km"}),(0,Ae.jsx)(P.A,{children:"Other Charges"})]})}),(0,Ae.jsx)(M.A,{children:0===(null===it||void 0===it?void 0:it.length)?(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:7,align:"center",children:(0,Ae.jsx)(c.A,{description:"No Pricing List"})})}):it.map(((e,t)=>(0,Ae.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,Ae.jsx)(P.A,{children:t+1}),(0,Ae.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,Ae.jsx)(P.A,{children:e.slab}),(0,Ae.jsx)(P.A,{children:e.baseprice}),(0,Ae.jsx)(P.A,{children:e.minkm}),(0,Ae.jsx)(P.A,{children:e.priceperkm}),(0,Ae.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})}),_t===t&&(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{sx:{backgroundColor:"white!important","&:hover":{backgroundColor:"white!important"}},colSpan:15,children:(0,Ae.jsxs)(s.A,{content:!1,title:(0,Ae.jsxs)(S.A,{sx:{bgcolor:"primary.lighter",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,Ae.jsxs)(L.A,{value:Qe,onChange:Yt,"aria-label":"basic tabs example",children:[(0,Ae.jsx)(_.A,{label:"Edit Details",icon:(0,Ae.jsx)(se.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),1!==Je&&(0,Ae.jsx)(_.A,{label:"Edit Pricing",icon:(0,Ae.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"},onClick:()=>{ti(rt.applolcationid)}})]}),1==Qe&&(0,Ae.jsx)(T.A,{variant:"contained",color:"error",size:"smaller",startIcon:(0,Ae.jsx)(ie.A,{size:"small"}),sx:{mr:1.8,height:"30px"},onClick:()=>{ct(!0)},children:"Add Pricing"})]}),children:[0==Qe&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{m:2},children:(0,Ae.jsx)(w.Ay,{container:!0,spacing:0,children:(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(E.A,{variant:"outlined",children:[(0,Ae.jsx)(D.A,{children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(de.PY8,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Tenant Name",defaultValue:rt.tenantname,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{tenantname:e.target.value}))},sx:{mt:2}})})]})})," ",(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Contact Person",defaultValue:e.firstname,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{firstname:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{inputProps:{maxLength:10},fullWidth:!0,id:"outlined-basic",label:"Contact Number",defaultValue:rt.primarycontact,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{primarycontact:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"E-Mail",defaultValue:rt.primaryemail,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{primaryemail:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(oe.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(H.A,{id:"google-map-demo",sx:{},fullWidth:!0,label:"Address",getOptionLabel:e=>"string"===typeof e?e:e.description,filterOptions:e=>e,options:Ft,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,defaultValue:rt.address,noOptionsText:"No locations",onChange:(e,t)=>{Nt(t?[t,...Ft]:Ft),Xe(t||""),console.log("newValue",t),mt((null===t||void 0===t?void 0:t.description)||""),Ct((0,n.A)((0,n.A)({},wt),{},{address:(null===t||void 0===t?void 0:t.description)||""}))},onInputChange:(e,t)=>{Bt(t)},renderInput:e=>(0,Ae.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{fullWidth:!0,label:"Address",variant:"outlined"})),renderOption:(e,t)=>{const i=t.structured_formatting.main_text_matched_substrings||[],o=A()(t.structured_formatting.main_text,i.map((e=>[e.offset,e.offset+e.length])));return(0,Ae.jsx)("li",(0,n.A)((0,n.A)({},e),{},{children:(0,Ae.jsxs)(w.Ay,{container:!0,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,Ae.jsx)(g.A,{sx:{color:"text.secondary"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[o.map(((e,t)=>(0,Ae.jsx)(S.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,Ae.jsx)(y.A,{variant:"body2",color:"text.secondary",children:t.structured_formatting.secondary_text})]})]})}))}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,required:!0,id:"outlined-required",label:"City",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{city:e.target.value}))},value:""==ft?rt.city:ft})}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,required:!0,label:" PostCode",id:"outlined-required",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{postcode:e.target.value}))},value:""==bt?rt.postcode:bt})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{variant:"outlined",readonly:!0,label:"Latitude",fullWidth:!0,value:yt.lat,sx:{cursor:"not-allowed"}})}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{label:"Longitude",readonly:!0,variant:"outlined",fullWidth:!0,value:yt.lng})})]})})]})}),(0,Ae.jsx)(B.A,{sx:{display:"flex",justifyContent:"end",mr:3,mb:2},children:(0,Ae.jsx)(T.A,{variant:"contained",size:"medium",onClick:()=>{(async()=>{try{const e=(0,n.A)((0,n.A)({},wt),{},{tenantid:et});console.log("updateClient",e);const t=await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),e);console.log("updateClient",t.data.message),t.data.status&&Dt(t.data.message,"success",1500),Ut(),Qt()}catch(e){console.log("updateClient",e)}})()},children:"Update Client"})})]})})})},"left - card"),1==Qe&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{},children:(0,Ae.jsx)(z.A,{children:(0,Ae.jsxs)(k.A,{children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Date"}),(0,Ae.jsx)(P.A,{children:"Slab"}),(0,Ae.jsx)(P.A,{children:"Base Price"}),(0,Ae.jsx)(P.A,{children:"Min Kms"}),(0,Ae.jsx)(P.A,{children:"Price/Km"}),(0,Ae.jsx)(P.A,{children:"Other Charges"})]})}),(0,Ae.jsx)(M.A,{children:0===(null===it||void 0===it?void 0:it.length)?(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:7,align:"center",children:(0,Ae.jsx)(c.A,{})})}):it.map(((e,t)=>(0,Ae.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,Ae.jsx)(P.A,{children:t+1}),(0,Ae.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,Ae.jsx)(P.A,{children:e.slab}),(0,Ae.jsx)(P.A,{children:e.baseprice}),(0,Ae.jsx)(P.A,{children:e.minkm}),(0,Ae.jsx)(P.A,{children:e.priceperkm}),(0,Ae.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:6,sx:{py:6},children:(0,Ae.jsxs)(v.A,{alignItems:"center",spacing:1.5,children:[(0,Ae.jsx)(j.A,{sx:{width:64,height:64,bgcolor:We("#94a3b8"),color:ye},children:(0,Ae.jsx)(ae.Itr,{size:28})}),(0,Ae.jsx)(y.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No tenants to show"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve},children:"No ".concat(ni.label.toLowerCase()," tenants for this filter.")})]})})})]})]})}),Te&&(0,Ae.jsxs)(Z.nV,{scroll:!0,sx:{display:{xs:"flex",md:"none"}},children:[Jt&&(0,Ae.jsxs)(v.A,{alignItems:"center",sx:{py:4},children:[(0,Ae.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave"}),(0,Ae.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave",sx:{mt:1.25}})]}),0!=(null===Xt||void 0===Xt?void 0:Xt.length)||De?null===Xt||void 0===Xt?void 0:Xt.map(((e,t)=>{var i;const n=Me[0===Je?"active":1===Je?"pending":"inactive"],o=n.icon,s=Kt===t;return(0,Ae.jsxs)(Z.pg,{accent:n.color,header:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,Ae.jsx)(Le,{color:"#6366f1",size:36,children:(0,Ae.jsx)(ae.Azs,{size:18})}),(0,Ae.jsxs)(v.A,{sx:{minWidth:0},children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:800,color:be},noWrap:!0,children:e.tenantname}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",mt:.25,pl:.25,pr:.875,py:.125,borderRadius:999,bgcolor:ke(n.color),border:"1px solid ".concat(Pe(n.color)),color:n.color,alignSelf:"flex-start"},children:[(0,Ae.jsx)(Le,{color:n.color,size:16,children:(0,Ae.jsx)(o,{size:10})}),(0,Ae.jsx)(y.A,{sx:{fontWeight:800,fontSize:10,lineHeight:1},children:n.label})]})]})]}),(0,Ae.jsxs)(v.A,{direction:"row",spacing:.5,sx:{flexShrink:0},children:[0==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Pe("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(G.A,{style:{fontSize:14}})}),1==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Pe("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{lt(e),ct(!0),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid)},children:(0,Ae.jsx)(Q.A,{style:{fontSize:14}})}),2==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#10b981"),color:"#10b981",border:"1px solid ".concat(Pe("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(oe.yjt,{style:{fontSize:14}})}),(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:s?"#6366f1":We("#6366f1"),color:s?"#fff":"#6366f1",border:"1px solid ".concat(Pe("#6366f1")),"&:hover":{bgcolor:"#6366f1",color:"#fff"}},onClick:()=>{lt(e),Tt(t),Et(-1),tt(e.tenantid)},children:s?(0,Ae.jsx)($.A,{style:{fontSize:14}}):(0,Ae.jsx)(ee.A,{style:{fontSize:14}})}),1!==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(Pe("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid),ct(!0)},children:(0,Ae.jsx)(ie.A,{style:{fontSize:14}})})]})]}),children:[(0,Ae.jsxs)(Z.FG,{children:[(0,Ae.jsx)(Z.pY,{label:"Tenant ID",value:"#".concat(e.tenantid)}),(0,Ae.jsx)(Z.pY,{label:"Contact",value:e.primarycontact||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Email",value:e.primaryemail||"\u2014",full:!0}),(0,Ae.jsx)(Z.pY,{label:"Address",full:!0,children:(0,Ae.jsx)(y.A,{sx:{fontSize:13,fontWeight:600,color:be},children:e.address||"\u2014"})})]}),s&&(0,Ae.jsx)(S.A,{sx:{mt:1.25,pt:1.25,borderTop:"1px solid ".concat(we)},children:(0,Ae.jsxs)(Z.FG,{children:[(0,Ae.jsx)(Z.pY,{label:"Contact Person",value:e.firstname||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"City",value:e.city||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Postcode",value:e.postcode||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Latitude",value:e.latitude||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Longitude",value:e.longitude||"\u2014"})]})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,Ae.jsxs)(v.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,Ae.jsx)(j.A,{sx:{width:64,height:64,bgcolor:We("#94a3b8"),color:ye},children:(0,Ae.jsx)(ae.Itr,{size:28})}),(0,Ae.jsx)(y.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No tenants to show"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,textAlign:"center"},children:"No ".concat(ni.label.toLowerCase()," tenants for this filter.")})]})]}),!i&&(null===Xt||void 0===Xt?void 0:Xt.length)>0&&(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(F.A,{sx:{borderColor:Se}}),(0,Ae.jsx)(N.A,{rowsPerPageOptions:[5,10,25,50,100],component:"div",count:0==Je?null===Zt||void 0===Zt?void 0:Zt.active:1==Je?null===Zt||void 0===Zt?void 0:Zt.pending:2==Je?null===Zt||void 0===Zt?void 0:Zt.inactive:0,rowsPerPage:ze,page:zt,onPageChange:(e,t)=>{kt(t)},onRowsPerPageChange:e=>{_e(parseInt(e.target.value,10)),kt(0)}})]})]}),(0,Ae.jsxs)(V.A,{fullWidth:!0,fullScreen:Te,open:at,onClose:Pt,scroll:"paper",maxWidth:"sm",TransitionComponent:ne.s,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,Ae.jsx)(q.A,{sx:{bgcolor:"#662582",color:"#fff",fontSize:"20px"},children:"Client Pricing - (".concat(rt.tenantname,")")}),(0,Ae.jsx)(X.A,{dividers:!0,children:(0,Ae.jsx)(s.A,{sx:{height:"100%"},children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Select Slab"}),(0,Ae.jsx)(H.A,{disablePortal:!0,id:"combo-box-demo",options:dt,getOptionLabel:e=>"".concat(e.slab),fullWidth:!0,selectOnFocus:!0,renderInput:e=>(0,Ae.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{label:"Slab"})),onChange:(e,t,i)=>{pt(t),console.log("pricing",t),ut(!1),"clear"===i&&ut(!0)}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Base Price"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.baseprice,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{baseprice:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Price/Km"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.priceperkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{priceperkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Min Kms"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.minkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{minkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Max Kms"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.maxkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{maxkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Min Orders"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.minorder,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{minorder:e.target.value}))}})]})]})})}),(0,Ae.jsx)(U.A,{children:(0,Ae.jsx)(w.Ay,{container:!0,children:(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(v.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[1==Qe&&(0,Ae.jsx)(T.A,{disabled:gt,variant:"contained",onClick:()=>{ii()},children:"Update Pricing"}),1==Je&&(0,Ae.jsx)(T.A,{disabled:gt,variant:"contained",onClick:()=>{ii()},children:"Save"}),(0,Ae.jsx)(T.A,{variant:"contained",onClick:()=>{ut(!0),setTimeout((()=>{Pt()}),100),pt({})},color:"error",children:"Cancel"})]})})})})]})]})}},96646:(e,t,i)=>{i.d(t,{r:()=>a});var n=i(9213),o=i(21671),s=i(82917),r=i(93230),l=i(44414);const a=e=>{let{rowsPerPage:t=5,col:i=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"text",width:30})}),Array.from({length:i}).map(((e,t)=>(0,l.jsx)(o.A,{children:(0,l.jsxs)(r.A,{spacing:.5,children:[(0,l.jsx)(s.A,{variant:"text",width:100}),(0,l.jsx)(s.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"text",width:150})}),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(o.A,{align:"center",children:(0,l.jsxs)(r.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(s.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(s.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/181.d48a53c2.chunk.js b/build/static/js/181.d48a53c2.chunk.js deleted file mode 100644 index 5d80b0e..0000000 --- a/build/static/js/181.d48a53c2.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[181],{10181:(e,t,r)=>{r.r(t),r.d(t,{default:()=>te});var o=r(89379),n=r(9950),i=r(26910),s=r(36150),a=r(2235),l=r(41413),c=r(83274),d=r(16491),x=r(82053),h=r(93230),u=r(60899),p=r(1320),m=r(15769),A=r(69780),g=r(9213),f=r(21671),j=r(34075),b=r(25333),v=r(33738),S=r(74745),w=r(25277),y=r(96583),C=r(28170),k=r(31222),D=r(4159),R=r.n(D),_=r(81425),P=r(52351),I=r(35678),E=r(59212),z=r(56311),T=r(96646),M=r(10523),W=r(46639),N=r(44414);const L={width:"100%",height:"100%"};function F(e){let{details:t,loading:r,riderName:o,dateRange:i,onClose:s}=e;const a=(0,n.useRef)(null),[l,c]=(0,n.useState)(null),[u,p]=(0,n.useState)([]),[m,A]=(0,n.useState)(!1),{isLoaded:g}=(0,M.KD)({googleMapsApiKey:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_STAFF_TOKEN:"",REACT_APP_URL:"https://jupiter.nearle.app/live/api/v1",REACT_APP_URL2:"https://jupiter.nearle.app/live/api/v2",REACT_APP_URL3:"https://jupiter.nearle.app/live/api/v3",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_GOOGLE_MAPS_KEY}),f=(0,n.useMemo)((()=>(t||[]).map((e=>({lat:e.dropLat,lng:e.dropLng})))),[t]);(0,n.useEffect)((()=>{if(!g||!a.current||0===f.length)return;const e=new window.google.maps.LatLngBounds;f.forEach((t=>e.extend(t))),a.current.fitBounds(e,48)}),[g,f]),(0,n.useEffect)((()=>{if(!g||f.length<2)return void p([]);let e=!1;const t=new window.google.maps.DirectionsService,r=(e,r,o)=>new Promise(((n,i)=>{t.route({origin:e,destination:r,waypoints:o.map((e=>({location:e,stopover:!0}))),travelMode:window.google.maps.TravelMode.DRIVING},((e,t)=>{"OK"===t?n(e):i(new Error(t))}))}));return(async()=>{A(!0);try{const t=f,o=[];let n=0;for(;n({lat:e.lat(),lng:e.lng()})));o.length>0&&c.length>0&&c.shift(),o.push(...c),n+=i}e||p(o)}catch(t){e||p([])}finally{e||A(!1)}})(),()=>{e=!0}}),[g,f]);const j=(e,t)=>{const r=t?38:32,o=t?"#4338ca":"#6366f1",n=encodeURIComponent('')+'')+''.concat(e,"")+"");return"data:image/svg+xml;charset=UTF-8,".concat(n)},v=(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.5,sx:{px:2,py:1.25,borderBottom:"1px solid rgba(15, 23, 42, 0.08)",background:"linear-gradient(135deg, #6366f1 0%, #3b82f6 100%)",color:"#fff",flexShrink:0},children:[(0,N.jsx)(k.pk7,{size:20}),(0,N.jsxs)(h.A,{sx:{flex:1,minWidth:0},children:[(0,N.jsxs)(x.A,{sx:{fontWeight:700,fontSize:15,lineHeight:1.2},children:["Planned route",o?" \u2014 ".concat(o):""]}),i&&(0,N.jsx)(x.A,{sx:{fontSize:12,opacity:.85},children:i})]}),t&&t.length>0&&(0,N.jsxs)(x.A,{sx:{fontSize:12,opacity:.9,fontWeight:600},children:[t.length," ",1===t.length?"stop":"stops",m?" \xb7 resolving route\u2026":""]}),s&&(0,N.jsx)(b.A,{size:"small",onClick:s,sx:{color:"#fff"},"aria-label":"Close",children:(0,N.jsx)(k.m6K,{})})]});return r||!g?(0,N.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,N.jsxs)(h.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1.5},children:[(0,N.jsx)(W.A,{size:32}),(0,N.jsx)(x.A,{sx:{color:"#64748b",fontSize:13},children:r?"Loading planned route\u2026":"Loading map\u2026"})]})]}):t&&0!==t.length?(0,N.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,N.jsx)(d.A,{sx:{flex:1,minHeight:0},children:(0,N.jsxs)(M.u6,{mapContainerStyle:L,onLoad:e=>a.current=e,center:f[0],zoom:14,options:{streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1},children:[u.length>0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(M.Ro,{path:u,options:{strokeColor:"#6366f1",strokeOpacity:.25,strokeWeight:8}}),(0,N.jsx)(M.Ro,{path:u,options:{strokeColor:"#6366f1",strokeOpacity:.95,strokeWeight:4}})]}):(0,N.jsx)(M.Ro,{path:f,options:{strokeColor:"#6366f1",strokeOpacity:0,strokeWeight:0,icons:[{icon:{path:"M 0,-1 0,1",strokeOpacity:.6,strokeColor:"#6366f1",scale:3},offset:"0",repeat:"14px"}]}}),t.map(((e,t)=>{const r=e.step||t+1,o=l===e.deliveryid;return(0,N.jsx)(M.pH,{position:{lat:e.dropLat,lng:e.dropLng},icon:{url:j(r,o)},onClick:()=>c(o?null:e.deliveryid),zIndex:o?1e3:r,children:o&&(0,N.jsx)(M.Fu,{onCloseClick:()=>c(null),children:(0,N.jsxs)(d.A,{sx:{minWidth:180,fontFamily:"inherit"},children:[(0,N.jsxs)(x.A,{sx:{fontWeight:800,fontSize:13,color:"#0f172a"},children:["Step ",r," \xb7 ",e.customer]}),e.address&&(0,N.jsx)(x.A,{sx:{fontSize:12,color:"#475569",mt:.5},children:e.address}),e.expectedTime&&(0,N.jsxs)(x.A,{sx:{fontSize:12,color:"#64748b",mt:.5},children:["ETA ",String(e.expectedTime).slice(11,16)||e.expectedTime]}),e.orderid&&(0,N.jsxs)(x.A,{sx:{fontSize:11,color:"#94a3b8",mt:.5},children:["Order #",e.orderid]})]})})},"step-".concat(e.deliveryid||e.orderid||t))}))]})})]}):(0,N.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,N.jsxs)(h.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1,p:3},children:[(0,N.jsx)(x.A,{sx:{color:"#1e293b",fontWeight:700,fontSize:16},children:"No planned route for this rider"}),(0,N.jsx)(x.A,{sx:{color:"#64748b",fontSize:13,textAlign:"center",maxWidth:360},children:"There are no deliveries with drop coordinates assigned to this rider for the selected date range."})]})]})}var O=r(20466),Y=r(36220);R().extend(Y);const B={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},K=(e,t)=>"".concat(e).concat(t),H=e=>K(e,"08"),U=e=>K(e,"18"),G=e=>K(e,"26"),V=e=>K(e,"55"),q="#662582",X="#9255AB",Z=e=>(0,N.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:B.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),$=e=>{let{color:t,selected:r,size:o=24,children:n}=e;return(0,N.jsx)(l.A,{sx:{width:o,height:o,bgcolor:r?t:U(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},J=e=>{let{color:t,icon:r,label:o,tooltip:n,minWidth:i=80}=e;return(0,N.jsx)(c.A,{title:n||"",placement:"top",children:(0,N.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:H(t),border:"1px solid ".concat(V(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[r,o]})})},Q=e=>{let{value:t,color:r="#ef4444",icon:o}=e;const n=Number(t)||0;return 0===n?(0,N.jsx)(x.A,{variant:"caption",sx:{color:B.textMuted,fontWeight:700},children:"0"}):(0,N.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:H(r),border:"1px solid ".concat(V(r)),color:r,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,n]})};function ee(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function te(){const[e,t]=(0,n.useState)(R()().format("YYYY-MM-DD")),[r,o]=(0,n.useState)(R()().format("YYYY-MM-DD")),[D,M]=(0,n.useState)("All"),[W,L]=(0,n.useState)(!1),[Y,K]=(0,n.useState)("Today"),[te,re]=(0,n.useState)([]),[oe,ne]=(0,n.useState)(null),[ie,se]=(0,n.useState)(0),[ae,le]=(0,n.useState)(!1),[ce,de]=(0,n.useState)(!1),[xe,he]=(0,n.useState)(null),[ue,pe]=(0,n.useState)(null),[me,Ae]=(0,n.useState)(!1),[ge,fe]=(0,n.useState)(""),[je,be]=(0,n.useState)(""),{isLoading:ve,data:Se}=(0,s.I)({queryKey:["ridersummary",ie,e,r],queryFn:_.KN}),we=(0,n.useMemo)((()=>{if(!Se)return[];if(!je)return Se;const e=je.toLowerCase().trim();return Se.filter((t=>["".concat(t.firstname||""," ").concat(t.lastname||""),String(t.userid)].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[Se,je]),ye=(0,n.useMemo)((()=>Se&&0!==Se.length?Se.reduce(((e,t)=>(e.riders+=1,e.orders+=Number(t.totalorders)||0,e.delivered+=Number(t.delivered)||0,e.amount+=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0),e)),{riders:0,orders:0,delivered:0,amount:0}):{riders:0,orders:0,delivered:0,amount:0}),[Se]),Ce=(0,n.useMemo)((()=>Se?Se.reduce(((e,t)=>e+(Number(t.deliveryamt)||0)),0):0),[Se]),ke=[{key:"riders",label:"Active Riders",color:q,icon:k.bsz,value:ye.riders},{key:"orders",label:"Total Orders",color:"#0ea5e9",icon:k.F6S,value:ye.orders},{key:"delivered",label:"Delivered",color:"#10b981",icon:k.mU9,value:ye.delivered},{key:"amount",label:"Total Amount",color:"#f59e0b",icon:k.YHz,value:ee(Ce)}];return(0,N.jsxs)(N.Fragment,{children:[(ve||ae)&&(0,N.jsx)(P.A,{}),(0,N.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,background:"linear-gradient(135deg, ".concat(H(q)," 0%, ").concat(H(X)," 100%)"),boxShadow:B.shadowMd},children:(0,N.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,N.jsx)(l.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:q,color:"#fff",boxShadow:"0 6px 18px ".concat(G(q))},children:(0,N.jsx)(k.bsz,{size:22})}),(0,N.jsxs)(h.A,{children:[(0,N.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:B.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders Summary"}),(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,N.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,N.jsxs)(x.A,{variant:"caption",sx:{color:B.textSecondary,fontWeight:600},children:["Live \xb7 ",D||"All Zones"," \xb7 ",Y]})]})]})]}),(0,N.jsx)(E.A,{locaName:D,setAppId:se,setLocoName:M,pill:!0,accentColor:q,icon:(0,N.jsx)(k.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Z,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,N.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:ke.map((e=>{const t=e.icon;return(0,N.jsx)(u.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,N.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:B.shadowMd,borderColor:V(e.color)}},children:[(0,N.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(U(e.color)," 100%)")}}),(0,N.jsxs)(h.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,N.jsxs)(h.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,N.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,N.jsx)(x.A,{sx:{fontWeight:800,color:B.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,N.jsx)(l.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:U(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(V(e.color)),flexShrink:0},children:(0,N.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,N.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:B.radiusCard/8,borderTopRightRadius:B.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:B.borderSubtle,borderBottom:0,background:"#fff"},children:(0,N.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,N.jsx)($,{color:q,size:32,children:(0,N.jsx)(k.bsz,{size:18})}),(0,N.jsxs)(h.A,{children:[(0,N.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:["Orders \xb7 ",Y]}),(0,N.jsxs)(x.A,{variant:"body2",sx:{color:B.textPrimary,fontWeight:700},children:[we.length," riders \xb7 ",ye.orders," orders"]})]}),(0,N.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,N.jsxs)(d.A,{onClick:()=>L(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:H("#f59e0b"),border:"1.5px solid ".concat(V("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,ml:1,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(G("#f59e0b"))}},children:[(0,N.jsx)(k.Ki0,{size:14}),R()(e).format("DD/MM/YY")," \u2013 ",R()(r).format("DD/MM/YY")]})})]}),(0,N.jsx)(d.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,N.jsx)(z.A,{value:ge,onChange:fe,onDebouncedChange:be,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:H(q),"& fieldset":{borderColor:V(q),borderWidth:1.5},"&:hover fieldset":{borderColor:q},"&.Mui-focused fieldset":{borderColor:q,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(G(q))}}})})]})}),(0,N.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:B.radiusCard/8,borderBottomRightRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,overflow:"hidden",background:"#fff"},children:[(0,N.jsx)(p.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:V(q),borderRadius:8,"&:hover":{backgroundColor:q}},"&::-webkit-scrollbar-track":{backgroundColor:B.surfaceAlt}},children:(0,N.jsxs)(m.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1080}},children:[(0,N.jsx)(A.A,{children:(0,N.jsxs)(g.A,{sx:{"& th":{backgroundColor:B.surfaceAlt,color:B.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,N.jsx)(f.A,{children:"#"}),(0,N.jsx)(f.A,{children:"Rider"}),(0,N.jsx)(f.A,{align:"center",children:"Orders"}),(0,N.jsx)(f.A,{align:"center",children:"Pending"}),(0,N.jsx)(f.A,{align:"center",children:"Cancelled"}),(0,N.jsx)(f.A,{align:"center",children:"Delivered"}),(0,N.jsx)(f.A,{align:"center",children:"KMS"}),(0,N.jsx)(f.A,{align:"center",children:"Amount"}),(0,N.jsx)(f.A,{align:"right",children:"Action"})]})}),(0,N.jsxs)(j.A,{children:[ve&&(0,N.jsx)(T.r,{col:5}),we&&0!==we.length||ve?we.map(((t,o)=>{const s=oe===t.userid,l=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0);return(0,N.jsxs)(n.Fragment,{children:[(0,N.jsxs)(g.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:s?"none":"1px solid ".concat(B.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:s?"#fff":B.surfaceAlt},bgcolor:s?H(q):"transparent"},children:[(0,N.jsx)(f.A,{children:(0,N.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:B.textMuted},children:String(o+1).padStart(2,"0")})}),(0,N.jsx)(f.A,{children:(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,N.jsx)($,{color:q,size:36,children:(0,N.jsx)(k.LTk,{size:18})}),(0,N.jsxs)(h.A,{children:[(0,N.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary,whiteSpace:"nowrap"},children:"".concat((null===t||void 0===t?void 0:t.firstname)||""," ").concat((null===t||void 0===t?void 0:t.lastname)||"").trim()||"\u2014"}),(0,N.jsxs)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:["ID #",t.userid]})]})]})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:t.totalorders,color:q,icon:(0,N.jsx)(k.F6S,{size:11})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:t.pending,color:"#f59e0b",icon:(0,N.jsx)(k.tX0,{size:11})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:t.cancelled,color:"#ef4444",icon:(0,N.jsx)(k.uDv,{size:11})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:t.delivered,color:"#10b981",icon:(0,N.jsx)(k.mU9,{size:11})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsxs)(h.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,N.jsx)(J,{color:"#ef4444",icon:(0,N.jsx)(k.xI$,{size:11}),label:"".concat(Number(t.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,N.jsx)(J,{color:"#10b981",icon:(0,N.jsx)(k.xI$,{size:11}),label:"".concat(Number(t.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(J,{color:q,icon:(0,N.jsx)(k.YHz,{size:11}),label:ee(l).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,N.jsx)(f.A,{align:"right",children:(0,N.jsxs)(h.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,N.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,N.jsx)(b.A,{size:"small",onClick:()=>{pe({userid:null===t||void 0===t?void 0:t.userid,name:"".concat((null===t||void 0===t?void 0:t.firstname)||""," ").concat((null===t||void 0===t?void 0:t.lastname)||"").trim()||"Rider ".concat(null===t||void 0===t?void 0:t.userid)}),he(null),de(!0),(async t=>{Ae(!0);try{var o;const n="undefined"!==typeof window&&localStorage.getItem("userid")||0,s=0===ie?"appuserid=".concat(n):"applocationid=".concat(ie),a="".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/")+"?".concat(s)+"&status=all"+"&fromdate=".concat(e)+"&todate=".concat(r)+"&pageno=1&pagesize=200&keyword=&tenantid=&locationid="+"&userid=".concat(t),l=await i.A.get(a),c=(null===l||void 0===l||null===(o=l.data)||void 0===o?void 0:o.details)||[],d=e=>{const t=Number(e);return Number.isFinite(t)?t:null},x=c.map((e=>{var t,r,o,n,i;const s=d(null!==(t=e.droplat)&&void 0!==t?t:e.deliverylat),a=d(null!==(r=e.droplon)&&void 0!==r?r:e.deliverylong),l=d(null!==(o=e.pickuplat)&&void 0!==o?o:e.pickuplatitude),c=d(null!==(n=null!==(i=e.pickuplon)&&void 0!==i?i:e.pickuplong)&&void 0!==n?n:e.picklongitude);return null==s||null==a?null:{step:Number(e.step)||0,orderid:e.orderid,deliveryid:e.deliveryid,customer:e.deliverycustomer||e.customername||"Order ".concat(e.orderid),address:e.deliveryaddress||e.deliverysuburb||"",dropLat:s,dropLng:a,pickLat:null!==l&&void 0!==l?l:null,pickLng:null!==c&&void 0!==c?c:null,expectedTime:e.expecteddeliverytime||null}})).filter(Boolean).sort(((e,t)=>e.step-t.step));he(x)}catch(n){(0,O.k)(null===n||void 0===n?void 0:n.message,"error",2e3),he([])}finally{Ae(!1)}})(null===t||void 0===t?void 0:t.userid)},sx:{bgcolor:U("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(V("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,N.jsx)(k.Cd7,{size:14})})}),(0,N.jsx)(c.A,{title:s?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,N.jsx)(b.A,{size:"small",onClick:()=>{const o=!s;ne(o?t.userid:null),o&&(async t=>{le(!0);try{const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportsummary/?&fromdate=").concat(e,"&todate=").concat(r,"&userid=").concat(t));re(o.data.details)}catch(o){console.log("tenantRes",o)}finally{le(!1)}})(t.userid)},sx:{bgcolor:s?q:U(q),color:s?"#fff":q,border:"1px solid ".concat(V(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:s?(0,N.jsx)(k.Xbk,{size:16}):(0,N.jsx)(k.j1Q,{size:16})})})]})})]}),s&&(0,N.jsx)(g.A,{children:(0,N.jsx)(f.A,{colSpan:9,sx:{p:0,borderBottom:"1px solid ".concat(B.divider),bgcolor:H(q)},children:(0,N.jsx)(v.A,{in:s,timeout:"auto",unmountOnExit:!0,children:(0,N.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,N.jsxs)(a.A,{elevation:0,sx:{borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,overflow:"hidden",boxShadow:B.shadowSoft},children:[(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(H(q)," 0%, ").concat(H(X)," 100%)"),borderBottom:"1px solid ".concat(B.borderSubtle)},children:[(0,N.jsx)($,{color:q,size:28,selected:!0,children:(0,N.jsx)(k.Itr,{size:14})}),(0,N.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Tenant Breakdown \xb7 ","".concat((null===t||void 0===t?void 0:t.firstname)||""," ").concat((null===t||void 0===t?void 0:t.lastname)||"").trim()]})]}),(0,N.jsxs)(m.A,{size:"small",children:[(0,N.jsx)(A.A,{children:(0,N.jsxs)(g.A,{sx:{"& th":{backgroundColor:B.surfaceAlt,color:B.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B.borderSubtle),py:1,px:1.5}},children:[(0,N.jsx)(f.A,{children:"#"}),(0,N.jsx)(f.A,{children:"Client"}),(0,N.jsx)(f.A,{align:"center",children:"All"}),(0,N.jsx)(f.A,{align:"center",children:"Pending"}),(0,N.jsx)(f.A,{align:"center",children:"Completed"}),(0,N.jsx)(f.A,{align:"center",children:"Cancelled"}),(0,N.jsx)(f.A,{align:"center",children:"KMS"}),(0,N.jsx)(f.A,{align:"center",children:"Amount"})]})}),(0,N.jsxs)(j.A,{children:[ae&&(0,N.jsx)(T.r,{col:4}),ae||te&&0!==te.length?null===te||void 0===te?void 0:te.map(((e,t)=>(0,N.jsxs)(g.A,{sx:{"& td":{borderBottom:"1px solid ".concat(B.divider),py:1,px:1.5},"&:hover":{backgroundColor:B.surfaceAlt}},children:[(0,N.jsx)(f.A,{children:(0,N.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:B.textMuted},children:String(t+1).padStart(2,"0")})}),(0,N.jsx)(f.A,{children:(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,N.jsx)($,{color:"#0ea5e9",size:24,children:(0,N.jsx)(k.Itr,{size:12})}),(0,N.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"})]})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:e.totalorders,color:q,icon:(0,N.jsx)(k.F6S,{size:10})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:e.deliveriespending,color:"#f59e0b",icon:(0,N.jsx)(k.tX0,{size:10})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:e.deliveriescompleted,color:"#10b981",icon:(0,N.jsx)(k.mU9,{size:10})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(Q,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,N.jsx)(k.uDv,{size:10})})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsxs)(h.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,N.jsx)(J,{color:"#ef4444",icon:(0,N.jsx)(k.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,N.jsx)(J,{color:"#10b981",icon:(0,N.jsx)(k.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,N.jsx)(f.A,{align:"center",children:(0,N.jsx)(J,{color:q,icon:(0,N.jsx)(k.YHz,{size:10}),label:ee(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.tenantname,"-").concat(t)))):(0,N.jsx)(g.A,{children:(0,N.jsx)(f.A,{colSpan:8,sx:{py:3},children:(0,N.jsx)(x.A,{variant:"caption",sx:{color:B.textMuted,textAlign:"center",display:"block"},children:"No tenant breakdown available."})})})]})]})]})})})})})]},t.userid||o)})):(0,N.jsx)(g.A,{children:(0,N.jsx)(f.A,{colSpan:9,sx:{py:6},children:(0,N.jsxs)(h.A,{alignItems:"center",spacing:1.5,children:[(0,N.jsx)(l.A,{sx:{width:64,height:64,bgcolor:U("#94a3b8"),color:B.textMuted},children:(0,N.jsx)(k.bsz,{size:28})}),(0,N.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:B.textPrimary},children:"No riders to show"}),(0,N.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:ge?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})})})]})]})}),we.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(S.A,{}),(0,N.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:1.5,sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(H(q)," 0%, ").concat(H(X)," 100%)")},children:[(0,N.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,N.jsx)(w.A,{label:ee(Ce),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(q," 0%, ").concat(X," 100%)"),boxShadow:"0 6px 16px ".concat(G(q))}})]})]})]}),(0,N.jsx)(y.A,{maxWidth:"xl",fullScreen:!0,open:ce,onClose:()=>{de(!1),he(null),pe(null)},children:(0,N.jsx)(C.A,{sx:{p:0,height:"100vh"},children:(0,N.jsx)(F,{details:xe,loading:me,riderName:null===ue||void 0===ue?void 0:ue.name,dateRange:"".concat(R()(e).format("DD/MM/YY")," \u2013 ").concat(R()(r).format("DD/MM/YY")),onClose:()=>{de(!1),he(null),pe(null)}})})}),(0,N.jsx)(I.A,{open:W,onClose:()=>L(!1),onSelect:e=>{t(e.startDate),o(e.endDate),K(e.label)}})]})}},35678:(e,t,r)=>{r.d(t,{A:()=>v});var o=r(9950),n=r(96583),i=r(40033),s=r(82053),a=r(28170),l=r(93230),c=r(82223),d=r(55916),x=r(4159),h=r.n(x),u=r(56712),p=r(81417),m=r(96600),A=r(53132),g=r(94289),f=r(57326),j=r(50624),b=r(44414);const v=e=>{let{open:t,onClose:r,onSelect:x}=e;const[v,S]=(0,o.useState)(null);return(0,b.jsxs)(n.A,{open:t,onClose:r,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(a.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:t,toggle:r,id:"daterange1",onChange:e=>{S({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,A.A)(new Date,-1)),endDate:(0,m.A)((0,A.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,A.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,g.A)(new Date),endDate:(0,f.A)(new Date)},{label:"Last Month",startDate:(0,g.A)((0,j.A)(new Date,-1)),endDate:(0,f.A)((0,j.A)(new Date,-1))}]})}),(0,b.jsx)(l.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),r()):r()},children:"OK"})})]})}},46639:(e,t,r)=>{r.d(t,{A:()=>E});var o=r(57528),n=r(98587),i=r(58168),s=r(9950),a=r(72004),l=r(3484),c=r(88283),d=r(89548),x=r(18463),h=r(59254),u=r(45558),p=r(1614);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,u.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var A,g,f,j,b=r(44414);const v=["className","color","disableShrink","size","style","thickness","value","variant"];let S,w,y,C;const k=44,D=(0,c.i7)(S||(S=A||(A=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),R=(0,c.i7)(w||(w=g||(g=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),_=(0,h.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t["color".concat((0,d.A)(r.color))]]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({display:"inline-block"},"determinate"===t.variant&&{transition:r.transitions.create("transform")},"inherit"!==t.color&&{color:(r.vars||r).palette[t.color].main})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&(0,c.AH)(y||(y=f||(f=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),D)})),P=(0,h.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),I=(0,h.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t["circle".concat((0,d.A)(r.variant))],r.disableShrink&&t.circleDisableShrink]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:r.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,c.AH)(C||(C=j||(j=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),R)})),E=s.forwardRef((function(e,t){const r=(0,x.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:c=!1,size:h=40,style:u,thickness:p=3.6,value:A=0,variant:g="indeterminate"}=r,f=(0,n.A)(r,v),j=(0,i.A)({},r,{color:s,disableShrink:c,size:h,thickness:p,value:A,variant:g}),S=(e=>{const{classes:t,variant:r,color:o,disableShrink:n}=e,i={root:["root",r,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(r)),n&&"circleDisableShrink"]};return(0,l.A)(i,m,t)})(j),w={},y={},C={};if("determinate"===g){const e=2*Math.PI*((k-p)/2);w.strokeDasharray=e.toFixed(3),C["aria-valuenow"]=Math.round(A),w.strokeDashoffset="".concat(((100-A)/100*e).toFixed(3),"px"),y.transform="rotate(-90deg)"}return(0,b.jsx)(_,(0,i.A)({className:(0,a.A)(S.root,o),style:(0,i.A)({width:h,height:h},y,u),ownerState:j,ref:t,role:"progressbar"},C,f,{children:(0,b.jsx)(P,{className:S.svg,ownerState:j,viewBox:"".concat(22," ").concat(22," ").concat(k," ").concat(k),children:(0,b.jsx)(I,{className:S.circle,style:w,ownerState:j,cx:k,cy:k,r:(k-p)/2,fill:"none",strokeWidth:p})})}))}))},56311:(e,t,r)=>{r.d(t,{A:()=>u});var o=r(89379),n=r(9950),i=r(2660),s=r(2046),a=r(83274),l=r(25333),c=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:t,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:A}=e;const g=(0,n.useRef)(null),[f]=(0,x.d7)(t,p);return(0,n.useEffect)((()=>{u&&u(f)}),[f,u]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=g.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},A),inputRef:g,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(a.A,{title:"Clear",children:(0,h.jsx)(l.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,r)=>{r.d(t,{A:()=>h});var o=r(89379),n=r(9950),i=r(93230),s=r(41413),a=r(77922),l=r(29925),c=r(26910),d=r(31222),x=r(44414);const h=(0,n.forwardRef)(((e,t)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:A,pill:g=!1,accentColor:f="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(f).concat(e),C=y("08"),k=y("26"),D=y("55"),R=y("18"),_=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:D,borderWidth:1.5},"&:hover fieldset":{borderColor:f},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(k)},"&.Mui-focused fieldset":{borderColor:f,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:f}}:{},P=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:R,color:f,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(a.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,t,o)=>{"clear"===o?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===r||void 0===r||r(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>g?(0,x.jsx)(l.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,o.A)((0,o.A)({},_),A||m||{})})):(0,x.jsx)(l.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},A||m||{})}))})}))},96646:(e,t,r)=>{r.d(t,{r:()=>l});var o=r(9213),n=r(21671),i=r(82917),s=r(93230),a=r(44414);const l=e=>{let{rowsPerPage:t=5,col:r=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(o.A,{children:[(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,t)=>(0,a.jsx)(n.A,{children:(0,a.jsxs)(s.A,{spacing:.5,children:[(0,a.jsx)(i.A,{variant:"text",width:100}),(0,a.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:150})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(n.A,{align:"center",children:(0,a.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/181.d5552073.chunk.js b/build/static/js/181.d5552073.chunk.js new file mode 100644 index 0000000..697b033 --- /dev/null +++ b/build/static/js/181.d5552073.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[181],{10181:(e,r,t)=>{t.r(r),t.d(r,{default:()=>ne});var o=t(89379),n=t(9950),i=t(26910),s=t(36150),l=t(2235),a=t(41413),c=t(83274),d=t(16491),x=t(82053),h=t(14857),u=t(47223),p=t(93230),m=t(60899),A=t(25333),g=t(33738),j=t(74745),f=t(1320),b=t(15769),v=t(69780),S=t(9213),w=t(21671),y=t(34075),k=t(25277),C=t(96583),z=t(28170),D=t(31222),P=t(4159),R=t.n(P),I=t(81425),_=t(52351),M=t(35678),T=t(59212),E=t(56311),W=t(96646),N=t(10523),L=t(46639),Y=t(44414);const F={width:"100%",height:"100%"};function O(e){let{details:r,loading:t,riderName:o,dateRange:i,onClose:s}=e;const l=(0,n.useRef)(null),[a,c]=(0,n.useState)(null),[h,u]=(0,n.useState)([]),[m,g]=(0,n.useState)(!1),{isLoaded:j}=(0,N.KD)({googleMapsApiKey:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_STAFF_TOKEN:"",REACT_APP_URL:"https://jupiter.nearle.app/live/api/v1",REACT_APP_URL2:"https://jupiter.nearle.app/live/api/v2",REACT_APP_URL3:"https://jupiter.nearle.app/live/api/v3",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_GOOGLE_MAPS_KEY}),f=(0,n.useMemo)((()=>(r||[]).map((e=>({lat:e.dropLat,lng:e.dropLng})))),[r]);(0,n.useEffect)((()=>{if(!j||!l.current||0===f.length)return;const e=new window.google.maps.LatLngBounds;f.forEach((r=>e.extend(r))),l.current.fitBounds(e,48)}),[j,f]),(0,n.useEffect)((()=>{if(!j||f.length<2)return void u([]);let e=!1;const r=new window.google.maps.DirectionsService,t=(e,t,o)=>new Promise(((n,i)=>{r.route({origin:e,destination:t,waypoints:o.map((e=>({location:e,stopover:!0}))),travelMode:window.google.maps.TravelMode.DRIVING},((e,r)=>{"OK"===r?n(e):i(new Error(r))}))}));return(async()=>{g(!0);try{const r=f,o=[];let n=0;for(;n({lat:e.lat(),lng:e.lng()})));o.length>0&&c.length>0&&c.shift(),o.push(...c),n+=i}e||u(o)}catch(r){e||u([])}finally{e||g(!1)}})(),()=>{e=!0}}),[j,f]);const b=(e,r)=>{const t=r?38:32,o=r?"#4338ca":"#6366f1",n=encodeURIComponent('')+'')+''.concat(e,"")+"");return"data:image/svg+xml;charset=UTF-8,".concat(n)},v=(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1.5,sx:{px:2,py:1.25,borderBottom:"1px solid rgba(15, 23, 42, 0.08)",background:"linear-gradient(135deg, #6366f1 0%, #3b82f6 100%)",color:"#fff",flexShrink:0},children:[(0,Y.jsx)(D.pk7,{size:20}),(0,Y.jsxs)(p.A,{sx:{flex:1,minWidth:0},children:[(0,Y.jsxs)(x.A,{sx:{fontWeight:700,fontSize:15,lineHeight:1.2},children:["Planned route",o?" \u2014 ".concat(o):""]}),i&&(0,Y.jsx)(x.A,{sx:{fontSize:12,opacity:.85},children:i})]}),r&&r.length>0&&(0,Y.jsxs)(x.A,{sx:{fontSize:12,opacity:.9,fontWeight:600},children:[r.length," ",1===r.length?"stop":"stops",m?" \xb7 resolving route\u2026":""]}),s&&(0,Y.jsx)(A.A,{size:"small",onClick:s,sx:{color:"#fff"},"aria-label":"Close",children:(0,Y.jsx)(D.m6K,{})})]});return t||!j?(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsxs)(p.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1.5},children:[(0,Y.jsx)(L.A,{size:32}),(0,Y.jsx)(x.A,{sx:{color:"#64748b",fontSize:13},children:t?"Loading planned route\u2026":"Loading map\u2026"})]})]}):r&&0!==r.length?(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsx)(d.A,{sx:{flex:1,minHeight:0},children:(0,Y.jsxs)(N.u6,{mapContainerStyle:F,onLoad:e=>l.current=e,center:f[0],zoom:14,options:{streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1},children:[h.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N.Ro,{path:h,options:{strokeColor:"#6366f1",strokeOpacity:.25,strokeWeight:8}}),(0,Y.jsx)(N.Ro,{path:h,options:{strokeColor:"#6366f1",strokeOpacity:.95,strokeWeight:4}})]}):(0,Y.jsx)(N.Ro,{path:f,options:{strokeColor:"#6366f1",strokeOpacity:0,strokeWeight:0,icons:[{icon:{path:"M 0,-1 0,1",strokeOpacity:.6,strokeColor:"#6366f1",scale:3},offset:"0",repeat:"14px"}]}}),r.map(((e,r)=>{const t=e.step||r+1,o=a===e.deliveryid;return(0,Y.jsx)(N.pH,{position:{lat:e.dropLat,lng:e.dropLng},icon:{url:b(t,o)},onClick:()=>c(o?null:e.deliveryid),zIndex:o?1e3:t,children:o&&(0,Y.jsx)(N.Fu,{onCloseClick:()=>c(null),children:(0,Y.jsxs)(d.A,{sx:{minWidth:180,fontFamily:"inherit"},children:[(0,Y.jsxs)(x.A,{sx:{fontWeight:800,fontSize:13,color:"#0f172a"},children:["Step ",t," \xb7 ",e.customer]}),e.address&&(0,Y.jsx)(x.A,{sx:{fontSize:12,color:"#475569",mt:.5},children:e.address}),e.expectedTime&&(0,Y.jsxs)(x.A,{sx:{fontSize:12,color:"#64748b",mt:.5},children:["ETA ",String(e.expectedTime).slice(11,16)||e.expectedTime]}),e.orderid&&(0,Y.jsxs)(x.A,{sx:{fontSize:11,color:"#94a3b8",mt:.5},children:["Order #",e.orderid]})]})})},"step-".concat(e.deliveryid||e.orderid||r))}))]})})]}):(0,Y.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[v,(0,Y.jsxs)(p.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1,p:3},children:[(0,Y.jsx)(x.A,{sx:{color:"#1e293b",fontWeight:700,fontSize:16},children:"No planned route for this rider"}),(0,Y.jsx)(x.A,{sx:{color:"#64748b",fontSize:13,textAlign:"center",maxWidth:360},children:"There are no deliveries with drop coordinates assigned to this rider for the selected date range."})]})]})}var K=t(20466),B=t(23787),H=t(36220);R().extend(H);const U={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},G=(e,r)=>"".concat(e).concat(r),V=e=>G(e,"08"),X=e=>G(e,"18"),$=e=>G(e,"26"),q=e=>G(e,"55"),Z="#662582",Q="#9255AB",J=e=>(0,Y.jsx)(l.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:U.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ee=e=>{let{color:r,selected:t,size:o=24,children:n}=e;return(0,Y.jsx)(a.A,{sx:{width:o,height:o,bgcolor:t?r:X(r),color:t?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},re=e=>{let{color:r,icon:t,label:o,tooltip:n,minWidth:i=80}=e;return(0,Y.jsx)(c.A,{title:n||"",placement:"top",children:(0,Y.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:V(r),border:"1px solid ".concat(q(r)),color:r,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[t,o]})})},te=e=>{let{value:r,color:t="#ef4444",icon:o}=e;const n=Number(r)||0;return 0===n?(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,fontWeight:700},children:"0"}):(0,Y.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:V(t),border:"1px solid ".concat(q(t)),color:t,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,n]})};function oe(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function ne(){const e=(0,h.A)(),r=(0,u.A)(e.breakpoints.down("md")),[t,o]=(0,n.useState)(R()().format("YYYY-MM-DD")),[P,N]=(0,n.useState)(R()().format("YYYY-MM-DD")),[L,F]=(0,n.useState)("All"),[H,G]=(0,n.useState)(!1),[ne,ie]=(0,n.useState)("Today"),[se,le]=(0,n.useState)([]),[ae,ce]=(0,n.useState)(null),[de,xe]=(0,n.useState)(0),[he,ue]=(0,n.useState)(!1),[pe,me]=(0,n.useState)(!1),[Ae,ge]=(0,n.useState)(null),[je,fe]=(0,n.useState)(null),[be,ve]=(0,n.useState)(!1),[Se,we]=(0,n.useState)(""),[ye,ke]=(0,n.useState)(""),{isLoading:Ce,data:ze}=(0,s.I)({queryKey:["ridersummary",de,t,P],queryFn:I.KN}),De=(0,n.useMemo)((()=>{if(!ze)return[];if(!ye)return ze;const e=ye.toLowerCase().trim();return ze.filter((r=>["".concat(r.firstname||""," ").concat(r.lastname||""),String(r.userid)].filter(Boolean).some((r=>String(r).toLowerCase().includes(e)))))}),[ze,ye]),Pe=(0,n.useMemo)((()=>ze&&0!==ze.length?ze.reduce(((e,r)=>(e.riders+=1,e.orders+=Number(r.totalorders)||0,e.delivered+=Number(r.delivered)||0,e.amount+=Math.max(Number(r.charges)||0,Number(r.deliveryamt)||0),e)),{riders:0,orders:0,delivered:0,amount:0}):{riders:0,orders:0,delivered:0,amount:0}),[ze]),Re=async e=>{ue(!0);try{const r=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportsummary/?&fromdate=").concat(t,"&todate=").concat(P,"&userid=").concat(e));le(r.data.details)}catch(r){console.log("tenantRes",r)}finally{ue(!1)}},Ie=async e=>{ve(!0);try{var r;const o="undefined"!==typeof window&&localStorage.getItem("userid")||0,n=0===de?"appuserid=".concat(o):"applocationid=".concat(de),s="".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/")+"?".concat(n)+"&status=all"+"&fromdate=".concat(t)+"&todate=".concat(P)+"&pageno=1&pagesize=200&keyword=&tenantid=&locationid="+"&userid=".concat(e),l=await i.A.get(s),a=(null===l||void 0===l||null===(r=l.data)||void 0===r?void 0:r.details)||[],c=e=>{const r=Number(e);return Number.isFinite(r)?r:null},d=a.map((e=>{var r,t,o,n,i;const s=c(null!==(r=e.droplat)&&void 0!==r?r:e.deliverylat),l=c(null!==(t=e.droplon)&&void 0!==t?t:e.deliverylong),a=c(null!==(o=e.pickuplat)&&void 0!==o?o:e.pickuplatitude),d=c(null!==(n=null!==(i=e.pickuplon)&&void 0!==i?i:e.pickuplong)&&void 0!==n?n:e.picklongitude);return null==s||null==l?null:{step:Number(e.step)||0,orderid:e.orderid,deliveryid:e.deliveryid,customer:e.deliverycustomer||e.customername||"Order ".concat(e.orderid),address:e.deliveryaddress||e.deliverysuburb||"",dropLat:s,dropLng:l,pickLat:null!==a&&void 0!==a?a:null,pickLng:null!==d&&void 0!==d?d:null,expectedTime:e.expecteddeliverytime||null}})).filter(Boolean).sort(((e,r)=>e.step-r.step));ge(d)}catch(o){(0,K.k)(null===o||void 0===o?void 0:o.message,"error",2e3),ge([])}finally{ve(!1)}},_e=(0,n.useMemo)((()=>ze?ze.reduce(((e,r)=>e+(Number(r.deliveryamt)||0)),0):0),[ze]),Me=[{key:"riders",label:"Active Riders",color:Z,icon:D.bsz,value:Pe.riders},{key:"orders",label:"Total Orders",color:"#0ea5e9",icon:D.F6S,value:Pe.orders},{key:"delivered",label:"Delivered",color:"#10b981",icon:D.mU9,value:Pe.delivered},{key:"amount",label:"Total Amount",color:"#f59e0b",icon:D.YHz,value:oe(_e)}];return(0,Y.jsxs)(Y.Fragment,{children:[(Ce||he)&&(0,Y.jsx)(_.A,{}),(0,Y.jsx)(l.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),boxShadow:U.shadowMd},children:(0,Y.jsxs)(p.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Y.jsx)(a.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Z,color:"#fff",boxShadow:"0 6px 18px ".concat($(Z))},children:(0,Y.jsx)(D.bsz,{size:22})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:U.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders Summary"}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Y.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary,fontWeight:600},children:["Live \xb7 ",L||"All Zones"," \xb7 ",ne]})]})]})]}),(0,Y.jsx)(T.A,{locaName:L,setAppId:xe,setLocoName:F,pill:!0,accentColor:Z,icon:(0,Y.jsx)(D.HPi,{size:14}),placeholder:"Select Zone",paperComponent:J,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,Y.jsx)(m.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Me.map((e=>{const r=e.icon;return(0,Y.jsx)(m.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,Y.jsxs)(l.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:U.shadowMd,borderColor:q(e.color)}},children:[(0,Y.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(X(e.color)," 100%)")}}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Y.jsxs)(p.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,Y.jsx)(x.A,{sx:{fontWeight:800,color:U.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,Y.jsx)(a.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:X(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(q(e.color)),flexShrink:0},children:(0,Y.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,Y.jsx)(l.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:U.radiusCard/8,borderTopRightRadius:U.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:U.borderSubtle,borderBottom:0,background:"#fff"},children:(0,Y.jsxs)(p.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,Y.jsx)(ee,{color:Z,size:32,children:(0,Y.jsx)(D.bsz,{size:18})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:["Orders \xb7 ",ne]}),(0,Y.jsxs)(x.A,{variant:"body2",sx:{color:U.textPrimary,fontWeight:700},children:[De.length," riders \xb7 ",Pe.orders," orders"]})]}),(0,Y.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,Y.jsxs)(d.A,{onClick:()=>G(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:V("#f59e0b"),border:"1.5px solid ".concat(q("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,ml:1,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat($("#f59e0b"))}},children:[(0,Y.jsx)(D.Ki0,{size:14}),R()(t).format("DD/MM/YY")," \u2013 ",R()(P).format("DD/MM/YY")]})})]}),(0,Y.jsx)(d.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,Y.jsx)(E.A,{value:Se,onChange:we,onDebouncedChange:ke,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:V(Z),"& fieldset":{borderColor:q(Z),borderWidth:1.5},"&:hover fieldset":{borderColor:Z},"&.Mui-focused fieldset":{borderColor:Z,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat($(Z))}}})})]})}),(0,Y.jsxs)(l.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:U.radiusCard/8,borderBottomRightRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",background:"#fff"},children:[r?(0,Y.jsxs)(B.nV,{scroll:!0,children:[Ce&&(0,Y.jsx)(p.A,{alignItems:"center",sx:{py:4},children:(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,fontWeight:700},children:"Loading riders\u2026"})}),De&&0!==De.length||Ce?De.map(((e,r)=>{const t=ae===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0),n="".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014";return(0,Y.jsxs)(B.pg,{accent:Z,selected:t,header:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,Y.jsx)(ee,{color:Z,size:36,children:(0,Y.jsx)(D.LTk,{size:18})}),(0,Y.jsxs)(p.A,{sx:{minWidth:0},children:[(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary},noWrap:!0,children:n}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:["#",String(r+1).padStart(2,"0")," \xb7 ID #",e.userid]})]})]}),(0,Y.jsxs)(p.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[(0,Y.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{fe({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),ge(null),me(!0),Ie(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:X("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(q("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,Y.jsx)(D.Cd7,{size:14})})}),(0,Y.jsx)(c.A,{title:t?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{const r=!t;ce(r?e.userid:null),r&&Re(e.userid)},sx:{bgcolor:t?Z:X(Z),color:t?"#fff":Z,border:"1px solid ".concat(q(Z)),"&:hover":{bgcolor:Z,color:"#fff"}},children:t?(0,Y.jsx)(D.Xbk,{size:16}):(0,Y.jsx)(D.j1Q,{size:16})})})]})]}),children:[(0,Y.jsxs)(B.FG,{columns:2,children:[(0,Y.jsx)(B.pY,{label:"Orders",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Delivered",children:(0,Y.jsx)(te,{value:e.delivered,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Pending",children:(0,Y.jsx)(te,{value:e.pending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:11})})}),(0,Y.jsx)(B.pY,{label:"Cancelled",children:(0,Y.jsx)(te,{value:e.cancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:11})})}),(0,Y.jsx)(B.pY,{label:"KMS",children:(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,Y.jsx)(B.pY,{label:"Actual KMS",children:(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,Y.jsx)(B.pY,{label:"Amount",full:!0,children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:11}),label:oe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]}),t&&(0,Y.jsx)(g.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,Y.jsxs)(l.A,{elevation:0,sx:{mt:1.25,borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",boxShadow:U.shadowSoft},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.5,py:1,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),borderBottom:"1px solid ".concat(U.borderSubtle)},children:[(0,Y.jsx)(ee,{color:Z,size:24,selected:!0,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:"Tenant Breakdown"})]}),(0,Y.jsxs)(p.A,{divider:(0,Y.jsx)(j.A,{}),children:[he&&(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",py:2},children:"Loading\u2026"}),he||se&&0!==se.length?null===se||void 0===se?void 0:se.map(((e,r)=>(0,Y.jsxs)(d.A,{sx:{p:1.5},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:1},children:[(0,Y.jsx)(ee,{color:"#0ea5e9",size:24,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary},noWrap:!0,children:e.tenantname||"\u2014"})]}),(0,Y.jsxs)(B.FG,{columns:2,children:[(0,Y.jsx)(B.pY,{label:"All",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Completed",children:(0,Y.jsx)(te,{value:e.deliveriescompleted,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Pending",children:(0,Y.jsx)(te,{value:e.deliveriespending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:10})})}),(0,Y.jsx)(B.pY,{label:"Cancelled",children:(0,Y.jsx)(te,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:10})})}),(0,Y.jsx)(B.pY,{label:"KMS",children:(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,Y.jsx)(B.pY,{label:"Actual KMS",children:(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,Y.jsx)(B.pY,{label:"Amount",full:!0,children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:10}),label:oe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]})]},"".concat(e.tenantname,"-").concat(r)))):(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",py:2},children:"No tenant breakdown available."})]})]})})]},e.userid||r)})):(0,Y.jsxs)(p.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,Y.jsx)(a.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:U.textMuted},children:(0,Y.jsx)(D.bsz,{size:28})}),(0,Y.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:U.textPrimary},children:"No riders to show"}),(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})]}):(0,Y.jsx)(f.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:q(Z),borderRadius:8,"&:hover":{backgroundColor:Z}},"&::-webkit-scrollbar-track":{backgroundColor:U.surfaceAlt}},children:(0,Y.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1080}},children:[(0,Y.jsx)(v.A,{children:(0,Y.jsxs)(S.A,{sx:{"& th":{backgroundColor:U.surfaceAlt,color:U.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(U.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,Y.jsx)(w.A,{children:"#"}),(0,Y.jsx)(w.A,{children:"Rider"}),(0,Y.jsx)(w.A,{align:"center",children:"Orders"}),(0,Y.jsx)(w.A,{align:"center",children:"Pending"}),(0,Y.jsx)(w.A,{align:"center",children:"Cancelled"}),(0,Y.jsx)(w.A,{align:"center",children:"Delivered"}),(0,Y.jsx)(w.A,{align:"center",children:"KMS"}),(0,Y.jsx)(w.A,{align:"center",children:"Amount"}),(0,Y.jsx)(w.A,{align:"right",children:"Action"})]})}),(0,Y.jsxs)(y.A,{children:[Ce&&(0,Y.jsx)(W.r,{col:5}),De&&0!==De.length||Ce?De.map(((e,r)=>{const t=ae===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,Y.jsxs)(n.Fragment,{children:[(0,Y.jsxs)(S.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:t?"none":"1px solid ".concat(U.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:t?"#fff":U.surfaceAlt},bgcolor:t?V(Z):"transparent"},children:[(0,Y.jsx)(w.A,{children:(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:U.textMuted},children:String(r+1).padStart(2,"0")})}),(0,Y.jsx)(w.A,{children:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,Y.jsx)(ee,{color:Z,size:36,children:(0,Y.jsx)(D.LTk,{size:18})}),(0,Y.jsxs)(p.A,{children:[(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary,whiteSpace:"nowrap"},children:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014"}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:["ID #",e.userid]})]})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.pending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.cancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.delivered,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:11})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:11}),label:oe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,Y.jsx)(w.A,{align:"right",children:(0,Y.jsxs)(p.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,Y.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{fe({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),ge(null),me(!0),Ie(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:X("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(q("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,Y.jsx)(D.Cd7,{size:14})})}),(0,Y.jsx)(c.A,{title:t?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,Y.jsx)(A.A,{size:"small",onClick:()=>{const r=!t;ce(r?e.userid:null),r&&Re(e.userid)},sx:{bgcolor:t?Z:X(Z),color:t?"#fff":Z,border:"1px solid ".concat(q(Z)),"&:hover":{bgcolor:Z,color:"#fff"}},children:t?(0,Y.jsx)(D.Xbk,{size:16}):(0,Y.jsx)(D.j1Q,{size:16})})})]})})]}),t&&(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:9,sx:{p:0,borderBottom:"1px solid ".concat(U.divider),bgcolor:V(Z)},children:(0,Y.jsx)(g.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,Y.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,Y.jsxs)(l.A,{elevation:0,sx:{borderRadius:U.radiusCard/8,border:"1px solid",borderColor:U.borderSubtle,overflow:"hidden",boxShadow:U.shadowSoft},children:[(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)"),borderBottom:"1px solid ".concat(U.borderSubtle)},children:[(0,Y.jsx)(ee,{color:Z,size:28,selected:!0,children:(0,Y.jsx)(D.Itr,{size:14})}),(0,Y.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Tenant Breakdown \xb7 ","".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()]})]}),(0,Y.jsxs)(b.A,{size:"small",children:[(0,Y.jsx)(v.A,{children:(0,Y.jsxs)(S.A,{sx:{"& th":{backgroundColor:U.surfaceAlt,color:U.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(U.borderSubtle),py:1,px:1.5}},children:[(0,Y.jsx)(w.A,{children:"#"}),(0,Y.jsx)(w.A,{children:"Client"}),(0,Y.jsx)(w.A,{align:"center",children:"All"}),(0,Y.jsx)(w.A,{align:"center",children:"Pending"}),(0,Y.jsx)(w.A,{align:"center",children:"Completed"}),(0,Y.jsx)(w.A,{align:"center",children:"Cancelled"}),(0,Y.jsx)(w.A,{align:"center",children:"KMS"}),(0,Y.jsx)(w.A,{align:"center",children:"Amount"})]})}),(0,Y.jsxs)(y.A,{children:[he&&(0,Y.jsx)(W.r,{col:4}),he||se&&0!==se.length?null===se||void 0===se?void 0:se.map(((e,r)=>(0,Y.jsxs)(S.A,{sx:{"& td":{borderBottom:"1px solid ".concat(U.divider),py:1,px:1.5},"&:hover":{backgroundColor:U.surfaceAlt}},children:[(0,Y.jsx)(w.A,{children:(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:U.textMuted},children:String(r+1).padStart(2,"0")})}),(0,Y.jsx)(w.A,{children:(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,Y.jsx)(ee,{color:"#0ea5e9",size:24,children:(0,Y.jsx)(D.Itr,{size:12})}),(0,Y.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:U.textPrimary,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.totalorders,color:Z,icon:(0,Y.jsx)(D.F6S,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriespending,color:"#f59e0b",icon:(0,Y.jsx)(D.tX0,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriescompleted,color:"#10b981",icon:(0,Y.jsx)(D.mU9,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(te,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,Y.jsx)(D.uDv,{size:10})})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,Y.jsx)(re,{color:"#ef4444",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,Y.jsx)(re,{color:"#10b981",icon:(0,Y.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,Y.jsx)(w.A,{align:"center",children:(0,Y.jsx)(re,{color:Z,icon:(0,Y.jsx)(D.YHz,{size:10}),label:oe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.tenantname,"-").concat(r)))):(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:8,sx:{py:3},children:(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textMuted,textAlign:"center",display:"block"},children:"No tenant breakdown available."})})})]})]})]})})})})})]},e.userid||r)})):(0,Y.jsx)(S.A,{children:(0,Y.jsx)(w.A,{colSpan:9,sx:{py:6},children:(0,Y.jsxs)(p.A,{alignItems:"center",spacing:1.5,children:[(0,Y.jsx)(a.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:U.textMuted},children:(0,Y.jsx)(D.bsz,{size:28})}),(0,Y.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:U.textPrimary},children:"No riders to show"}),(0,Y.jsx)(x.A,{variant:"caption",sx:{color:U.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})})})]})]})}),De.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j.A,{}),(0,Y.jsxs)(p.A,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:1.5,sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(V(Z)," 0%, ").concat(V(Q)," 100%)")},children:[(0,Y.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:U.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,Y.jsx)(k.A,{label:oe(_e),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(Z," 0%, ").concat(Q," 100%)"),boxShadow:"0 6px 16px ".concat($(Z))}})]})]})]}),(0,Y.jsx)(C.A,{maxWidth:"xl",fullScreen:!0,open:pe,onClose:()=>{me(!1),ge(null),fe(null)},children:(0,Y.jsx)(z.A,{sx:{p:0,height:"100vh"},children:(0,Y.jsx)(O,{details:Ae,loading:be,riderName:null===je||void 0===je?void 0:je.name,dateRange:"".concat(R()(t).format("DD/MM/YY")," \u2013 ").concat(R()(P).format("DD/MM/YY")),onClose:()=>{me(!1),ge(null),fe(null)}})})}),(0,Y.jsx)(M.A,{open:H,onClose:()=>G(!1),onSelect:e=>{o(e.startDate),N(e.endDate),ie(e.label)}})]})}},23787:(e,r,t)=>{t.d(r,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var o=t(89379),n=t(80045),i=t(93230),s=t(2235),l=t(16491),a=t(82053),c=t(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:r,scroll:t=!1,onScroll:s,sx:l}=e,a=(0,n.A)(e,d);return(0,c.jsx)(i.A,(0,o.A)((0,o.A)({spacing:1.25,onScroll:s,sx:(0,o.A)((0,o.A)({p:1.5},t&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:r}))},h=e=>{let{accent:r="#662582",header:t,footer:n,selected:i=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(s.A,{elevation:0,onClick:a,sx:(0,o.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?r:"#e2e8f0",background:i?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[t,d,n]})]})},u=e=>{let{children:r,columns:t=2,sx:n}=e;return(0,c.jsx)(l.A,{sx:(0,o.A)({display:"grid",gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:r})},p=e=>{let{label:r,value:t,children:o,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==o?o:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==t&&void 0!==t?t:"\u2014"})})]})}},35678:(e,r,t)=>{t.d(r,{A:()=>v});var o=t(9950),n=t(96583),i=t(40033),s=t(82053),l=t(28170),a=t(93230),c=t(82223),d=t(55916),x=t(4159),h=t.n(x),u=t(56712),p=t(81417),m=t(96600),A=t(53132),g=t(94289),j=t(57326),f=t(50624),b=t(44414);const v=e=>{let{open:r,onClose:t,onSelect:x}=e;const[v,S]=(0,o.useState)(null);return(0,b.jsxs)(n.A,{open:r,onClose:t,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:r,toggle:t,id:"daterange1",onChange:e=>{S({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,A.A)(new Date,-1)),endDate:(0,m.A)((0,A.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,A.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,g.A)(new Date),endDate:(0,j.A)(new Date)},{label:"Last Month",startDate:(0,g.A)((0,f.A)(new Date,-1)),endDate:(0,j.A)((0,f.A)(new Date,-1))}]})}),(0,b.jsx)(a.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),t()):t()},children:"OK"})})]})}},46639:(e,r,t)=>{t.d(r,{A:()=>_});var o=t(57528),n=t(98587),i=t(58168),s=t(9950),l=t(72004),a=t(3484),c=t(88283),d=t(89548),x=t(18463),h=t(59254),u=t(45558),p=t(1614);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,u.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var A,g,j,f,b=t(44414);const v=["className","color","disableShrink","size","style","thickness","value","variant"];let S,w,y,k;const C=44,z=(0,c.i7)(S||(S=A||(A=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),D=(0,c.i7)(w||(w=g||(g=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),P=(0,h.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,r[t.variant],r["color".concat((0,d.A)(t.color))]]}})((e=>{let{ownerState:r,theme:t}=e;return(0,i.A)({display:"inline-block"},"determinate"===r.variant&&{transition:t.transitions.create("transform")},"inherit"!==r.color&&{color:(t.vars||t).palette[r.color].main})}),(e=>{let{ownerState:r}=e;return"indeterminate"===r.variant&&(0,c.AH)(y||(y=j||(j=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),z)})),R=(0,h.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,r)=>r.svg})({display:"block"}),I=(0,h.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.circle,r["circle".concat((0,d.A)(t.variant))],t.disableShrink&&r.circleDisableShrink]}})((e=>{let{ownerState:r,theme:t}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===r.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===r.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:r}=e;return"indeterminate"===r.variant&&!r.disableShrink&&(0,c.AH)(k||(k=f||(f=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),D)})),_=s.forwardRef((function(e,r){const t=(0,x.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:c=!1,size:h=40,style:u,thickness:p=3.6,value:A=0,variant:g="indeterminate"}=t,j=(0,n.A)(t,v),f=(0,i.A)({},t,{color:s,disableShrink:c,size:h,thickness:p,value:A,variant:g}),S=(e=>{const{classes:r,variant:t,color:o,disableShrink:n}=e,i={root:["root",t,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(t)),n&&"circleDisableShrink"]};return(0,a.A)(i,m,r)})(f),w={},y={},k={};if("determinate"===g){const e=2*Math.PI*((C-p)/2);w.strokeDasharray=e.toFixed(3),k["aria-valuenow"]=Math.round(A),w.strokeDashoffset="".concat(((100-A)/100*e).toFixed(3),"px"),y.transform="rotate(-90deg)"}return(0,b.jsx)(P,(0,i.A)({className:(0,l.A)(S.root,o),style:(0,i.A)({width:h,height:h},y,u),ownerState:f,ref:r,role:"progressbar"},k,j,{children:(0,b.jsx)(R,{className:S.svg,ownerState:f,viewBox:"".concat(22," ").concat(22," ").concat(C," ").concat(C),children:(0,b.jsx)(I,{className:S.circle,style:w,ownerState:f,cx:C,cy:C,r:(C-p)/2,fill:"none",strokeWidth:p})})}))}))},56311:(e,r,t)=>{t.d(r,{A:()=>u});var o=t(89379),n=t(9950),i=t(2660),s=t(2046),l=t(83274),a=t(25333),c=t(97125),d=t(7762),x=t(52097),h=t(44414);const u=e=>{let{value:r,onChange:t,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:A}=e;const g=(0,n.useRef)(null),[j]=(0,x.d7)(r,p);return(0,n.useEffect)((()=>{u&&u(j)}),[j,u]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=g.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},A),inputRef:g,placeholder:m,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>t(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>t(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,r,t)=>{t.d(r,{A:()=>h});var o=t(89379),n=t(9950),i=t(93230),s=t(41413),l=t(77922),a=t(29925),c=t(26910),d=t(31222),x=t(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:t,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:A,pill:g=!1,accentColor:j="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(j).concat(e),k=y("08"),C=y("26"),z=y("55"),D=y("18"),P=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:z,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},R=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:D,color:j,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,r,o)=>{"clear"===o?(null===t||void 0===t||t(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):r&&(null===t||void 0===t||t(r.applocationid),null===h||void 0===h||h(r.locationname),null===u||void 0===u||u(0))},renderInput:e=>g?(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:R}),sx:(0,o.A)((0,o.A)({},P),A||m||{})})):(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,o.A)({},A||m||{})}))})}))},96646:(e,r,t)=>{t.d(r,{r:()=>a});var o=t(9213),n=t(21671),i=t(82917),s=t(93230),l=t(44414);const a=e=>{let{rowsPerPage:r=5,col:t=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(o.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:t}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}}}]); \ No newline at end of file diff --git a/build/static/js/238.2d84f4f9.chunk.js b/build/static/js/238.2d84f4f9.chunk.js deleted file mode 100644 index ac2066d..0000000 --- a/build/static/js/238.2d84f4f9.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[238],{40238:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var s=a(9950),l=a(60899),n=a(93230),o=a(82053),i=a(19647),r=a(29925),c=a(70006),d=a(23266),h=a(82223),u=a(50027),p=a(26910),m=a(56713),g=a(52351),x=a(99459),A=a(8881),f=a(28429),j=a(44414);const y=()=>{const[e,t]=(0,s.useState)(""),[a,y]=(0,s.useState)(""),[v,C]=(0,s.useState)(""),[S,b]=(0,s.useState)(""),[_,F]=(0,s.useState)(""),[k,I]=(0,s.useState)(""),[w,z]=(0,s.useState)(""),[W,H]=(0,s.useState)({}),[M,N]=(0,s.useState)(""),[D,O]=(0,s.useState)(""),[E,K]=(0,s.useState)(""),[L,P]=(0,s.useState)({}),R=(0,f.Zp)();x.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[Y,q]=(0,s.useState)(!1);(0,s.useEffect)((()=>{localStorage.getItem("tenantid")&&U(localStorage.getItem("tenantid"))}),[]),(0,s.useEffect)((()=>{try{x.A.fromAddress(_).then((e=>{if("OK"==e.status){const{lat:t,lng:a}=e.results[0].geometry.location;H({lat:t,lng:a}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[_]);const T=e=>{(0,A.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},U=async e=>{q(!0),await p.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&P(e.data.details),q(!1)})).catch((e=>{console.log(e),q(!1)}))};(0,s.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:Z}=(0,m.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let t,a,s,l;console.log(e),F(e.formatted_address);for(let n=0;nN(e.target.value),value:M,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,j.jsxs)(n.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,j.jsx)(c.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,j.jsx)(d.A,{value:"+1",children:"+91"})}),(0,j.jsx)(r.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&t(e.target.value)},value:e,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-email",children:"Email Address"}),(0,j.jsx)(r.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>y(e.target.value),value:a,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-address",children:"Address"}),(0,j.jsx)(r.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:_,onChange:e=>F(e.target.value),inputRef:Z})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-location",children:"Suburb"}),(0,j.jsx)(r.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>z(e.target.value),value:w,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-zipcode",children:"City"}),(0,j.jsx)(r.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>C(e.target.value),value:v,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-location",children:"State"}),(0,j.jsx)(r.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>I(e.target.value),value:k,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,j.jsx)(r.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>b(e.target.value),value:S,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-location",children:"Door No"}),(0,j.jsx)(r.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>O(e.target.value),value:D,autoComplete:"off"})]})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(n.A,{spacing:1.25,children:[(0,j.jsx)(i.A,{htmlFor:"personal-email",children:"Landmark"}),(0,j.jsx)(r.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>K(e.target.value),value:E,autoComplete:"off"})]})})]})})}),(0,j.jsx)(l.Ay,{item:!0,xs:12,children:(0,j.jsx)(n.A,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:2,children:(0,j.jsx)(h.A,{variant:"contained",onClick:()=>(async()=>{if(console.log("res",businessname,businessno,e,a,_,v,S),M)if(e)if(a)if(_)if(v)if(S)if(w)if(W.lat&&W.lng){let s={customerid:0,configid:1,firstname:M,applocationid:L.applolcationid,profileimage:"",dialcode:"+91",contactno:e,devicetype:"",deviceid:"",customertoken:"",address:_,suburb:w,city:v,state:k,postcode:S,landmark:E,doorno:D,latitude:W.lat.toString(),longitude:W.lng.toString(),tenantid:parseInt(localStorage.getItem("tenantid")),email:a};console.log(s),q(!0);try{await p.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),s).then((e=>{console.log(e),e.data.status?((0,A.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),R("/clients")):"Customer Already available"==e.data.message&&(0,A.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),q(!1)})).catch((e=>{console.log(e),q(!1),(0,A.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(t){console.log(t),q(!1)}}else T("Choose valid address");else T("Fill suburb");else T("Fill post code");else T("Fill City");else T("Fill Address");else T("Fill emailaddress");else T("Fill Mobile Number");else T("Fill Full name")})(),children:"Create"})})})]})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/238.33695a38.chunk.js b/build/static/js/238.33695a38.chunk.js new file mode 100644 index 0000000..6beaf40 --- /dev/null +++ b/build/static/js/238.33695a38.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[238],{40238:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var s=a(9950),l=a(14857),n=a(47223),o=a(16491),i=a(60899),r=a(93230),c=a(82053),d=a(19647),h=a(29925),m=a(70006),u=a(23266),p=a(82223),g=a(50027),x=a(26910),A=a(56713),f=a(52351),j=a(99459),y=a(8881),v=a(28429),C=a(44414);const b=()=>{const[e,t]=(0,s.useState)(""),[a,b]=(0,s.useState)(""),[S,_]=(0,s.useState)(""),[F,k]=(0,s.useState)(""),[I,w]=(0,s.useState)(""),[z,W]=(0,s.useState)(""),[H,M]=(0,s.useState)(""),[N,D]=(0,s.useState)({}),[O,E]=(0,s.useState)(""),[K,L]=(0,s.useState)(""),[P,R]=(0,s.useState)(""),[Y,q]=(0,s.useState)({}),T=(0,v.Zp)(),U=(0,l.A)(),Z=(0,n.A)(U.breakpoints.down("md"));j.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[V,B]=(0,s.useState)(!1);(0,s.useEffect)((()=>{localStorage.getItem("tenantid")&&J(localStorage.getItem("tenantid"))}),[]),(0,s.useEffect)((()=>{try{j.A.fromAddress(I).then((e=>{if("OK"==e.status){const{lat:t,lng:a}=e.results[0].geometry.location;D({lat:t,lng:a}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[I]);const G=e=>{(0,y.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},J=async e=>{B(!0),await x.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&q(e.data.details),B(!1)})).catch((e=>{console.log(e),B(!1)}))};(0,s.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:Q}=(0,A.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let t,a,s,l;console.log(e),w(e.formatted_address);for(let n=0;nE(e.target.value),value:O,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,C.jsxs)(r.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,C.jsx)(m.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,C.jsx)(u.A,{value:"+1",children:"+91"})}),(0,C.jsx)(h.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&t(e.target.value)},value:e,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-email",children:"Email Address"}),(0,C.jsx)(h.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>b(e.target.value),value:a,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-address",children:"Address"}),(0,C.jsx)(h.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:I,onChange:e=>w(e.target.value),inputRef:Q})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-location",children:"Suburb"}),(0,C.jsx)(h.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>M(e.target.value),value:H,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-zipcode",children:"City"}),(0,C.jsx)(h.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>_(e.target.value),value:S,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-location",children:"State"}),(0,C.jsx)(h.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>W(e.target.value),value:z,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,C.jsx)(h.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>k(e.target.value),value:F,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-location",children:"Door No"}),(0,C.jsx)(h.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>L(e.target.value),value:K,autoComplete:"off"})]})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,sm:6,children:(0,C.jsxs)(r.A,{spacing:1.25,children:[(0,C.jsx)(d.A,{htmlFor:"personal-email",children:"Landmark"}),(0,C.jsx)(h.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>R(e.target.value),value:P,autoComplete:"off"})]})})]})})}),(0,C.jsx)(i.Ay,{item:!0,xs:12,children:(0,C.jsx)(r.A,{direction:{xs:"column",sm:"row"},justifyContent:"flex-end",alignItems:{xs:"stretch",sm:"center"},spacing:2,children:(0,C.jsx)(p.A,{variant:"contained",onClick:()=>(async()=>{if(console.log("res",businessname,businessno,e,a,I,S,F),O)if(e)if(a)if(I)if(S)if(F)if(H)if(N.lat&&N.lng){let s={customerid:0,configid:1,firstname:O,applocationid:Y.applolcationid,profileimage:"",dialcode:"+91",contactno:e,devicetype:"",deviceid:"",customertoken:"",address:I,suburb:H,city:S,state:z,postcode:F,landmark:P,doorno:K,latitude:N.lat.toString(),longitude:N.lng.toString(),tenantid:parseInt(localStorage.getItem("tenantid")),email:a};console.log(s),B(!0);try{await x.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),s).then((e=>{console.log(e),e.data.status?((0,y.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),T("/clients")):"Customer Already available"==e.data.message&&(0,y.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),B(!1)})).catch((e=>{console.log(e),B(!1),(0,y.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(t){console.log(t),B(!1)}}else G("Choose valid address");else G("Fill suburb");else G("Fill post code");else G("Fill City");else G("Fill Address");else G("Fill emailaddress");else G("Fill Mobile Number");else G("Fill Full name")})(),fullWidth:Z,children:"Create"})})})]})})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/2533.c3f1e61a.chunk.js b/build/static/js/2533.c3f1e61a.chunk.js deleted file mode 100644 index 0c23ba1..0000000 --- a/build/static/js/2533.c3f1e61a.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2533],{56311:(e,o,r)=>{r.d(o,{A:()=>u});var i=r(89379),t=r(9950),n=r(2660),l=r(2046),s=r(83274),c=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const m=(0,t.useRef)(null),[A]=(0,x.d7)(o,p);return(0,t.useEffect)((()=>{u&&u(A)}),[A,u]),(0,t.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=m.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(n.A,{sx:(0,i.A)({},f),inputRef:m,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(s.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var i=r(16491),t=r(46639),n=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(i.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(t.A,{size:o}),(0,l.jsx)(i.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:n,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>h});var i=r(89379),t=r(9950),n=r(93230),l=r(41413),s=r(77922),c=r(29925),a=r(26910),d=r(31222),x=r(44414);const h=(0,t.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:m=!1,accentColor:A="#6366f1",icon:v,placeholder:j="Select Zone",paperComponent:b}=e;const[S,w]=(0,t.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,t.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(A).concat(e),k=y("08"),C=y("26"),W=y("55"),R=y("18"),z=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:A},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:A}}:{},I=m&&(0,x.jsx)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:R,color:A,transition:"background-color 0.15s, color 0.15s"},children:v||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(s.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:b,sx:(0,i.A)({},p),onChange:(e,o,i)=>{"clear"===i?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===h||void 0===h||h(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>m?(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:o,placeholder:j,InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:I}),sx:(0,i.A)((0,i.A)({},z),f||g||{})})):(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,i.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},72533:(e,o,r)=>{r.r(o),r.d(o,{default:()=>le});var i=r(89379),t=r(9950),n=r(99459),l=r(28429),s=r(2235),c=r(41413),a=r(55158),d=r(93230),x=r(82053),h=r(16491),u=r(60899),p=r(82917),g=r(1320),f=r(15769),m=r(69780),A=r(9213),v=r(21671),j=r(34075),b=r(83274),S=r(25333),w=r(33738),y=r(4159),k=r.n(y),C=r(31222),W=r(59212),R=r(56311),z=r(94826),I=r(81425),Y=r(36150),T=r(60010),J=r(58691),P=r(96646),M=r(20466),L=r(26910),B=r(44414),N=r(36220);k().extend(N);const H=16,K="0 8px 24px rgba(15, 23, 42, 0.08)",Z="0 18px 50px rgba(15, 23, 42, 0.18)",D="#0f172a",F="#64748b",E="#94a3b8",q="#e2e8f0",V="#f1f5f9",G="#f8fafc",U=(e,o)=>"".concat(e).concat(o),O=e=>U(e,"08"),Q=e=>U(e,"18"),X=e=>U(e,"26"),_=e=>U(e,"55"),$="#662582",ee=e=>(0,B.jsx)(s.A,(0,i.A)((0,i.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:Z,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),oe=e=>{let{color:o,selected:r,size:i=24,children:t}=e;return(0,B.jsx)(c.A,{sx:{width:i,height:i,bgcolor:r?o:Q(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:t})},re={active:{label:"Active",color:"#10b981",icon:C.mU9},inactive:{label:"Inactive",color:"#ef4444",icon:C.uDv},online:{label:"Online",color:"#10b981",icon:C.mU9},offline:{label:"Offline",color:"#ef4444",icon:C.uDv},idle:{label:"Idle",color:"#f59e0b",icon:C.VP9},unknown:{label:"Unknown",color:"#94a3b8",icon:C.gsJ}},ie=[{key:0,label:"All Riders",color:$,icon:C.Itr,countKey:"total"},{key:1,label:"Active",color:"#10b981",icon:C.mU9,countKey:"active"}],te=e=>{var o,r,i;return[{key:"total",label:"Total Riders",color:$,icon:C.Itr,value:null!==(o=null===e||void 0===e?void 0:e.total)&&void 0!==o?o:0},{key:"active",label:"Active Riders",color:"#10b981",icon:C.mU9,value:null!==(r=null===e||void 0===e?void 0:e.active)&&void 0!==r?r:0},{key:"inactive",label:"Inactive Riders",color:"#ef4444",icon:C.uDv,value:null!==(i=null===e||void 0===e?void 0:e.inactive)&&void 0!==i?i:0}]},ne=e=>{let{color:o,icon:r,label:i,value:t}=e;return(0,B.jsx)(u.Ay,{item:!0,xs:6,sm:4,md:3,children:(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.125,py:.75,borderRadius:1.75,bgcolor:"#fff",border:"1px solid ".concat(_(o)),minWidth:0},children:[(0,B.jsx)(oe,{color:o,size:28,children:(0,B.jsx)(r,{size:14})}),(0,B.jsxs)(d.A,{sx:{minWidth:0},children:[(0,B.jsx)(x.A,{sx:{color:E,fontWeight:700,lineHeight:1,textTransform:"uppercase",letterSpacing:.4,fontSize:9.5},children:i}),(0,B.jsx)(x.A,{sx:{color:D,fontWeight:800,fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",mt:.25},children:t})]})]})})},le=()=>{const e=(0,l.Zp)(),o=(0,t.useRef)(),r=(0,t.useRef)(),[y,N]=(0,t.useState)(""),[Z,U]=(0,t.useState)(""),[le,se]=(0,t.useState)("All"),[ce,ae]=(0,t.useState)(0),[de,xe]=(0,t.useState)(0),he=localStorage.getItem("roleid"),[ue,pe]=(0,t.useState)(null),[ge,fe]=(0,t.useState)(null);n.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const{data:me,isLoading:Ae}=(0,Y.I)({queryKey:["allriders",ce,de],queryFn:I.eF}),{data:ve,isLoading:je,isError:be,error:Se}=(0,Y.I)({queryKey:["ridersStatus"],queryFn:I.bY}),{data:we,isLoading:ye,isFetchingNextPage:ke,fetchNextPage:Ce,hasNextPage:We}=(0,T.q)({queryKey:["allriders",ce,Z,de],queryFn:I.DM,getNextPageParam:(e,o)=>{var r;return null!==(r=e.details)&&void 0!==r&&r.length?o.length+1:void 0}}),Re=(null===we||void 0===we?void 0:we.pages.flatMap((e=>e.details)))||[];(0,t.useEffect)((()=>{if(!We)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Ce()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return o.current&&e.observe(o.current),()=>{o.current&&e.unobserve(o.current)}}),[We,Ce]);const ze=be?Se:null;(0,t.useEffect)((()=>{ze&&(0,M.k)(ze,"error",2e3)}),[ze]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(a.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:ye||Ae||je,children:(0,B.jsx)(z.A,{color:"inherit"})}),(0,B.jsx)(s.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:H/8,border:"1px solid",borderColor:q,background:"linear-gradient(135deg, ".concat(O($)," 0%, ").concat(O("#9255AB")," 100%)"),boxShadow:K},children:(0,B.jsxs)(d.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,B.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:$,color:"#fff",boxShadow:"0 6px 18px ".concat(X($))},children:(0,B.jsx)(C.bsz,{size:22})}),(0,B.jsxs)(d.A,{children:[(0,B.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:D,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders"}),(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,B.jsx)(h.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,B.jsxs)(x.A,{variant:"caption",sx:{color:F,fontWeight:600},children:["Live \xb7 ",le||"All Zones"]})]})]})]}),(0,B.jsx)(W.A,{locaName:le,setAppId:ae,setLocoName:se,pill:!0,accentColor:$,icon:(0,B.jsx)(C.HPi,{size:14}),placeholder:"Select Zone",paperComponent:ee,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,B.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:te(me).map((e=>{const o=e.icon;return(0,B.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,B.jsxs)(s.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:H/8,border:"1px solid",borderColor:q,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:K,borderColor:_(e.color)}},children:[(0,B.jsx)(h.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Q(e.color)," 100%)")}}),(0,B.jsxs)(d.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,B.jsxs)(d.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,B.jsx)(x.A,{variant:"caption",sx:{color:F,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Ae?(0,B.jsx)(p.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,B.jsx)(x.A,{sx:{fontWeight:800,color:D,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:e.value})]}),(0,B.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Q(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(_(e.color)),flexShrink:0},children:(0,B.jsx)(o,{size:20})})]})]})},e.key)}))}),(0,B.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:H/8,borderTopRightRadius:H/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:q,borderBottom:0,background:"#fff"},children:(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,B.jsx)(d.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:q,borderRadius:4}},children:ie.map((e=>{var o;const r=e.icon,i=de===e.key,t=null!==(o=null===me||void 0===me?void 0:me[e.countKey])&&void 0!==o?o:0;return(0,B.jsxs)(h.A,{onClick:()=>{return o=e.key,xe(o),void pe(null);var o},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?e.color:_(e.color)),bgcolor:i?e.color:O(e.color),color:i?"#fff":e.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(X(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:i?"0 6px 18px ".concat(X(e.color)):"0 0 0 3px ".concat(X(e.color))}},children:[(0,B.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":Q(e.color),color:i?"#fff":e.color},children:(0,B.jsx)(r,{size:13})}),(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,B.jsx)(h.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":e.color,border:i?"none":"1px solid ".concat(_(e.color))},children:Ae?(0,B.jsx)(p.A,{variant:"text",width:14,height:10}):t})]},e.key)}))}),(0,B.jsx)(h.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,B.jsx)(R.A,{value:y,onChange:N,onDebouncedChange:U,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:O($),"& fieldset":{borderColor:_($),borderWidth:1.5},"&:hover fieldset":{borderColor:$},"&.Mui-focused fieldset":{borderColor:$,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(X($))}}})})]})}),(0,B.jsx)(s.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:H/8,borderBottomRightRadius:H/8,border:"1px solid",borderColor:q,overflow:"hidden",background:"#fff"},children:(0,B.jsx)(g.A,{ref:r,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:i}=e.currentTarget;o+i>=r-50&&We&&!ke&&Ce()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:_($),borderRadius:8,"&:hover":{backgroundColor:$}},"&::-webkit-scrollbar-track":{backgroundColor:G}},children:(0,B.jsxs)(f.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,md:1300}},children:[(0,B.jsx)(m.A,{children:(0,B.jsxs)(A.A,{sx:{"& th":{backgroundColor:G,color:F,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(q),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,B.jsx)(v.A,{children:"#"}),(0,B.jsx)(v.A,{children:"ID"}),(0,B.jsx)(v.A,{children:"Rider"}),(0,B.jsx)(v.A,{children:"Address"}),(0,B.jsx)(v.A,{children:"Vehicle"}),(0,B.jsx)(v.A,{children:"Shift"}),(0,B.jsx)(v.A,{align:"center",children:"Time"}),(0,B.jsx)(v.A,{children:"Fare"}),(0,B.jsx)(v.A,{children:"Fuel"}),(0,B.jsx)(v.A,{align:"center",children:"Status"}),1==he&&(0,B.jsx)(v.A,{align:"right",children:"Action"})]})}),(0,B.jsxs)(j.A,{children:[ye&&(0,B.jsx)(P.r,{col:6}),0===(null===Re||void 0===Re?void 0:Re.length)&&!ye&&(0,B.jsx)(A.A,{children:(0,B.jsx)(v.A,{colSpan:1==he?11:10,sx:{py:6},children:(0,B.jsxs)(d.A,{alignItems:"center",spacing:1.5,children:[(0,B.jsx)(c.A,{sx:{width:64,height:64,bgcolor:Q("#94a3b8"),color:E},children:(0,B.jsx)(C.aVM,{size:28})}),(0,B.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:D},children:"No riders to show"}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:F},children:y?"Try a different keyword.":"No ".concat(0===de?"":"active ","riders for this zone.")})]})})}),0!==(null===Re||void 0===Re?void 0:Re.length)&&(null===Re||void 0===Re?void 0:Re.map(((o,r)=>{var n,l,s,a;const p=(e=>{if(0==de){const o="active"===(e.status||"").toLowerCase()?"active":"inactive";return re[o]}const o=null===ve||void 0===ve?void 0:ve.find((o=>o.userid===e.userid)),r=((null===o||void 0===o?void 0:o.status)||"unknown").toLowerCase();return re[r]||re.unknown})(o),g=p.icon,f=ue===o.userid;return(0,B.jsxs)(t.Fragment,{children:[(0,B.jsxs)(A.A,{sx:(0,i.A)({cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(V),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:G}},f&&{backgroundColor:O($)}),children:[(0,B.jsx)(v.A,{children:(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:E},children:String(r+1).padStart(2,"0")})}),(0,B.jsx)(v.A,{children:(0,B.jsxs)(h.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.375,borderRadius:999,bgcolor:O($),border:"1px solid ".concat(_($)),color:$,fontWeight:800,fontSize:11,minWidth:56},children:["#",null===o||void 0===o?void 0:o.userid]})}),(0,B.jsx)(v.A,{children:(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,B.jsx)(c.A,{sx:{width:36,height:36,bgcolor:Q($),color:$,fontWeight:800,fontSize:16,border:"1px solid ".concat(_($))},children:(o.fullname||o.username||"?").charAt(0).toUpperCase()}),(0,B.jsxs)(d.A,{sx:{minWidth:0},children:[(0,B.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:D,whiteSpace:"nowrap"},children:o.username||"\u2014"}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:F},children:o.contactno||"\u2014"})]})]})}),(0,B.jsx)(v.A,{sx:{maxWidth:220},children:(0,B.jsx)(b.A,{title:o.address||"",placement:"top",children:(0,B.jsxs)(d.A,{children:[(0,B.jsx)(x.A,{variant:"caption",sx:{color:F,fontWeight:600},noWrap:!0,children:o.suburb||(o.address?o.address.slice(0,20)+"\u2026":"\u2014")}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:E},noWrap:!0,children:o.city||""})]})})}),(0,B.jsx)(v.A,{children:(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,B.jsx)(oe,{color:"#0ea5e9",size:22,children:(0,B.jsx)(C.aVM,{size:12})}),(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:D},children:o.vehicleno||"\u2014"})]})}),(0,B.jsx)(v.A,{children:(0,B.jsxs)(x.A,{variant:"caption",sx:{color:F,fontWeight:600},children:["#",null!==(l=o.shiftid)&&void 0!==l?l:"\u2014"]})}),(0,B.jsx)(v.A,{align:"center",children:(0,B.jsxs)(d.A,{spacing:.5,alignItems:"center",children:[(0,B.jsx)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:.375,px:.875,py:.25,borderRadius:999,bgcolor:O("#10b981"),border:"1px solid ".concat(_("#10b981")),color:"#10b981",fontSize:10.5,fontWeight:800,minWidth:88,justifyContent:"center"},children:o.starttime?k()("".concat(k()().format("MM-DD-YYYY")," ").concat(o.starttime)).format("hh:mm A"):"\u2014"}),(0,B.jsx)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:.375,px:.875,py:.25,borderRadius:999,bgcolor:O("#ef4444"),border:"1px solid ".concat(_("#ef4444")),color:"#ef4444",fontSize:10.5,fontWeight:800,minWidth:88,justifyContent:"center"},children:o.endtime?k()("".concat(k()().format("MM-DD-YYYY")," ").concat(o.endtime)).format("hh:mm A"):"\u2014"})]})}),(0,B.jsx)(v.A,{children:(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:D},children:null!==(s=o.basefare)&&void 0!==s?s:"\u2014"})}),(0,B.jsx)(v.A,{children:(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:D},children:null!==(a=o.fuelcharge)&&void 0!==a?a:"\u2014"})}),(0,B.jsx)(v.A,{align:"center",children:(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:O(p.color),border:"1px solid ".concat(_(p.color)),color:p.color},children:[(0,B.jsx)(oe,{color:p.color,size:20,children:(0,B.jsx)(g,{size:12})}),(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:p.label})]})}),1==he&&(0,B.jsx)(v.A,{align:"right",children:(0,B.jsxs)(d.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,B.jsx)(b.A,{title:"Edit rider",placement:"top",children:(0,B.jsx)(S.A,{size:"small",sx:{bgcolor:Q($),color:$,border:"1px solid ".concat(_($)),"&:hover":{bgcolor:$,color:"#fff"}},onClick:()=>{e("/nearle/riders/edit",{state:{riderdata:o}})},children:(0,B.jsx)(C.Yvo,{size:14})})}),0!=de&&(0,B.jsx)(b.A,{title:f?"Hide logs":"View live logs",placement:"top",children:(0,B.jsx)(S.A,{size:"small",sx:{bgcolor:f?"#0ea5e9":Q("#0ea5e9"),color:f?"#fff":"#0ea5e9",border:"1px solid ".concat(_("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},onClick:()=>{o.userid==ue?pe(null):(pe(o.userid),(async e=>{try{const o=await L.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getriderperiodiclogs?userid=").concat(e));0==o.data.data.length?(pe(null),(0,M.k)(o.data.message,"error",2e3)):fe(o.data.data)}catch(o){(0,M.k)(o.message,"error",2e3)}})(o.userid))},children:f?(0,B.jsx)(C.rAP,{size:14}):(0,B.jsx)(C.WnU,{size:14})})})]})})]}),f&&0!==de&&(0,B.jsx)(A.A,{children:(0,B.jsx)(v.A,{colSpan:1==he?11:10,sx:{p:0,borderBottom:"1px solid ".concat(V)},children:(0,B.jsx)(w.A,{in:f,timeout:"auto",unmountOnExit:!0,children:(0,B.jsxs)(h.A,{sx:{p:{xs:1.5,md:2},bgcolor:O($),borderTop:"1px solid ".concat(_($))},children:[(0,B.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,B.jsx)(oe,{color:$,size:26,children:(0,B.jsx)(C.o8z,{size:14})}),(0,B.jsxs)(x.A,{sx:{fontWeight:800,color:F,letterSpacing:.6,textTransform:"uppercase",fontSize:11},children:["Live telemetry \u2014 ",o.username||"Rider #".concat(o.userid)]})]}),(0,B.jsxs)(u.Ay,{container:!0,spacing:1.25,children:[(0,B.jsx)(ne,{color:"#ef4444",icon:C.gwi,label:"Location",value:null!==ge&&void 0!==ge&&ge.latitude?"".concat(ge.latitude,", ").concat(ge.longitude):"\u2014"}),(0,B.jsx)(ne,{color:"#10b981",icon:C.E_J,label:"Battery",value:null!==ge&&void 0!==ge&&ge.battery?"".concat(ge.battery,"%"):"N/A"}),(0,B.jsx)(ne,{color:null!==ge&&void 0!==ge&&ge.is_charging?"#10b981":"#94a3b8",icon:C.Im6,label:"Charging",value:null!==ge&&void 0!==ge&&ge.is_charging?"Charging":"Not Charging"}),(0,B.jsx)(ne,{color:"#0ea5e9",icon:C.BJM,label:"Speed",value:void 0!==(null===ge||void 0===ge?void 0:ge.speed)?"".concat(ge.speed," km/h"):"\u2014"}),(0,B.jsx)(ne,{color:"#8b5cf6",icon:C.o8z,label:"Accuracy",value:void 0!==(null===ge||void 0===ge?void 0:ge.accuracy)?"".concat(ge.accuracy," m"):"\u2014"}),(0,B.jsx)(ne,{color:"#f59e0b",icon:C.VP9,label:"Log time",value:(null===ge||void 0===ge?void 0:ge.logdate)||"\u2014"}),(0,B.jsx)(ne,{color:$,icon:C.gsJ,label:"Active order",value:(null===ge||void 0===ge?void 0:ge.orderid)||"N/A"}),(0,B.jsx)(ne,{color:"idle"===(null===ge||void 0===ge?void 0:ge.status)?"#f59e0b":"#10b981",icon:C.mU9,label:"Status",value:(null===ge||void 0===ge?void 0:ge.status)||"unknown"})]})]})})})})]},null!==(n=o.userid)&&void 0!==n?n:r)}))),0!==(null===Re||void 0===Re?void 0:Re.length)&&(0,B.jsx)(A.A,{children:(0,B.jsx)(v.A,{colSpan:1==he?11:10,sx:{borderBottom:"none"},children:(0,B.jsx)("div",{ref:o,style:{height:40,textAlign:"center"},children:ke||We?(0,B.jsx)(J.A,{}):(0,B.jsx)(x.A,{variant:"caption",sx:{color:E,fontWeight:600},children:"No more riders"})})})})]})]})})})]})}},94826:(e,o,r)=>{r.d(o,{A:()=>a});var i=r(59254),t=r(46639),n=r(62217),l=r(44414);const s=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,l.jsxs)(s,{children:[(0,l.jsx)(t.A,{color:"primary",size:80,thickness:6}),(0,l.jsx)(c,{children:(0,l.jsx)("img",{src:n,alt:"Logo",style:{width:"100%",height:"100%"}})})]})},96646:(e,o,r)=>{r.d(o,{r:()=>c});var i=r(9213),t=r(21671),n=r(82917),l=r(93230),s=r(44414);const c=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(i.A,{children:[(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,s.jsx)(t.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(n.A,{variant:"text",width:100}),(0,s.jsx)(n.A,{variant:"text",width:80})]})},o))),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"text",width:150})}),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(t.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(n.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(n.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/2533.ef2d33a7.chunk.js b/build/static/js/2533.ef2d33a7.chunk.js new file mode 100644 index 0000000..af611d1 --- /dev/null +++ b/build/static/js/2533.ef2d33a7.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2533],{23787:(e,o,r)=>{r.d(o,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var i=r(89379),t=r(80045),n=r(93230),l=r(2235),s=r(16491),c=r(82053),a=r(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:l,sx:s}=e,c=(0,t.A)(e,d);return(0,a.jsx)(n.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:l,sx:(0,i.A)((0,i.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),s)},c),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:t,selected:n=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(l.A,{elevation:0,onClick:c,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:n?o:"#e2e8f0",background:n?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(s.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,a.jsxs)(s.A,{sx:{p:1.5,pl:2},children:[r,d,t]})]})},u=e=>{let{children:o,columns:r=2,sx:t}=e;return(0,a.jsx)(s.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},t),children:o})},p=e=>{let{label:o,value:r,children:i,full:t=!1,align:n="left"}=e;return(0,a.jsxs)(s.A,{sx:{gridColumn:t?"1 / -1":"auto",minWidth:0,textAlign:n},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,a.jsx)(s.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var i=r(89379),t=r(9950),n=r(2660),l=r(2046),s=r(83274),c=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const A=(0,t.useRef)(null),[m]=(0,x.d7)(o,p);return(0,t.useEffect)((()=>{u&&u(m)}),[m,u]),(0,t.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=A.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===A.current&&A.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(n.A,{sx:(0,i.A)({},f),inputRef:A,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(s.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var i=r(16491),t=r(46639),n=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(i.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(t.A,{size:o}),(0,l.jsx)(i.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:n,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>h});var i=r(89379),t=r(9950),n=r(93230),l=r(41413),s=r(77922),c=r(29925),a=r(26910),d=r(31222),x=r(44414);const h=(0,t.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:A=!1,accentColor:m="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,t.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,t.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(m).concat(e),k=y("08"),W=y("26"),C=y("55"),z=y("18"),R=A?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:C,borderWidth:1.5},"&:hover fieldset":{borderColor:m},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(W)},"&.Mui-focused fieldset":{borderColor:m,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:m}}:{},Y=A&&(0,x.jsx)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:z,color:m,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(s.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:v,sx:(0,i.A)({},p),onChange:(e,o,i)=>{"clear"===i?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===h||void 0===h||h(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>A?(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:o,placeholder:b,InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:Y}),sx:(0,i.A)((0,i.A)({},R),f||g||{})})):(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,i.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},72533:(e,o,r)=>{r.r(o),r.d(o,{default:()=>ae});var i=r(89379),t=r(9950),n=r(99459),l=r(28429),s=r(2235),c=r(41413),a=r(47223),d=r(55158),x=r(93230),h=r(82053),u=r(16491),p=r(60899),g=r(82917),f=r(1320),A=r(25333),m=r(15769),j=r(69780),b=r(9213),v=r(21671),S=r(34075),w=r(83274),y=r(33738),k=r(14857),W=r(4159),C=r.n(W),z=r(31222),R=r(59212),Y=r(23787),I=r(56311),T=r(94826),J=r(81425),M=r(36150),P=r(60010),L=r(58691),N=r(96646),B=r(20466),H=r(26910),K=r(44414),D=r(36220);C().extend(D);const F=16,V="0 8px 24px rgba(15, 23, 42, 0.08)",Z="0 18px 50px rgba(15, 23, 42, 0.18)",E="#0f172a",q="#64748b",U="#94a3b8",G="#e2e8f0",O="#f1f5f9",Q="#f8fafc",X=(e,o)=>"".concat(e).concat(o),_=e=>X(e,"08"),$=e=>X(e,"18"),ee=e=>X(e,"26"),oe=e=>X(e,"55"),re="#662582",ie=e=>(0,K.jsx)(s.A,(0,i.A)((0,i.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:Z,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),te=e=>{let{color:o,selected:r,size:i=24,children:t}=e;return(0,K.jsx)(c.A,{sx:{width:i,height:i,bgcolor:r?o:$(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:t})},ne={active:{label:"Active",color:"#10b981",icon:z.mU9},inactive:{label:"Inactive",color:"#ef4444",icon:z.uDv},online:{label:"Online",color:"#10b981",icon:z.mU9},offline:{label:"Offline",color:"#ef4444",icon:z.uDv},idle:{label:"Idle",color:"#f59e0b",icon:z.VP9},unknown:{label:"Unknown",color:"#94a3b8",icon:z.gsJ}},le=[{key:0,label:"All Riders",color:re,icon:z.Itr,countKey:"total"},{key:1,label:"Active",color:"#10b981",icon:z.mU9,countKey:"active"}],se=e=>{var o,r,i;return[{key:"total",label:"Total Riders",color:re,icon:z.Itr,value:null!==(o=null===e||void 0===e?void 0:e.total)&&void 0!==o?o:0},{key:"active",label:"Active Riders",color:"#10b981",icon:z.mU9,value:null!==(r=null===e||void 0===e?void 0:e.active)&&void 0!==r?r:0},{key:"inactive",label:"Inactive Riders",color:"#ef4444",icon:z.uDv,value:null!==(i=null===e||void 0===e?void 0:e.inactive)&&void 0!==i?i:0}]},ce=e=>{let{color:o,icon:r,label:i,value:t}=e;return(0,K.jsx)(p.Ay,{item:!0,xs:6,sm:4,md:3,children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.125,py:.75,borderRadius:1.75,bgcolor:"#fff",border:"1px solid ".concat(oe(o)),minWidth:0},children:[(0,K.jsx)(te,{color:o,size:28,children:(0,K.jsx)(r,{size:14})}),(0,K.jsxs)(x.A,{sx:{minWidth:0},children:[(0,K.jsx)(h.A,{sx:{color:U,fontWeight:700,lineHeight:1,textTransform:"uppercase",letterSpacing:.4,fontSize:9.5},children:i}),(0,K.jsx)(h.A,{sx:{color:E,fontWeight:800,fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",mt:.25},children:t})]})]})})},ae=()=>{const e=(0,l.Zp)(),o=(0,k.A)(),r=(0,a.A)(o.breakpoints.down("md")),W=(0,t.useRef)(),D=(0,t.useRef)(),[Z,X]=(0,t.useState)(""),[ae,de]=(0,t.useState)(""),[xe,he]=(0,t.useState)("All"),[ue,pe]=(0,t.useState)(0),[ge,fe]=(0,t.useState)(0),Ae=localStorage.getItem("roleid"),[me,je]=(0,t.useState)(null),[be,ve]=(0,t.useState)(null);n.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const{data:Se,isLoading:we}=(0,M.I)({queryKey:["allriders",ue,ge],queryFn:J.eF}),ye=async e=>{try{const o=await H.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getriderperiodiclogs?userid=").concat(e));0==o.data.data.length?(je(null),(0,B.k)(o.data.message,"error",2e3)):ve(o.data.data)}catch(o){(0,B.k)(o.message,"error",2e3)}},{data:ke,isLoading:We,isError:Ce,error:ze}=(0,M.I)({queryKey:["ridersStatus"],queryFn:J.bY}),{data:Re,isLoading:Ye,isFetchingNextPage:Ie,fetchNextPage:Te,hasNextPage:Je}=(0,P.q)({queryKey:["allriders",ue,ae,ge],queryFn:J.DM,getNextPageParam:(e,o)=>{var r;return null!==(r=e.details)&&void 0!==r&&r.length?o.length+1:void 0}}),Me=(null===Re||void 0===Re?void 0:Re.pages.flatMap((e=>e.details)))||[];(0,t.useEffect)((()=>{if(!Je)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Te()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return W.current&&e.observe(W.current),()=>{W.current&&e.unobserve(W.current)}}),[Je,Te]);const Pe=Ce?ze:null;(0,t.useEffect)((()=>{Pe&&(0,B.k)(Pe,"error",2e3)}),[Pe]);const Le=e=>{if(0==ge){const o="active"===(e.status||"").toLowerCase()?"active":"inactive";return ne[o]}const o=null===ke||void 0===ke?void 0:ke.find((o=>o.userid===e.userid)),r=((null===o||void 0===o?void 0:o.status)||"unknown").toLowerCase();return ne[r]||ne.unknown};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(d.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Ye||we||We,children:(0,K.jsx)(T.A,{color:"inherit"})}),(0,K.jsx)(s.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:F/8,border:"1px solid",borderColor:G,background:"linear-gradient(135deg, ".concat(_(re)," 0%, ").concat(_("#9255AB")," 100%)"),boxShadow:V},children:(0,K.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,K.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:re,color:"#fff",boxShadow:"0 6px 18px ".concat(ee(re))},children:(0,K.jsx)(z.bsz,{size:22})}),(0,K.jsxs)(x.A,{children:[(0,K.jsx)(h.A,{variant:"h3",sx:{fontWeight:800,color:E,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders"}),(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,K.jsx)(u.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,K.jsxs)(h.A,{variant:"caption",sx:{color:q,fontWeight:600},children:["Live \xb7 ",xe||"All Zones"]})]})]})]}),(0,K.jsx)(R.A,{locaName:xe,setAppId:pe,setLocoName:he,pill:!0,accentColor:re,icon:(0,K.jsx)(z.HPi,{size:14}),placeholder:"Select Zone",paperComponent:ie,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,K.jsx)(p.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:se(Se).map((e=>{const o=e.icon;return(0,K.jsx)(p.Ay,{item:!0,xs:12,sm:4,children:(0,K.jsxs)(s.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:F/8,border:"1px solid",borderColor:G,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:V,borderColor:oe(e.color)}},children:[(0,K.jsx)(u.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat($(e.color)," 100%)")}}),(0,K.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,K.jsxs)(x.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,K.jsx)(h.A,{variant:"caption",sx:{color:q,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),we?(0,K.jsx)(g.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,K.jsx)(h.A,{sx:{fontWeight:800,color:E,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:e.value})]}),(0,K.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:$(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(oe(e.color)),flexShrink:0},children:(0,K.jsx)(o,{size:20})})]})]})},e.key)}))}),(0,K.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:F/8,borderTopRightRadius:F/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:G,borderBottom:0,background:"#fff"},children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,K.jsx)(x.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:G,borderRadius:4}},children:le.map((e=>{var o;const r=e.icon,i=ge===e.key,t=null!==(o=null===Se||void 0===Se?void 0:Se[e.countKey])&&void 0!==o?o:0;return(0,K.jsxs)(u.A,{onClick:()=>{return o=e.key,fe(o),void je(null);var o},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?e.color:oe(e.color)),bgcolor:i?e.color:_(e.color),color:i?"#fff":e.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(ee(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:i?"0 6px 18px ".concat(ee(e.color)):"0 0 0 3px ".concat(ee(e.color))}},children:[(0,K.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":$(e.color),color:i?"#fff":e.color},children:(0,K.jsx)(r,{size:13})}),(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,K.jsx)(u.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":e.color,border:i?"none":"1px solid ".concat(oe(e.color))},children:we?(0,K.jsx)(g.A,{variant:"text",width:14,height:10}):t})]},e.key)}))}),(0,K.jsx)(u.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,K.jsx)(I.A,{value:Z,onChange:X,onDebouncedChange:de,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:_(re),"& fieldset":{borderColor:oe(re),borderWidth:1.5},"&:hover fieldset":{borderColor:re},"&.Mui-focused fieldset":{borderColor:re,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ee(re))}}})})]})}),(0,K.jsx)(s.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:F/8,borderBottomRightRadius:F/8,border:"1px solid",borderColor:G,overflow:"hidden",background:"#fff"},children:(0,K.jsx)(f.A,{ref:D,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:i}=e.currentTarget;o+i>=r-50&&Je&&!Ie&&Te()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:oe(re),borderRadius:8,"&:hover":{backgroundColor:re}},"&::-webkit-scrollbar-track":{backgroundColor:Q}},children:r?(0,K.jsxs)(Y.nV,{sx:{p:1.25},children:[Ye&&(0,K.jsxs)(x.A,{alignItems:"center",sx:{py:6},children:[(0,K.jsx)(L.A,{}),(0,K.jsx)(h.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading riders\u2026"})]}),0===(null===Me||void 0===Me?void 0:Me.length)&&!Ye&&(0,K.jsxs)(x.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,K.jsx)(c.A,{sx:{width:64,height:64,bgcolor:$("#94a3b8"),color:U},children:(0,K.jsx)(z.aVM,{size:28})}),(0,K.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:E},children:"No riders to show"}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:q,textAlign:"center",px:2},children:Z?"Try a different keyword.":"No ".concat(0===ge?"":"active ","riders for this zone.")})]}),0!==(null===Me||void 0===Me?void 0:Me.length)&&(null===Me||void 0===Me?void 0:Me.map(((o,r)=>{var i,t,n,l;const s=Le(o),a=s.icon,d=me===o.userid;return(0,K.jsxs)(Y.pg,{accent:s.color,selected:d,header:(0,K.jsxs)(x.A,{spacing:1.25,children:[(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:U},children:String(r+1).padStart(2,"0")}),(0,K.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.375,borderRadius:999,bgcolor:_(re),border:"1px solid ".concat(oe(re)),color:re,fontWeight:800,fontSize:11},children:["#",null===o||void 0===o?void 0:o.userid]}),(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:_(s.color),border:"1px solid ".concat(oe(s.color)),color:s.color},children:[(0,K.jsx)(te,{color:s.color,size:18,children:(0,K.jsx)(a,{size:11})}),(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,fontSize:10.5,lineHeight:1},children:s.label})]})]}),1==Ae&&(0,K.jsxs)(x.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[(0,K.jsx)(A.A,{size:"small",sx:{borderRadius:999,bgcolor:$(re),color:re,border:"1px solid ".concat(oe(re)),"&:hover":{bgcolor:re,color:"#fff"}},onClick:()=>{e("/nearle/riders/edit",{state:{riderdata:o}})},children:(0,K.jsx)(z.Yvo,{size:14})}),0!=ge&&(0,K.jsx)(A.A,{size:"small",sx:{borderRadius:999,bgcolor:d?"#0ea5e9":$("#0ea5e9"),color:d?"#fff":"#0ea5e9",border:"1px solid ".concat(oe("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},onClick:()=>{o.userid==me?je(null):(je(o.userid),ye(o.userid))},children:d?(0,K.jsx)(z.rAP,{size:14}):(0,K.jsx)(z.WnU,{size:14})})]})]}),(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,K.jsx)(c.A,{sx:{width:36,height:36,bgcolor:$(re),color:re,fontWeight:800,fontSize:16,border:"1px solid ".concat(oe(re)),flexShrink:0},children:(o.fullname||o.username||"?").charAt(0).toUpperCase()}),(0,K.jsxs)(u.A,{sx:{minWidth:0},children:[(0,K.jsx)(h.A,{sx:{fontWeight:800,color:E,fontSize:15},noWrap:!0,children:o.username||"\u2014"}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:q},noWrap:!0,children:o.contactno||"\u2014"})]})]})]}),children:[(0,K.jsxs)(Y.FG,{children:[(0,K.jsxs)(Y.pY,{label:"Address",full:!0,children:[(0,K.jsx)(h.A,{sx:{fontSize:13,fontWeight:600,color:q},noWrap:!0,children:o.suburb||(o.address?o.address.slice(0,20)+"\u2026":"\u2014")}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:U},noWrap:!0,children:o.city||""})]}),(0,K.jsx)(Y.pY,{label:"Vehicle",children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,K.jsx)(te,{color:"#0ea5e9",size:22,children:(0,K.jsx)(z.aVM,{size:12})}),(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:E},children:o.vehicleno||"\u2014"})]})}),(0,K.jsx)(Y.pY,{label:"Shift",value:"#".concat(null!==(t=o.shiftid)&&void 0!==t?t:"\u2014")}),(0,K.jsx)(Y.pY,{label:"Time",children:(0,K.jsxs)(x.A,{spacing:.5,children:[(0,K.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:.875,py:.25,borderRadius:999,bgcolor:_("#10b981"),border:"1px solid ".concat(oe("#10b981")),color:"#10b981",fontSize:10.5,fontWeight:800},children:o.starttime?C()("".concat(C()().format("MM-DD-YYYY")," ").concat(o.starttime)).format("hh:mm A"):"\u2014"}),(0,K.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:.875,py:.25,borderRadius:999,bgcolor:_("#ef4444"),border:"1px solid ".concat(oe("#ef4444")),color:"#ef4444",fontSize:10.5,fontWeight:800},children:o.endtime?C()("".concat(C()().format("MM-DD-YYYY")," ").concat(o.endtime)).format("hh:mm A"):"\u2014"})]})}),(0,K.jsx)(Y.pY,{label:"Fare",value:null!==(n=o.basefare)&&void 0!==n?n:"\u2014"}),(0,K.jsx)(Y.pY,{label:"Fuel",value:null!==(l=o.fuelcharge)&&void 0!==l?l:"\u2014"})]}),d&&0!==ge&&(0,K.jsxs)(u.A,{sx:{mt:1.5,p:1.25,borderRadius:2,bgcolor:_(re),border:"1px solid ".concat(oe(re))},children:[(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,K.jsx)(te,{color:re,size:26,children:(0,K.jsx)(z.o8z,{size:14})}),(0,K.jsxs)(h.A,{sx:{fontWeight:800,color:q,letterSpacing:.6,textTransform:"uppercase",fontSize:11},children:["Live telemetry \u2014 ",o.username||"Rider #".concat(o.userid)]})]}),(0,K.jsxs)(p.Ay,{container:!0,spacing:1.25,children:[(0,K.jsx)(ce,{color:"#ef4444",icon:z.gwi,label:"Location",value:null!==be&&void 0!==be&&be.latitude?"".concat(be.latitude,", ").concat(be.longitude):"\u2014"}),(0,K.jsx)(ce,{color:"#10b981",icon:z.E_J,label:"Battery",value:null!==be&&void 0!==be&&be.battery?"".concat(be.battery,"%"):"N/A"}),(0,K.jsx)(ce,{color:null!==be&&void 0!==be&&be.is_charging?"#10b981":"#94a3b8",icon:z.Im6,label:"Charging",value:null!==be&&void 0!==be&&be.is_charging?"Charging":"Not Charging"}),(0,K.jsx)(ce,{color:"#0ea5e9",icon:z.BJM,label:"Speed",value:void 0!==(null===be||void 0===be?void 0:be.speed)?"".concat(be.speed," km/h"):"\u2014"}),(0,K.jsx)(ce,{color:"#8b5cf6",icon:z.o8z,label:"Accuracy",value:void 0!==(null===be||void 0===be?void 0:be.accuracy)?"".concat(be.accuracy," m"):"\u2014"}),(0,K.jsx)(ce,{color:"#f59e0b",icon:z.VP9,label:"Log time",value:(null===be||void 0===be?void 0:be.logdate)||"\u2014"}),(0,K.jsx)(ce,{color:re,icon:z.gsJ,label:"Active order",value:(null===be||void 0===be?void 0:be.orderid)||"N/A"}),(0,K.jsx)(ce,{color:"idle"===(null===be||void 0===be?void 0:be.status)?"#f59e0b":"#10b981",icon:z.mU9,label:"Status",value:(null===be||void 0===be?void 0:be.status)||"unknown"})]})]})]},null!==(i=o.userid)&&void 0!==i?i:r)}))),0!==(null===Me||void 0===Me?void 0:Me.length)&&(0,K.jsx)("div",{ref:W,style:{height:40,textAlign:"center"},children:Ie||Je?(0,K.jsx)(L.A,{}):(0,K.jsx)(h.A,{variant:"caption",sx:{color:U,fontWeight:600},children:"No more riders"})})]}):(0,K.jsxs)(m.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,md:1300}},children:[(0,K.jsx)(j.A,{children:(0,K.jsxs)(b.A,{sx:{"& th":{backgroundColor:Q,color:q,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(G),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,K.jsx)(v.A,{children:"#"}),(0,K.jsx)(v.A,{children:"ID"}),(0,K.jsx)(v.A,{children:"Rider"}),(0,K.jsx)(v.A,{children:"Address"}),(0,K.jsx)(v.A,{children:"Vehicle"}),(0,K.jsx)(v.A,{children:"Shift"}),(0,K.jsx)(v.A,{align:"center",children:"Time"}),(0,K.jsx)(v.A,{children:"Fare"}),(0,K.jsx)(v.A,{children:"Fuel"}),(0,K.jsx)(v.A,{align:"center",children:"Status"}),1==Ae&&(0,K.jsx)(v.A,{align:"right",children:"Action"})]})}),(0,K.jsxs)(S.A,{children:[Ye&&(0,K.jsx)(N.r,{col:6}),0===(null===Me||void 0===Me?void 0:Me.length)&&!Ye&&(0,K.jsx)(b.A,{children:(0,K.jsx)(v.A,{colSpan:1==Ae?11:10,sx:{py:6},children:(0,K.jsxs)(x.A,{alignItems:"center",spacing:1.5,children:[(0,K.jsx)(c.A,{sx:{width:64,height:64,bgcolor:$("#94a3b8"),color:U},children:(0,K.jsx)(z.aVM,{size:28})}),(0,K.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:E},children:"No riders to show"}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:q},children:Z?"Try a different keyword.":"No ".concat(0===ge?"":"active ","riders for this zone.")})]})})}),0!==(null===Me||void 0===Me?void 0:Me.length)&&(null===Me||void 0===Me?void 0:Me.map(((o,r)=>{var n,l,s,a;const d=Le(o),g=d.icon,f=me===o.userid;return(0,K.jsxs)(t.Fragment,{children:[(0,K.jsxs)(b.A,{sx:(0,i.A)({cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(O),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:Q}},f&&{backgroundColor:_(re)}),children:[(0,K.jsx)(v.A,{children:(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:U},children:String(r+1).padStart(2,"0")})}),(0,K.jsx)(v.A,{children:(0,K.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.375,borderRadius:999,bgcolor:_(re),border:"1px solid ".concat(oe(re)),color:re,fontWeight:800,fontSize:11,minWidth:56},children:["#",null===o||void 0===o?void 0:o.userid]})}),(0,K.jsx)(v.A,{children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,K.jsx)(c.A,{sx:{width:36,height:36,bgcolor:$(re),color:re,fontWeight:800,fontSize:16,border:"1px solid ".concat(oe(re))},children:(o.fullname||o.username||"?").charAt(0).toUpperCase()}),(0,K.jsxs)(x.A,{sx:{minWidth:0},children:[(0,K.jsx)(h.A,{variant:"subtitle2",sx:{fontWeight:700,color:E,whiteSpace:"nowrap"},children:o.username||"\u2014"}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:q},children:o.contactno||"\u2014"})]})]})}),(0,K.jsx)(v.A,{sx:{maxWidth:220},children:(0,K.jsx)(w.A,{title:o.address||"",placement:"top",children:(0,K.jsxs)(x.A,{children:[(0,K.jsx)(h.A,{variant:"caption",sx:{color:q,fontWeight:600},noWrap:!0,children:o.suburb||(o.address?o.address.slice(0,20)+"\u2026":"\u2014")}),(0,K.jsx)(h.A,{variant:"caption",sx:{color:U},noWrap:!0,children:o.city||""})]})})}),(0,K.jsx)(v.A,{children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,K.jsx)(te,{color:"#0ea5e9",size:22,children:(0,K.jsx)(z.aVM,{size:12})}),(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:E},children:o.vehicleno||"\u2014"})]})}),(0,K.jsx)(v.A,{children:(0,K.jsxs)(h.A,{variant:"caption",sx:{color:q,fontWeight:600},children:["#",null!==(l=o.shiftid)&&void 0!==l?l:"\u2014"]})}),(0,K.jsx)(v.A,{align:"center",children:(0,K.jsxs)(x.A,{spacing:.5,alignItems:"center",children:[(0,K.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.375,px:.875,py:.25,borderRadius:999,bgcolor:_("#10b981"),border:"1px solid ".concat(oe("#10b981")),color:"#10b981",fontSize:10.5,fontWeight:800,minWidth:88,justifyContent:"center"},children:o.starttime?C()("".concat(C()().format("MM-DD-YYYY")," ").concat(o.starttime)).format("hh:mm A"):"\u2014"}),(0,K.jsx)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.375,px:.875,py:.25,borderRadius:999,bgcolor:_("#ef4444"),border:"1px solid ".concat(oe("#ef4444")),color:"#ef4444",fontSize:10.5,fontWeight:800,minWidth:88,justifyContent:"center"},children:o.endtime?C()("".concat(C()().format("MM-DD-YYYY")," ").concat(o.endtime)).format("hh:mm A"):"\u2014"})]})}),(0,K.jsx)(v.A,{children:(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:E},children:null!==(s=o.basefare)&&void 0!==s?s:"\u2014"})}),(0,K.jsx)(v.A,{children:(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:E},children:null!==(a=o.fuelcharge)&&void 0!==a?a:"\u2014"})}),(0,K.jsx)(v.A,{align:"center",children:(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:_(d.color),border:"1px solid ".concat(oe(d.color)),color:d.color},children:[(0,K.jsx)(te,{color:d.color,size:20,children:(0,K.jsx)(g,{size:12})}),(0,K.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:d.label})]})}),1==Ae&&(0,K.jsx)(v.A,{align:"right",children:(0,K.jsxs)(x.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,K.jsx)(w.A,{title:"Edit rider",placement:"top",children:(0,K.jsx)(A.A,{size:"small",sx:{bgcolor:$(re),color:re,border:"1px solid ".concat(oe(re)),"&:hover":{bgcolor:re,color:"#fff"}},onClick:()=>{e("/nearle/riders/edit",{state:{riderdata:o}})},children:(0,K.jsx)(z.Yvo,{size:14})})}),0!=ge&&(0,K.jsx)(w.A,{title:f?"Hide logs":"View live logs",placement:"top",children:(0,K.jsx)(A.A,{size:"small",sx:{bgcolor:f?"#0ea5e9":$("#0ea5e9"),color:f?"#fff":"#0ea5e9",border:"1px solid ".concat(oe("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},onClick:()=>{o.userid==me?je(null):(je(o.userid),ye(o.userid))},children:f?(0,K.jsx)(z.rAP,{size:14}):(0,K.jsx)(z.WnU,{size:14})})})]})})]}),f&&0!==ge&&(0,K.jsx)(b.A,{children:(0,K.jsx)(v.A,{colSpan:1==Ae?11:10,sx:{p:0,borderBottom:"1px solid ".concat(O)},children:(0,K.jsx)(y.A,{in:f,timeout:"auto",unmountOnExit:!0,children:(0,K.jsxs)(u.A,{sx:{p:{xs:1.5,md:2},bgcolor:_(re),borderTop:"1px solid ".concat(oe(re))},children:[(0,K.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,K.jsx)(te,{color:re,size:26,children:(0,K.jsx)(z.o8z,{size:14})}),(0,K.jsxs)(h.A,{sx:{fontWeight:800,color:q,letterSpacing:.6,textTransform:"uppercase",fontSize:11},children:["Live telemetry \u2014 ",o.username||"Rider #".concat(o.userid)]})]}),(0,K.jsxs)(p.Ay,{container:!0,spacing:1.25,children:[(0,K.jsx)(ce,{color:"#ef4444",icon:z.gwi,label:"Location",value:null!==be&&void 0!==be&&be.latitude?"".concat(be.latitude,", ").concat(be.longitude):"\u2014"}),(0,K.jsx)(ce,{color:"#10b981",icon:z.E_J,label:"Battery",value:null!==be&&void 0!==be&&be.battery?"".concat(be.battery,"%"):"N/A"}),(0,K.jsx)(ce,{color:null!==be&&void 0!==be&&be.is_charging?"#10b981":"#94a3b8",icon:z.Im6,label:"Charging",value:null!==be&&void 0!==be&&be.is_charging?"Charging":"Not Charging"}),(0,K.jsx)(ce,{color:"#0ea5e9",icon:z.BJM,label:"Speed",value:void 0!==(null===be||void 0===be?void 0:be.speed)?"".concat(be.speed," km/h"):"\u2014"}),(0,K.jsx)(ce,{color:"#8b5cf6",icon:z.o8z,label:"Accuracy",value:void 0!==(null===be||void 0===be?void 0:be.accuracy)?"".concat(be.accuracy," m"):"\u2014"}),(0,K.jsx)(ce,{color:"#f59e0b",icon:z.VP9,label:"Log time",value:(null===be||void 0===be?void 0:be.logdate)||"\u2014"}),(0,K.jsx)(ce,{color:re,icon:z.gsJ,label:"Active order",value:(null===be||void 0===be?void 0:be.orderid)||"N/A"}),(0,K.jsx)(ce,{color:"idle"===(null===be||void 0===be?void 0:be.status)?"#f59e0b":"#10b981",icon:z.mU9,label:"Status",value:(null===be||void 0===be?void 0:be.status)||"unknown"})]})]})})})})]},null!==(n=o.userid)&&void 0!==n?n:r)}))),0!==(null===Me||void 0===Me?void 0:Me.length)&&(0,K.jsx)(b.A,{children:(0,K.jsx)(v.A,{colSpan:1==Ae?11:10,sx:{borderBottom:"none"},children:(0,K.jsx)("div",{ref:W,style:{height:40,textAlign:"center"},children:Ie||Je?(0,K.jsx)(L.A,{}):(0,K.jsx)(h.A,{variant:"caption",sx:{color:U,fontWeight:600},children:"No more riders"})})})})]})]})})})]})}},94826:(e,o,r)=>{r.d(o,{A:()=>a});var i=r(59254),t=r(46639),n=r(62217),l=r(44414);const s=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,l.jsxs)(s,{children:[(0,l.jsx)(t.A,{color:"primary",size:80,thickness:6}),(0,l.jsx)(c,{children:(0,l.jsx)("img",{src:n,alt:"Logo",style:{width:"100%",height:"100%"}})})]})},96646:(e,o,r)=>{r.d(o,{r:()=>c});var i=r(9213),t=r(21671),n=r(82917),l=r(93230),s=r(44414);const c=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(i.A,{children:[(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,s.jsx)(t.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(n.A,{variant:"text",width:100}),(0,s.jsx)(n.A,{variant:"text",width:80})]})},o))),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"text",width:150})}),(0,s.jsx)(t.A,{children:(0,s.jsx)(n.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(t.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(n.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(n.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/2638.bc119b66.chunk.js b/build/static/js/2638.bc119b66.chunk.js new file mode 100644 index 0000000..6cd06c7 --- /dev/null +++ b/build/static/js/2638.bc119b66.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2638],{12638:(e,t,a)=>{a.r(t),a.d(t,{default:()=>C});var s=a(9950),l=a(14857),n=a(47223),o=a(60899),i=a(93230),r=a(82053),c=a(19647),d=a(29925),h=a(70006),m=a(23266),u=a(82223),p=a(50027),g=a(26910),x=a(56713),A=a(52351),f=a(99459),j=a(8881),y=a(28429),v=a(44414);const C=()=>{const e=(0,l.A)(),t=(0,n.A)(e.breakpoints.down("md")),[a,C]=(0,s.useState)(""),[S,b]=(0,s.useState)(""),[_,F]=(0,s.useState)(""),[k,I]=(0,s.useState)(""),[w,z]=(0,s.useState)(""),[W,H]=(0,s.useState)(""),[M,N]=(0,s.useState)(""),[D,O]=(0,s.useState)({}),[E,K]=(0,s.useState)(""),[L,P]=(0,s.useState)(""),[Y,R]=(0,s.useState)(""),[q,T]=(0,s.useState)({}),U=(0,y.Zp)();f.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[X,Z]=(0,s.useState)(!1);(0,s.useEffect)((()=>{localStorage.getItem("tenantid")&&B(localStorage.getItem("tenantid"))}),[]),(0,s.useEffect)((()=>{try{f.A.fromAddress(w).then((e=>{if("OK"==e.status){const{lat:t,lng:a}=e.results[0].geometry.location;O({lat:t,lng:a}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[w]);const V=e=>{(0,j.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},B=async e=>{Z(!0),await g.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&T(e.data.details),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))};(0,s.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:G}=(0,x.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let t,a,s,l;console.log(e),z(e.formatted_address);for(let n=0;nK(e.target.value),value:E,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,v.jsxs)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,v.jsx)(h.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,v.jsx)(m.A,{value:"+1",children:"+91"})}),(0,v.jsx)(d.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&C(e.target.value)},value:a,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-email",children:"Email Address"}),(0,v.jsx)(d.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>b(e.target.value),value:S,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-address",children:"Address"}),(0,v.jsx)(d.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:w,onChange:e=>z(e.target.value),inputRef:G})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-location",children:"Suburb"}),(0,v.jsx)(d.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>N(e.target.value),value:M,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-zipcode",children:"City"}),(0,v.jsx)(d.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>F(e.target.value),value:_,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-location",children:"State"}),(0,v.jsx)(d.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>H(e.target.value),value:W,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,v.jsx)(d.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>I(e.target.value),value:k,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-location",children:"Door No"}),(0,v.jsx)(d.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>P(e.target.value),value:L,autoComplete:"off"})]})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,sm:6,children:(0,v.jsxs)(i.A,{spacing:1.25,children:[(0,v.jsx)(c.A,{htmlFor:"personal-email",children:"Landmark"}),(0,v.jsx)(d.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>R(e.target.value),value:Y,autoComplete:"off"})]})})]})})}),(0,v.jsx)(o.Ay,{item:!0,xs:12,children:(0,v.jsx)(i.A,{direction:{xs:"column",sm:"row"},justifyContent:"flex-end",alignItems:{xs:"stretch",sm:"center"},spacing:2,children:(0,v.jsx)(u.A,{variant:"contained",onClick:()=>(async()=>{if(console.log("res",businessname,businessno,a,S,w,_,k),E)if(a)if(S)if(w)if(_)if(k)if(M)if(D.lat&&D.lng){let t={customerid:0,configid:1,firstname:E,applocationid:q.applolcationid,profileimage:"",dialcode:"+91",contactno:a,devicetype:"",deviceid:"",customertoken:"",address:w,suburb:M,city:_,state:W,postcode:k,landmark:Y,doorno:L,latitude:D.lat.toString(),longitude:D.lng.toString(),tenantid:parseInt(localStorage.getItem("tenantid")),email:S};console.log(t),Z(!0);try{await g.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),t).then((e=>{console.log(e),e.data.status?((0,j.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),U("/clients")):"Customer Already available"==e.data.message&&(0,j.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Z(!1)})).catch((e=>{console.log(e),Z(!1),(0,j.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(e){console.log(e),Z(!1)}}else V("Choose valid address");else V("Fill suburb");else V("Fill post code");else V("Fill City");else V("Fill Address");else V("Fill emailaddress");else V("Fill Mobile Number");else V("Fill Full name")})(),fullWidth:t,children:"Create"})})})]})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/2638.f4999b6b.chunk.js b/build/static/js/2638.f4999b6b.chunk.js deleted file mode 100644 index 76bd261..0000000 --- a/build/static/js/2638.f4999b6b.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2638],{12638:(e,t,a)=>{a.r(t),a.d(t,{default:()=>v});var s=a(9950),l=a(14857),n=a(60899),o=a(93230),i=a(82053),r=a(19647),c=a(29925),d=a(70006),h=a(23266),u=a(82223),p=a(50027),m=a(26910),g=a(56713),x=a(52351),A=a(99459),f=a(8881),j=a(28429),y=a(44414);const v=()=>{(0,l.A)();const[e,t]=(0,s.useState)(""),[a,v]=(0,s.useState)(""),[C,S]=(0,s.useState)(""),[b,_]=(0,s.useState)(""),[F,k]=(0,s.useState)(""),[I,w]=(0,s.useState)(""),[z,W]=(0,s.useState)(""),[H,M]=(0,s.useState)({}),[N,D]=(0,s.useState)(""),[O,E]=(0,s.useState)(""),[K,L]=(0,s.useState)(""),[P,Y]=(0,s.useState)({}),R=(0,j.Zp)();A.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[q,T]=(0,s.useState)(!1);(0,s.useEffect)((()=>{localStorage.getItem("tenantid")&&Z(localStorage.getItem("tenantid"))}),[]),(0,s.useEffect)((()=>{try{A.A.fromAddress(F).then((e=>{if("OK"==e.status){const{lat:t,lng:a}=e.results[0].geometry.location;M({lat:t,lng:a}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[F]);const U=e=>{(0,f.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},Z=async e=>{T(!0),await m.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&Y(e.data.details),T(!1)})).catch((e=>{console.log(e),T(!1)}))};(0,s.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:V}=(0,g.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let t,a,s,l;console.log(e),k(e.formatted_address);for(let n=0;nD(e.target.value),value:N,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,y.jsxs)(o.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,y.jsx)(d.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,y.jsx)(h.A,{value:"+1",children:"+91"})}),(0,y.jsx)(c.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&t(e.target.value)},value:e,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-email",children:"Email Address"}),(0,y.jsx)(c.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>v(e.target.value),value:a,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-address",children:"Address"}),(0,y.jsx)(c.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:F,onChange:e=>k(e.target.value),inputRef:V})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-location",children:"Suburb"}),(0,y.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>W(e.target.value),value:z,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-zipcode",children:"City"}),(0,y.jsx)(c.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>S(e.target.value),value:C,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-location",children:"State"}),(0,y.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>w(e.target.value),value:I,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,y.jsx)(c.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>_(e.target.value),value:b,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-location",children:"Door No"}),(0,y.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>E(e.target.value),value:O,autoComplete:"off"})]})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(o.A,{spacing:1.25,children:[(0,y.jsx)(r.A,{htmlFor:"personal-email",children:"Landmark"}),(0,y.jsx)(c.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>L(e.target.value),value:K,autoComplete:"off"})]})})]})})}),(0,y.jsx)(n.Ay,{item:!0,xs:12,children:(0,y.jsx)(o.A,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:2,children:(0,y.jsx)(u.A,{variant:"contained",onClick:()=>(async()=>{if(console.log("res",businessname,businessno,e,a,F,C,b),N)if(e)if(a)if(F)if(C)if(b)if(z)if(H.lat&&H.lng){let s={customerid:0,configid:1,firstname:N,applocationid:P.applolcationid,profileimage:"",dialcode:"+91",contactno:e,devicetype:"",deviceid:"",customertoken:"",address:F,suburb:z,city:C,state:I,postcode:b,landmark:K,doorno:O,latitude:H.lat.toString(),longitude:H.lng.toString(),tenantid:parseInt(localStorage.getItem("tenantid")),email:a};console.log(s),T(!0);try{await m.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),s).then((e=>{console.log(e),e.data.status?((0,f.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),R("/clients")):"Customer Already available"==e.data.message&&(0,f.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),T(!1)})).catch((e=>{console.log(e),T(!1),(0,f.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(t){console.log(t),T(!1)}}else U("Choose valid address");else U("Fill suburb");else U("Fill post code");else U("Fill City");else U("Fill Address");else U("Fill emailaddress");else U("Fill Mobile Number");else U("Fill Full name")})(),children:"Create"})})})]})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/2851.2e35a236.chunk.js b/build/static/js/2851.2e35a236.chunk.js deleted file mode 100644 index 8f069af..0000000 --- a/build/static/js/2851.2e35a236.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2851],{22851:(e,o,r)=>{r.r(o),r.d(o,{default:()=>Fe});var t=r(89379),n=r(85571),i=r(8881),l=r(24513),s=r(36256),d=r(9950),a=r(4159),c=r.n(a),h=r(26910),x=r(14857),u=r(31222),p=r(51778),g=r(36150),f=r(60010),b=r(2235),A=r(41413),v=r(55158),m=r(93230),j=r(82053),w=r(16491),S=r(60899),y=r(82917),C=r(77922),k=r(25277),W=r(29925),R=r(1320),D=r(15769),M=r(69780),P=r(9213),L=r(21671),I=r(93038),z=r(34075),T=r(83274),Y=r(25333),F=r(17239),K=r(23266),E=r(33738),O=r(96583),N=r(28170),H=r(82223),B=r(40033),J=r(79739),q=r(37476),Z=r(56712),U=r(81417),G=r(96600),V=r(53132),Q=r(94289),X=r(57326),_=r(50624),$=r(55916),ee=r(52351),oe=r(67562),re=r(49883),te=r(81425),ne=r(56311),ie=r(20466),le=r(96646),se=r(59212),de=r(58691),ae=r(44414),ce=r(36220);c().extend(ce);const he=999,xe=16,ue="0 8px 24px rgba(15, 23, 42, 0.08)",pe="0 18px 50px rgba(15, 23, 42, 0.18)",ge="#0f172a",fe="#64748b",be="#94a3b8",Ae="#e2e8f0",ve="#f1f5f9",me="#f8fafc",je=(e,o)=>"".concat(e).concat(o),we=e=>je(e,"08"),Se=e=>je(e,"18"),ye=e=>je(e,"26"),Ce=e=>je(e,"55"),ke=e=>({cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:he+"px",bgcolor:we(e),fontWeight:600,color:ge,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:Ce(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e}}),We={pending:{label:"Pending",color:"#f59e0b",icon:u.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:u.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:u.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:u.gsJ},active:{label:"Active",color:"#14b8a6",icon:u.pk7},skipped:{label:"Skipped",color:"#f97316",icon:u.ivF},delivered:{label:"Delivered",color:"#10b981",icon:u.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:u.uDv}},Re=[{status:"pending",countKey:"uncoveredLength"},{status:"accepted",countKey:"assignedLength"},{status:"arrived",countKey:"arrivedLength"},{status:"picked",countKey:"pickedLength"},{status:"active",countKey:"activeLength"},{status:"skipped",countKey:"skippedLength"},{status:"delivered",countKey:"coveredLength"},{status:"cancelled",countKey:"cancelLength"}],De=[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:u.F6S},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:u.tX0},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:u.mU9},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:u.uDv}],Me=[{id:"all",label:"All Batches",range:"Across the day",color:"#7c3aed",iconKey:"all"},{id:"morning",label:"Morning Batch",range:"12 AM to 8 AM",color:"#0ea5e9",iconKey:"morning",startHour:0,endHour:8},{id:"afternoon",label:"Afternoon Batch",range:"9 AM to 12:30 PM",color:"#f59e0b",iconKey:"afternoon",startHour:9,endHour:12.5},{id:"evening",label:"Evening Batch",range:"4 PM to 7 PM",color:"#6366f1",iconKey:"evening",startHour:16,endHour:19}],Pe={all:u.lB9,morning:u.N3N,afternoon:u.aSE,evening:u.giK},Le=()=>{const e=c()(),o=e.hour()+e.minute()/60;for(const r of Me)if("all"!==r.id&&o>=r.startHour&&o{let o=null;for(const i of Ie)if(null!==e&&void 0!==e&&e[i]){o=e[i];break}if(!o)return null;const r=String(o).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(r))return null;const t=c()(o);if(!t.isValid())return null;const n=t.hour()+t.minute()/60;for(const i of Me)if("all"!==i.id&&n>=i.startHour&&n(0,ae.jsx)(b.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:pe,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Ye=e=>{let{color:o,selected:r,size:t=24,children:n}=e;return(0,ae.jsx)(A.A,{sx:{width:t,height:t,bgcolor:r?o:Se(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:n})},Fe=()=>{const e=localStorage.getItem("userid"),o=((0,x.A)(),(0,d.useRef)()),r=(0,d.useRef)(),[a,ce]=(0,d.useState)([]),[he,je]=(0,d.useState)(!1),[Ie,Fe]=(0,d.useState)("All"),[Ke,Ee]=(0,d.useState)(0),[Oe,Ne]=(0,d.useState)(c()().format("YYYY-MM-DD")),[He,Be]=(0,d.useState)(c()().format("YYYY-MM-DD")),[Je,qe]=(0,d.useState)("Pending"),[Ze,Ue]=(0,d.useState)(0),[Ge,Ve]=(0,d.useState)(!1),[Qe,Xe]=(0,d.useState)("Today"),[_e,$e]=(0,d.useState)(""),[eo,oo]=(0,d.useState)(),[ro,to]=(0,d.useState)(),[no,io]=(0,d.useState)(""),[lo,so]=(0,d.useState)({}),[ao,co]=(0,d.useState)(""),[ho,xo]=(0,d.useState)(""),[uo,po]=(0,d.useState)("pending"),[go,fo]=(0,d.useState)("delivered"),bo=(0,d.useRef)(null),Ao=(0,d.useRef)(null),[vo,mo]=d.useState(0),[jo,wo]=d.useState(50),[So,yo]=d.useState(),[Co,ko]=(0,d.useState)(null),[Wo,Ro]=(0,d.useState)(null),[Do,Mo]=(0,d.useState)(""),[Po,Lo]=(0,d.useState)(""),[Io,zo]=d.useState(null),[To,Yo]=(0,d.useState)(null),[Fo,Ko]=(0,d.useState)(!1),[Eo,Oo]=d.useState(null),[No,Ho]=(0,d.useState)(""),[Bo,Jo]=(0,d.useState)(!1),[qo,Zo]=(0,d.useState)(!1),[Uo,Go]=(0,d.useState)(""),[Vo,Qo]=(0,d.useState)(null),[Xo,_o]=(0,d.useState)(0),[$o,er]=(0,d.useState)(0),[or,rr]=(0,d.useState)(null),[tr,nr]=(0,d.useState)(null),[ir,lr]=(0,d.useState)(0),[sr,dr]=(0,d.useState)(Le),ar=localStorage.getItem("roleid");(0,d.useEffect)((()=>{_o(0),rr(null),er(0),nr(null)}),[Ke]),(0,d.useEffect)((()=>{er(0),nr(null)}),[Xo]);const cr=Boolean(Io),hr=()=>{zo(null)},{mutate:xr}=(0,p.n)({mutationFn:e=>{let{selectedRow:o,cancelFeed:r}=e;return(0,te.zF)(o,r)},onSuccess:()=>{Sr("Delivery Cancelled Successfully","success"),Jo(!1),qr(),Dr(),Tr()},onError:e=>{Sr(e.message,"error")}}),{data:ur,isLoading:pr,isError:gr,error:fr}=(0,g.I)({queryKey:["tenantlist",Ke],queryFn:()=>(0,te.Mn)(Ke),enabled:0!==Ke}),{data:br,isLoading:Ar,isError:vr,error:mr}=(0,g.I)({queryKey:["gettenantlocations",Xo],queryFn:()=>(0,te.DL)(Xo),enabled:0!==Xo}),jr=(0,p.n)({mutationFn:te.k3,onSuccess:()=>{(0,i.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},onError:e=>{(0,i.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}}),wr=(0,p.n)({mutationFn:e=>{let{selectedRider:o,selectedRow:r}=e;return(0,te.R_)(o,r)},onSuccess:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;Ko(!1),Zo(!1),"Success"===e.data.message&&(n.A.info("Rider changed successfully for order ID ".concat(null===t||void 0===t?void 0:t.orderid,". New Rider: ").concat(null===r||void 0===r?void 0:r.firstname," ").concat(null===r||void 0===r?void 0:r.lastname)),Sr("Rider Changed Successfully","success")),qr(),Dr(),Tr(),jr.mutate(r.userfcmtoken)},onError:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;n.A.error("Failed to change rider for order ID ".concat(null===t||void 0===t?void 0:t.orderid,":"),e),Sr(e.message,"error"),Ko(!1)}}),Sr=(e,o)=>{(0,i.M8)(e,{variant:o,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},{data:yr}=(0,g.I)({queryKey:["orderdetails",Wo],queryFn:()=>(0,te.z3)(Wo),enabled:!!Wo}),Cr=()=>{je(!1)},{isLoading:kr,isError:Wr,error:Rr,refetch:Dr}=(0,f.q)({queryKey:["fetchdeliveries",Ke,e,uo,Oe,He,jo,Po,Xo,$o,ir],queryFn:te.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),{data:Mr,fetchNextPage:Pr,hasNextPage:Lr,isFetchingNextPage:Ir,isLoading:zr,refetch:Tr}=(0,f.q)({queryKey:["fetchdeliveries-batchcounts",Ke,e,"all",Oe,He,200,"",Xo,$o,ir],queryFn:te.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),Yr=(0,d.useMemo)((()=>((null===Mr||void 0===Mr?void 0:Mr.pages)||[]).flatMap((e=>e.rows||[]))),[Mr]);(0,d.useEffect)((()=>{Lr&&!Ir&&Pr()}),[Lr,Ir,Pr,Yr.length]);const Fr=Lr||Ir,Kr=(0,d.useMemo)((()=>{const e=String(uo||"").toLowerCase(),o=String(Po||"").trim().toLowerCase();return Yr.filter((r=>{if("all"!==sr&&ze(r)!==sr)return!1;const t=String(r.orderstatus||"").toLowerCase();if(e&&t!==e)return!1;if(o){if(![r.deliverycustomer,r.deliveryaddress,r.deliverysuburb,r.pickupcustomer,r.pickupaddress,r.pickupsuburb,r.orderid,r.tenantname,r.ridername,r.username].map((e=>String(e||"").toLowerCase())).join(" ").includes(o))return!1}return!0}))}),[Yr,sr,uo,Po]),Er=(0,d.useMemo)((()=>{const e={uncoveredLength:0,assignedLength:0,arrivedLength:0,pickedLength:0,activeLength:0,skippedLength:0,coveredLength:0,cancelLength:0};return Yr.forEach((o=>{if("all"!==sr&&ze(o)!==sr)return;switch(String(o.orderstatus||"").toLowerCase()){case"pending":e.uncoveredLength+=1;break;case"accepted":case"assigned":e.assignedLength+=1;break;case"arrived":e.arrivedLength+=1;break;case"picked":e.pickedLength+=1;break;case"active":e.activeLength+=1;break;case"skipped":e.skippedLength+=1;break;case"delivered":e.coveredLength+=1;break;case"cancelled":case"canceled":e.cancelLength+=1}})),e}),[Yr,sr]),Or=(0,d.useMemo)((()=>{const e={all:0};return Me.forEach((o=>{"all"!==o.id&&(e[o.id]=0)})),Yr.forEach((o=>{const r=ze(o);r&&(e[r]=(e[r]||0)+1,e.all+=1)})),e}),[Yr]);(0,d.useEffect)((()=>{if(!Lr)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Pr()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return o.current&&e.observe(o.current),()=>{o.current&&e.unobserve(o.current)}}),[Lr,Pr]);const{data:Nr={},isLoading:Hr,isError:Br,error:Jr,refetch:qr}=(0,g.I)({queryKey:["fetchCountData",Ke,e,Oe,He,jo,Po,Xo,$o,ir,Je],queryFn:()=>(0,te.qB)(Ke,e,Oe,He,jo,Po,Xo,$o,ir)});(0,d.useEffect)((()=>{console.log("countData",Nr),0===Ze&&Nr&&yo(Nr.uncoveredLength)}),[Nr]);const{data:Zr=[],isLoading:Ur,isError:Gr,error:Vr}=(0,g.I)({queryKey:["ridersList",Ke],queryFn:te.Sd,enabled:Boolean(Ke),onError:e=>{(0,ie.k)(e.message,"error",2e3)}}),Qr=(0,p.n)({mutationFn:e=>(0,te.wT)(e),onSuccess:e=>{console.log(e),e.data.status&&(Sr("Updated Successfully","success"),to(""),io(""),je(!1),Dr(),qr(),Tr())},onError:e=>{console.log(e),Sr(e.message,"success")}}),Xr=Wr?"Error fetching deliveries: ".concat(null===Rr||void 0===Rr?void 0:Rr.message):Br?"Error fetching count summary: ".concat(null===Jr||void 0===Jr?void 0:Jr.message):Gr?"Error fetching riders: ".concat(null===Vr||void 0===Vr?void 0:Vr.message):gr?"Error tenant list: ".concat(null===fr||void 0===fr?void 0:fr.message):vr?"Error location list: ".concat(null===mr||void 0===mr?void 0:mr.message):null;return Xr?(console.log("errorMessage",Xr),(0,ie.k)(Xr,"error",2e3),null):(0,ae.jsxs)(ae.Fragment,{children:[(Hr||zr||pr||Ar||Ur)&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(ee.A,{})}),(0,ae.jsx)(v.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Hr||kr||pr||Ar||Ur}),(0,ae.jsx)(b.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:xe/8,border:"1px solid",borderColor:Ae,background:"linear-gradient(135deg, ".concat(we("#6366f1")," 0%, ").concat(we("#0ea5e9")," 100%)"),boxShadow:ue},children:(0,ae.jsxs)(m.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,ae.jsx)(A.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,ae.jsx)(u.F6S,{size:22})}),(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"h3",sx:{fontWeight:800,color:ge,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Deliveries"}),(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,ae.jsx)(w.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,ae.jsxs)(j.A,{variant:"caption",sx:{color:fe,fontWeight:600},children:["Live \xb7 ",Ie||"All Zones"]})]})]})]}),(0,ae.jsx)(se.A,{ref:bo,locaName:Ie,setAppId:Ee,setLocoName:Fe,setPage:mo,pill:!0,accentColor:"#6366f1",icon:(0,ae.jsx)(u.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Te,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,ae.jsx)(S.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:[(0,t.A)((0,t.A)({},De[0]),{},{value:Or.all,percentage:null}),(0,t.A)((0,t.A)({},De[1]),{},{value:null===Nr||void 0===Nr?void 0:Nr.uncoveredLength,percentage:null!==Nr&&void 0!==Nr&&Nr.total?Math.round(Nr.uncoveredLength/Nr.total*100):0}),(0,t.A)((0,t.A)({},De[2]),{},{value:null===Nr||void 0===Nr?void 0:Nr.coveredLength,percentage:null!==Nr&&void 0!==Nr&&Nr.total?Math.round(Nr.coveredLength/Nr.total*100):0}),(0,t.A)((0,t.A)({},De[3]),{},{value:null===Nr||void 0===Nr?void 0:Nr.cancelLength,percentage:null!==Nr&&void 0!==Nr&&Nr.total?Math.round(Nr.cancelLength/Nr.total*100):0})].map((e=>{var o;const r=e.icon,t="number"===typeof e.percentage?e.percentage:Number(e.percentage),n=!Number.isNaN(t)&&void 0!==e.percentage&&null!==e.percentage;return(0,ae.jsx)(S.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,ae.jsxs)(b.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:xe/8,border:"1px solid",borderColor:Ae,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:ue,borderColor:Ce(e.color)}},children:[(0,ae.jsx)(w.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Se(e.color)," 100%)")}}),(0,ae.jsxs)(m.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,ae.jsxs)(m.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Hr?(0,ae.jsx)(y.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,ae.jsx)(j.A,{sx:{fontWeight:800,color:ge,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:null!==(o=e.value)&&void 0!==o?o:0}),n&&(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.5,flexWrap:"wrap"},children:[(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:999,bgcolor:Se(e.color),color:e.color,fontSize:{xs:10,sm:11},fontWeight:800},children:[Math.abs(t),"%"]}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be,display:{xs:"none",sm:"inline"}},children:"of total"})]})]}),(0,ae.jsx)(A.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Se(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(Ce(e.color)),flexShrink:0},children:(0,ae.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,ae.jsxs)(b.A,{elevation:0,sx:{mt:{xs:1.5,md:2},mb:{xs:1.5,md:2},p:{xs:1.5,md:2},borderRadius:xe/8,border:"1px solid",borderColor:Ae,background:"#fff",boxShadow:ue},children:[(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:{xs:1,md:1.5},color:fe},children:[(0,ae.jsx)(A.A,{sx:{width:28,height:28,bgcolor:Se("#6366f1"),color:"#6366f1"},children:(0,ae.jsx)(u.MiI,{size:16})}),(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.6,textTransform:"uppercase",color:fe},children:"Filters"})]}),(0,ae.jsxs)(m.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1.25,sx:{flexWrap:"wrap"},children:[(0,ae.jsxs)(m.A,{direction:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",children:[(()=>{const e=Me.find((e=>e.id===sr))||Me[0],o=Pe[e.iconKey]||u.VP9;return(0,ae.jsx)(C.A,{disableClearable:!0,size:"small",openOnFocus:!0,selectOnFocus:!0,filterOptions:e=>e,options:Me,value:e,onChange:(e,o)=>o&&dr(o.id),getOptionLabel:e=>e.label,isOptionEqualToValue:(e,o)=>e.id===o.id,PaperComponent:Te,ListboxProps:{sx:{py:0,maxHeight:360}},renderOption:(e,o,r)=>{var n;let{selected:i}=r;const l=Pe[o.iconKey]||u.VP9,s=null!==(n=Or[o.id])&&void 0!==n?n:0;return(0,d.createElement)("li",(0,t.A)((0,t.A)({},e),{},{key:o.id,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderBottom:"1px solid #f1f5f9",backgroundColor:i?"".concat(o.color,"10"):"transparent",transition:"background-color 0.15s"}}),(0,ae.jsx)(A.A,{sx:{width:36,height:36,bgcolor:i?o.color:"".concat(o.color,"18"),color:i?"#fff":o.color,transition:"background-color 0.15s, color 0.15s"},children:(0,ae.jsx)(l,{size:20})}),(0,ae.jsxs)(m.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,ae.jsx)(j.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:o.label}),(0,ae.jsx)(j.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:o.range})]}),(0,ae.jsx)(k.A,{size:"small",label:s,sx:{minWidth:36,height:22,fontWeight:800,fontSize:11,bgcolor:s>0?"".concat(o.color,"18"):"#f1f5f9",color:s>0?o.color:"#94a3b8",border:"1px solid ".concat(s>0?o.color+"55":"#e2e8f0"),"& .MuiChip-label":{px:.75}}}),i&&(0,ae.jsx)(A.A,{sx:{width:22,height:22,bgcolor:o.color,color:"#fff"},children:(0,ae.jsx)(u.g9_,{size:14})}))},renderInput:r=>{var n;return(0,ae.jsx)(W.A,(0,t.A)((0,t.A)({},r),{},{placeholder:"Batch",inputProps:(0,t.A)((0,t.A)({},r.inputProps),{},{readOnly:!0,style:(0,t.A)((0,t.A)({},(null===(n=r.inputProps)||void 0===n?void 0:n.style)||{}),{},{cursor:"pointer",caretColor:"transparent"})}),InputProps:(0,t.A)((0,t.A)({},r.InputProps),{},{startAdornment:(0,ae.jsx)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,ae.jsx)(A.A,{sx:{width:24,height:24,bgcolor:"".concat(e.color,"18"),color:e.color},children:(0,ae.jsx)(o,{size:14})})})}),sx:{minWidth:{xs:180,sm:220,md:240},cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:"".concat(e.color,"08"),fontWeight:700,color:e.color,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:"".concat(e.color,"55"),borderWidth:1.5},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(e.color,"26")},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e.color}}}))}})})(),Oe&&He&&(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,onClick:()=>Ve(!0),sx:{pl:.5,pr:1.25,py:.5,borderRadius:999,cursor:"pointer",bgcolor:we("#f59e0b"),border:"1.5px solid ".concat(Ce("#f59e0b")),transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(ye("#f59e0b"))}},children:[(0,ae.jsx)(Ye,{color:"#f59e0b",children:(0,ae.jsx)(u.tjE,{size:14})}),(0,ae.jsxs)(j.A,{variant:"caption",sx:{fontWeight:700,color:"#f59e0b",whiteSpace:"nowrap"},children:[c()(Oe).format("DD MMM")," \u2013 ",c()(He).format("DD MMM")]})]})]}),(0,ae.jsx)(C.A,{disablePortal:!0,options:ur||[],value:or,PaperComponent:Te,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{Ke||(e.preventDefault(),(0,ie.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=bo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(_o(0),rr(null),er(0),nr(null)):(_o((null===o||void 0===o?void 0:o.tenantid)||0),rr(o),er(0),nr(null))},renderInput:e=>(0,ae.jsx)(W.A,(0,t.A)((0,t.A)({},e),{},{inputRef:Ao,placeholder:"Select Tenant",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,ae.jsx)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,ae.jsx)(Ye,{color:"#0ea5e9",children:(0,ae.jsx)(u.gl1,{size:14})})})}),sx:ke("#0ea5e9")}))}),(0,ae.jsx)(C.A,{disablePortal:!0,options:br||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:tr,PaperComponent:Te,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{Ke||Xo?Xo||(e.preventDefault(),(0,ie.k)("Please select your Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=Ao.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,ie.k)("Please select your Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=bo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(er(0),nr(null)):(er(o.locationid||0),nr(o))},renderInput:e=>(0,ae.jsx)(W.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Select Location",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,ae.jsx)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,ae.jsx)(Ye,{color:"#14b8a6",children:(0,ae.jsx)(u.gwi,{size:14})})})}),sx:ke("#14b8a6")}))}),(0,ae.jsx)(C.A,{disabled:Ur,options:Zr,PaperComponent:Te,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onChange:(e,o,r)=>{lr("clear"===r?0:o.userid)},onOpen:e=>{Ke||(e.preventDefault(),(0,ie.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=bo.current)||void 0===e?void 0:e.focus()}),0))},renderInput:e=>(0,ae.jsx)(W.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,ae.jsx)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,ae.jsx)(Ye,{color:"#8b5cf6",children:(0,ae.jsx)(u.bsz,{size:14})})})}),sx:ke("#8b5cf6")}))})]})]}),(0,ae.jsx)(b.A,{elevation:0,sx:{p:{xs:1,md:1.5},borderTopLeftRadius:xe/8,borderTopRightRadius:xe/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:Ae,borderBottom:0,background:"#fff"},children:(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,ae.jsx)(m.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:Ae,borderRadius:4}},children:Re.map(((e,o)=>{var r;const t=We[e.status],n=t.icon,i=Ze===o,l=null!==(r=Er[e.countKey])&&void 0!==r?r:0;return(0,ae.jsxs)(w.A,{onClick:e=>{return r=o,mo(0),Ue(r),wo(50),0===r&&(qe("Pending"),po("pending"),yo(null===Nr||void 0===Nr?void 0:Nr.uncoveredLength)),1===r&&(qe("Assigned"),po("accepted"),yo(null===Nr||void 0===Nr?void 0:Nr.assignedLength)),2===r&&(qe("Arrived"),po("arrived"),yo(null===Nr||void 0===Nr?void 0:Nr.arrivedLength)),3===r&&(qe("Picked"),po("picked"),yo(null===Nr||void 0===Nr?void 0:Nr.pickedLength)),4===r&&(qe("Active"),po("active"),yo(null===Nr||void 0===Nr?void 0:Nr.activeLength)),5===r&&(qe("Skipped"),po("skipped"),yo(null===Nr||void 0===Nr?void 0:Nr.skippedLength)),6===r&&(qe("Delivered"),po("delivered"),yo(null===Nr||void 0===Nr?void 0:Nr.coveredLength)),7===r&&(qe("Cancelled"),po("cancelled"),yo(null===Nr||void 0===Nr?void 0:Nr.cancelLength)),console.log(r),void Mo("");var r},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?t.color:Ce(t.color)),bgcolor:i?t.color:we(t.color),color:i?"#fff":t.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(ye(t.color)):"none",transition:"all 0.18s","&:hover":{borderColor:t.color,boxShadow:i?"0 6px 18px ".concat(ye(t.color)):"0 0 0 3px ".concat(ye(t.color))}},children:[(0,ae.jsx)(A.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":Se(t.color),color:i?"#fff":t.color},children:(0,ae.jsx)(n,{size:13})}),(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:t.label}),(0,ae.jsx)(w.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":t.color,border:i?"none":"1px solid ".concat(Ce(t.color))},children:l})]},e.status)}))}),(0,ae.jsx)(w.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,ae.jsx)(ne.A,{value:Do,onChange:Mo,onDebouncedChange:Lo,sx:{m:0,width:"100%",borderRadius:999,bgcolor:we("#6366f1"),"& fieldset":{borderColor:Ce("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye("#6366f1"))}}})})]})}),(0,ae.jsx)(b.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:xe/8,borderBottomRightRadius:xe/8,border:"1px solid",borderColor:Ae,overflow:"hidden",background:"#fff"},children:(0,ae.jsx)(R.A,{ref:r,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:t}=e.currentTarget;o+t>=r-50&&Lr&&!Ir&&Pr()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto",overflowX:"auto","&::-webkit-scrollbar":{width:"10px",height:"10px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:Ce("#6366f1"),borderRadius:"8px",cursor:"pointer","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:me}},children:((e,r,n)=>{const i="Cancelled"!==Je&&"Delivered"!==Je,s="Created"==Je,h=15+(i?1:0)+(s?1:0);return(0,ae.jsxs)(D.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,lg:1300,xl:1400}},children:[(0,ae.jsx)(M.A,{children:(0,ae.jsxs)(P.A,{sx:{"& th":{backgroundColor:me,color:fe,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Ae),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[s&&(0,ae.jsx)(L.A,{sx:{whiteSpace:"nowrap"},children:(0,ae.jsx)(I.A,{indeterminate:a.length>0&&a.length!=Kr.length,onChange:e=>{e.target.checked?ce([...Kr]):ce([])},checked:a.length>0&&a.length==Kr.length})}),(0,ae.jsx)(L.A,{children:"#"}),(0,ae.jsx)(L.A,{children:"Status"}),(0,ae.jsx)(L.A,{children:"Tenant"}),(0,ae.jsx)(L.A,{children:"Order / Location"}),(0,ae.jsx)(L.A,{children:"Pickup"}),(0,ae.jsx)(L.A,{children:"Drop"}),(0,ae.jsx)(L.A,{children:"Rider"}),(0,ae.jsx)(L.A,{children:"ETA"}),(0,ae.jsx)(L.A,{children:"Transit"}),(0,ae.jsx)(L.A,{children:"Kms"}),(0,ae.jsx)(L.A,{children:"Amount"}),(0,ae.jsx)(L.A,{children:"Notes"}),(0,ae.jsx)(L.A,{children:"Step"}),(0,ae.jsx)(L.A,{children:"Qty"}),(0,ae.jsx)(L.A,{children:"COD"}),i&&(0,ae.jsx)(L.A,{align:"right",children:"Action"})]})}),(Fo||zr)&&(0,ae.jsx)(le.r,{col:8}),(0,ae.jsxs)(z.A,{children:[0==Kr.length&&!Fo&&!Fr&&(0,ae.jsx)(P.A,{children:(0,ae.jsx)(L.A,{colSpan:h,sx:{py:6},children:(0,ae.jsxs)(m.A,{alignItems:"center",spacing:1.5,children:[(0,ae.jsx)(A.A,{sx:{width:64,height:64,bgcolor:Se("#94a3b8"),color:be},children:(0,ae.jsx)(u.gsJ,{size:28})}),(0,ae.jsx)(j.A,{variant:"subtitle1",sx:{fontWeight:700,color:ge},children:"No deliveries to show"}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:"all"===sr?"No ".concat(((null===(e=We[uo])||void 0===e?void 0:e.label)||Je).toLowerCase()," orders for this filter."):"No ".concat(((null===(r=We[uo])||void 0===r?void 0:r.label)||Je).toLowerCase()," orders in ").concat((null===(n=Me.find((e=>e.id===sr)))||void 0===n?void 0:n.label)||"this batch",".")})]})})}),0==Kr.length&&Fr&&(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(L.A,{colSpan:h,sx:{textAlign:"center",py:6},children:[(0,ae.jsx)(de.A,{}),(0,ae.jsx)(j.A,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"Loading deliveries\u2026"})]})}),Kr.map(((e,o)=>{var r,n,i,s,x,p,g,f;const A=We[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},v=A.icon,S=!!a.find((o=>o.orderheaderid==e.orderheaderid));return(0,ae.jsxs)(d.Fragment,{children:[(0,ae.jsxs)(P.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(ve),py:{xs:1,md:1.5},px:{xs:1,md:2}},backgroundColor:S?Se("#8b5cf6"):"transparent","&:hover":{backgroundColor:S?Se("#8b5cf6"):me}},children:["Created"==Je&&(0,ae.jsx)(L.A,{children:(0,ae.jsx)(I.A,{onChange:o=>{if(o.target.checked){let o=a;o.push((0,t.A)((0,t.A)({},e),{},{sno:a.length+1})),ce([...o])}else{if(a.find((o=>o.orderheaderid==e.orderheaderid))){let o=a,r=a.find((o=>o.orderheaderid==e.orderheaderid));o.splice(r.sno-1,1),o.map(((e,o)=>{e.sno=o+1})),ce([...o])}}console.log("list",a)},checked:a.find((o=>o.orderheaderid==e.orderheaderid))})}),(0,ae.jsx)(L.A,{children:(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:700,color:be},children:String(vo*jo+o+1).padStart(2,"0")})}),(0,ae.jsx)(L.A,{children:(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:we(A.color),border:"1px solid ".concat(Ce(A.color)),color:A.color},children:[(0,ae.jsx)(Ye,{color:A.color,size:20,children:(0,ae.jsx)(v,{size:12})}),(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:A.label})]})}),(0,ae.jsx)(L.A,{children:(0,ae.jsx)(T.A,{title:e.tenantadress,children:(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{noWrap:!0,variant:"subtitle2",sx:{fontWeight:700,color:ge},children:e.tenantname}),(0,ae.jsx)(j.A,{noWrap:!0,variant:"caption",sx:{color:fe},children:e.tenantsuburb}),(0,ae.jsx)(j.A,{noWrap:!0,variant:"caption",sx:{color:be},children:e.applocation})]})})}),(0,ae.jsxs)(L.A,{align:"left",children:[(0,ae.jsx)(T.A,{title:"Location Name-Suburb",placement:"top",children:(0,ae.jsx)(j.A,{variant:"subtitle1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,ae.jsxs)(m.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(T.A,{title:"Order Id",placement:"top",children:(0,ae.jsx)(j.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,ae.jsxs)(T.A,{title:"Ordered date",placement:"top",children:[(0,ae.jsx)(j.A,{noWrap:!0,sx:{fontSize:"12px"},children:c()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,ae.jsx)(j.A,{noWrap:!0,sx:{fontSize:"11px"},children:c()(e.orderdate).utc().format("hh:mm A")})]})]}),"-",(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(T.A,{title:"Delivery Id",placement:"top",children:(0,ae.jsx)(j.A,{variant:"body2",noWrap:!0,children:e.deliveryid})}),(0,ae.jsxs)(T.A,{title:"Delivery date",placement:"top",children:[(0,ae.jsx)(j.A,{noWrap:!0,sx:{fontSize:"12px"},children:c()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,ae.jsx)(j.A,{noWrap:!0,sx:{fontSize:"11px"},children:c()(e.deliverydate).utc().format("hh:mm A")})]})]})]})]}),(0,ae.jsx)(L.A,{align:"left",children:(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:700,color:ge,whiteSpace:"nowrap"},children:e.pickupcustomer}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:e.pickupcontactno}),(0,ae.jsx)(T.A,{title:e.Pickupaddress,sx:{whiteSpace:"nowrap"},children:(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be},children:e.pickuplocation||(e.Pickupaddress?e.Pickupaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,ae.jsx)(L.A,{align:"left",children:(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:700,color:ge,whiteSpace:"nowrap"},children:e.deliverycustomer}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:e.deliverycontactno}),(0,ae.jsx)(T.A,{title:e.deliveryaddress,children:(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be,whiteSpace:"nowrap"},children:e.deliverylocation||(e.deliveryaddress?e.deliveryaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,ae.jsx)(L.A,{children:e.ridername?(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,ae.jsx)(Ye,{color:"#8b5cf6",size:28,children:(0,ae.jsx)(u.bsz,{size:14})}),(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:700,color:ge},noWrap:!0,children:e.ridername}),(0,ae.jsxs)(j.A,{variant:"caption",sx:{color:fe},children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be,fontWeight:600},children:"Unassigned"})}),(0,ae.jsx)(L.A,{align:"left",children:(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:700,color:ge,whiteSpace:"nowrap"},children:e.expecteddeliverytime?c()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"})}),(0,ae.jsx)(L.A,{align:"left",children:(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:we("#06b6d4"),color:"#06b6d4",fontWeight:700,fontSize:12,border:"1px solid ".concat(Ce("#06b6d4"))},children:[e.transitminutes||0,"m"]})}),(0,ae.jsx)(L.A,{children:(0,ae.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(T.A,{title:"Planned KMS",placement:"top",children:(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:we("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(Ce("#ef4444")),whiteSpace:"nowrap",minWidth:75},children:[e.kms||0," km"]})}),(0,ae.jsx)(T.A,{title:"Actual KMS",placement:"top",children:(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:we("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(Ce("#10b981")),whiteSpace:"nowrap",minWidth:75},children:[e.cumulativekms||0," km"]})})]})}),(0,ae.jsx)(L.A,{align:"left",children:(0,ae.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(T.A,{title:"Delivery Charge",placement:"top",children:(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:we("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(Ce("#ef4444")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(n=null===(i=e.deliverycharges)||void 0===i?void 0:i.toFixed(2))&&void 0!==n?n:"0.00"]})}),(0,ae.jsx)(T.A,{title:"Delivery Amount",placement:"top",children:(0,ae.jsxs)(w.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:we("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(Ce("#10b981")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(s=null===(x=e.deliveryamt)||void 0===x?void 0:x.toFixed(2))&&void 0!==s?s:"0.00"]})})]})}),(0,ae.jsx)(L.A,{children:e.notes?(0,ae.jsx)(T.A,{title:e.notes,children:(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe,maxWidth:160,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.notes})}):(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be},children:"\u2014"})}),(0,ae.jsx)(L.A,{align:"center",children:e.step?(0,ae.jsx)(w.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:24,px:.875,borderRadius:999,bgcolor:we("#6366f1"),border:"1px solid ".concat(Ce("#6366f1")),color:"#6366f1",fontWeight:800,fontSize:11},children:e.step}):(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be},children:"\u2014"})}),(0,ae.jsx)(L.A,{children:(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:700,color:e.Quantity?ge:be,whiteSpace:"nowrap"},children:e.Quantity||"\u2014"})}),(0,ae.jsx)(L.A,{children:(0,ae.jsx)(j.A,{variant:"subtitle2",sx:{fontWeight:800,color:e.collectionamt?"#ef4444":be,whiteSpace:"nowrap"},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),"Cancelled"!==Je&&"Delivered"!==Je&&(0,ae.jsx)(L.A,{align:"right",children:(0,ae.jsxs)(m.A,{direction:"row",justifyContent:"flex-end",spacing:.75,children:["C"==e.deliverytype&&(0,ae.jsx)(T.A,{title:"Product details",placement:"top",children:(0,ae.jsx)(Y.A,{size:"small",onClick:()=>{(null===Co||void 0===Co?void 0:Co.orderid)===e.orderid?(ko(null),Ro(null)):(ko(e),Ro(e.orderheaderid))},sx:{borderRadius:999,bgcolor:we("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(Ce("#06b6d4")),"&:hover":{bgcolor:Se("#06b6d4")}},children:(null===Co||void 0===Co?void 0:Co.orderid)===e.orderid?(0,ae.jsx)(oe.A,{fontSize:"small"}):(0,ae.jsx)(re.A,{fontSize:"small"})})}),(0,ae.jsx)(T.A,{title:"Actions",placement:"top",children:(0,ae.jsx)(Y.A,{size:"small",onClick:o=>((e,o)=>{Yo(o),console.log("selectedRow",o),zo(e.currentTarget)})(o,e),sx:{borderRadius:999,bgcolor:we("#6366f1"),color:"#6366f1",border:"1px solid ".concat(Ce("#6366f1")),"&:hover":{bgcolor:Se("#6366f1")}},children:(0,ae.jsx)(l.A,{})})}),(0,ae.jsxs)(F.A,{anchorEl:Io,open:cr,onClose:hr,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{elevation:0,sx:{minWidth:220,borderRadius:2,mt:.75,border:"1px solid",borderColor:Ae,boxShadow:pe,overflow:"hidden","& .MuiMenuItem-root":{fontSize:13,fontWeight:600,py:1.1,px:1.5,gap:1,transition:"background-color 0.15s","&:hover":{bgcolor:me}}}},children:["delivered"!==(null===To||void 0===To?void 0:To.orderstatus)&&(0,ae.jsxs)(K.A,{onClick:()=>{jr.mutate(To.userfcmtoken),hr()},children:[(0,ae.jsx)(Ye,{color:"#0ea5e9",size:22,children:(0,ae.jsx)(u.q53,{size:13})}),"Notify Rider"]}),["pending","accepted","arrived"].includes(null===To||void 0===To?void 0:To.orderstatus)&&(0,ae.jsxs)(K.A,{onClick:()=>{var e;if(!Ke)return Sr("Please select a location first!","warning"),void(null===(e=bo.current)||void 0===e||e.focus());Zo(!0),hr()},children:[(0,ae.jsx)(Ye,{color:"#8b5cf6",size:22,children:(0,ae.jsx)(u.bsz,{size:13})}),"Change Rider"]}),(1==ar||2==ar)&&(0,ae.jsxs)(K.A,{onClick:()=>{$e(To.kms),oo(To.cumulativekms),co(To.droplat),xo(To.droplon),io(To.notes),to(To.deliveryamount),fo(To.orderstatus||"delivered"),so(To),je(!0),hr()},children:[(0,ae.jsx)(Ye,{color:"#10b981",size:22,children:(0,ae.jsx)(u.mU9,{size:13})}),"Update Status"]}),"cancelled"!==(null===To||void 0===To?void 0:To.orderstatus)&&"delivered"!==(null===To||void 0===To?void 0:To.orderstatus)&&(0,ae.jsxs)(K.A,{sx:{color:"#ef4444 !important"},onClick:()=>{Jo(!0),hr()},children:[(0,ae.jsx)(Ye,{color:"#ef4444",size:22,children:(0,ae.jsx)(u.uDv,{size:13})}),"Cancel Delivery"]})]})]})})]}),(null===Co||void 0===Co?void 0:Co.orderid)===(null===e||void 0===e?void 0:e.orderid)&&(0,ae.jsx)(P.A,{children:(0,ae.jsx)(L.A,{colSpan:h,sx:{p:0,border:0,backgroundColor:me},children:(0,ae.jsx)(E.A,{in:!0,timeout:"auto",unmountOnExit:!0,children:(0,ae.jsx)(w.A,{sx:{width:"100%",p:2.5},children:(0,ae.jsxs)(b.A,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:Ae,overflow:"hidden",background:"#fff"},children:[(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,borderBottom:"1px solid ".concat(ve),bgcolor:we("#6366f1")},children:[(0,ae.jsx)(Ye,{color:"#6366f1",children:(0,ae.jsx)(u.gsJ,{size:14})}),(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#6366f1"},children:"Product Details"})]}),(0,ae.jsxs)(D.A,{size:"small",sx:{minWidth:800},children:[(0,ae.jsx)(M.A,{children:(0,ae.jsxs)(P.A,{sx:{"& th":{fontSize:11,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:fe,borderBottom:"1px solid ".concat(ve)},"&:hover":{backgroundColor:"transparent !important"}},children:[(0,ae.jsx)(L.A,{children:"#"}),(0,ae.jsx)(L.A,{children:"Product"}),(0,ae.jsx)(L.A,{children:"Description"}),(0,ae.jsx)(L.A,{align:"right",children:"Qty"}),(0,ae.jsx)(L.A,{align:"right",children:"Cost"}),(0,ae.jsx)(L.A,{align:"right",children:"Price"}),(0,ae.jsx)(L.A,{align:"right",children:"Tax"}),(0,ae.jsx)(L.A,{align:"right",children:"Amount"})]})}),(0,ae.jsxs)(z.A,{children:[null===yr||void 0===yr||null===(p=yr.details)||void 0===p?void 0:p.map(((e,o)=>{var r,t;return(0,ae.jsxs)(P.A,{sx:{"&:hover":{backgroundColor:me+" !important"}},children:[(0,ae.jsx)(L.A,{sx:{color:be,fontWeight:700},children:String(o+1).padStart(2,"0")}),(0,ae.jsx)(L.A,{children:(0,ae.jsxs)(m.A,{direction:"row",spacing:1.25,alignItems:"center",children:[(0,ae.jsx)(w.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(ve)}}),(0,ae.jsx)(j.A,{variant:"body2",sx:{fontWeight:600,color:ge},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"})]})}),(0,ae.jsx)(L.A,{sx:{color:fe},children:(null===e||void 0===e?void 0:e.productdescription)||"-"}),(0,ae.jsx)(L.A,{align:"right",sx:{fontWeight:700},children:(null===e||void 0===e?void 0:e.orderqty)||0}),(0,ae.jsxs)(L.A,{align:"right",children:["\u20b9 ",(null===e||void 0===e?void 0:e.price)||0]}),(0,ae.jsxs)(L.A,{align:"right",children:["\u20b9 ",(null!==(r=null===e||void 0===e?void 0:e.productsumprice)&&void 0!==r?r:0).toFixed(2)]}),(0,ae.jsxs)(L.A,{align:"right",children:["\u20b9 ",(null!==(t=null===e||void 0===e?void 0:e.taxamount)&&void 0!==t?t:0).toFixed(2)]}),(0,ae.jsxs)(L.A,{align:"right",sx:{fontWeight:800,color:ge},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o)})),(0,ae.jsxs)(P.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,ae.jsx)(L.A,{align:"right",colSpan:7,sx:{fontWeight:700,color:fe,borderTop:"1px solid ".concat(ve)},children:"Total Amount"}),(0,ae.jsxs)(L.A,{align:"right",sx:{fontWeight:800,color:"#10b981",borderTop:"1px solid ".concat(ve)},children:["\u20b9 ",null===yr||void 0===yr||null===(g=yr.pricedetails)||void 0===g||null===(f=g.orderamount)||void 0===f?void 0:f.toFixed(2)]})]})]})]})]})})})})})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Yr||void 0===Yr?void 0:Yr.length)&&(0,ae.jsx)(P.A,{children:(0,ae.jsx)(L.A,{colSpan:h,rowSpan:3,children:(0,ae.jsx)("div",{ref:o,style:{height:40,textAlign:"center"},children:Ir||Lr?(0,ae.jsx)(de.A,{}):(0,ae.jsx)(j.A,{variant:"caption",sx:{color:be,fontWeight:600},children:"\xb7 End of list \xb7"})})})})]})]})})()})}),(0,ae.jsxs)(O.A,{open:Bo,onClose:()=>Jo(!1),maxWidth:"xs",fullWidth:!0,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:Ae,boxShadow:pe,overflow:"hidden"}},children:[(0,ae.jsx)(w.A,{sx:{height:4,background:"linear-gradient(90deg, #ef4444 0%, ".concat(Se("#ef4444")," 100%)")}}),(0,ae.jsx)(N.A,{sx:{p:3.5},children:(0,ae.jsxs)(m.A,{alignItems:"center",spacing:2.5,children:[(0,ae.jsx)(A.A,{sx:{width:64,height:64,bgcolor:Se("#ef4444"),color:"#ef4444"},children:(0,ae.jsx)(s.A,{style:{fontSize:28}})}),(0,ae.jsxs)(m.A,{spacing:.5,alignItems:"center",children:[(0,ae.jsx)(j.A,{variant:"h4",sx:{fontWeight:800,color:ge},children:"Cancel Delivery?"}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe,textAlign:"center",px:1},children:"This action will cancel the delivery and notify the rider. Please share a brief reason."})]}),(0,ae.jsx)(W.A,{fullWidth:!0,placeholder:"Reason for cancellation",multiline:!0,minRows:2,maxRows:4,onChange:e=>Go(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:me,"& fieldset":{borderColor:Ae},"&:hover fieldset":{borderColor:"#ef4444"},"&.Mui-focused fieldset":{borderColor:"#ef4444",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye("#ef4444"))}}}}),(0,ae.jsxs)(m.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,ae.jsx)(H.A,{fullWidth:!0,onClick:()=>Jo(!1),variant:"outlined",sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:Ae,color:fe,"&:hover":{borderColor:be,bgcolor:me}},children:"Keep Delivery"}),(0,ae.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{""==Uo?Sr("Enter FeedBack","error"):xr({selectedRow:To,cancelFeed:Uo}),(async()=>{console.log("cancelridernotification",To);try{return(await h.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:To.userfcmtoken,notification:{title:"NearleXpress",body:"".concat(To.orderid," have been Cancelled"),sound:"ring",image:""},data:{type:"cancel"}})).data}catch(e){Sr(e.message,"error",2e3),console.log(e)}})()},autoFocus:!0,sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#ef4444",boxShadow:"0 6px 18px ".concat(ye("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,ae.jsxs)(O.A,{open:qo,onClose:()=>Zo(!1),maxWidth:"sm",fullWidth:!0,TransitionComponent:q.s,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:Ae,boxShadow:pe,overflow:"hidden"}},children:[(0,ae.jsx)(w.A,{sx:{height:4,background:"linear-gradient(90deg, #8b5cf6 0%, ".concat(Se("#8b5cf6")," 100%)")}}),(0,ae.jsx)(B.A,{sx:{p:3,pb:1.5},children:(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,ae.jsx)(A.A,{sx:{width:44,height:44,bgcolor:Se("#8b5cf6"),color:"#8b5cf6"},children:(0,ae.jsx)(u.bsz,{size:22})}),(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"h4",sx:{fontWeight:800,color:ge},children:"Change Rider"}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:"Assign this delivery to a different rider"})]})]})}),(0,ae.jsx)(N.A,{sx:{p:3,pt:2},children:(0,ae.jsx)(C.A,{fullWidth:!0,options:Zr,PaperComponent:Te,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),onChange:(e,o)=>{Qo(o),n.A.debug("Rider selected in dropdown:",o?"".concat(o.firstname," ").concat(o.lastname):"None")},renderInput:e=>(0,ae.jsx)(W.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,ae.jsx)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,ae.jsx)(Ye,{color:"#8b5cf6",children:(0,ae.jsx)(u.bsz,{size:14})})})}),sx:ke("#8b5cf6")}))})}),(0,ae.jsx)(J.A,{sx:{p:3,pt:1},children:(0,ae.jsxs)(m.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,ae.jsx)(H.A,{fullWidth:!0,variant:"outlined",onClick:()=>Zo(!1),sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:Ae,color:fe,"&:hover":{borderColor:be,bgcolor:me}},children:"Cancel"}),(0,ae.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{Ko(!0),n.A.info("Initiating rider assignment change for order ID ".concat(null===To||void 0===To?void 0:To.orderid," to rider: ").concat(null===Vo||void 0===Vo?void 0:Vo.firstname," ").concat(null===Vo||void 0===Vo?void 0:Vo.lastname)),wr.mutate({selectedRider:Vo,selectedRow:To})},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#8b5cf6",boxShadow:"0 6px 18px ".concat(ye("#8b5cf6")),"&:hover":{bgcolor:"#7c3aed"}},children:"Change Rider"})]})})]}),(0,ae.jsxs)(O.A,{open:Ge,onClose:()=>Ve(!1),PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:Ae,boxShadow:pe,overflow:"hidden"}},children:[(0,ae.jsx)(w.A,{sx:{height:4,background:"linear-gradient(90deg, #f59e0b 0%, ".concat(Se("#f59e0b")," 100%)")}}),(0,ae.jsx)(B.A,{align:"left",sx:{p:3,pb:1.5},children:(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,ae.jsx)(A.A,{sx:{width:44,height:44,bgcolor:Se("#f59e0b"),color:"#f59e0b"},children:(0,ae.jsx)(u.tjE,{size:22})}),(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"h4",sx:{fontWeight:800,color:ge},children:"Date Range"}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:"Pick a window to filter the deliveries"})]})]})}),(0,ae.jsx)(N.A,{sx:{width:"100%"},className:"datedialog",children:(0,ae.jsx)($.U,{open:Ge,toggle:()=>Ve(!Ge),id:"daterange1",onChange:e=>{"All"===e.label?(Ne(""),Be(""),Ve(!1)):(Ne(c()(e.startDate).format("YYYY-MM-DD")),Be(c()(e.endDate).format("YYYY-MM-DD")),e.label?Xe(e.label):Xe("")),console.log(e)},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,Z.A)(new Date,-1),endDate:(0,Z.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,Z.A)(new Date,1),endDate:(0,Z.A)(new Date,1)},{label:"This Week",startDate:(0,U.A)(new Date),endDate:(0,G.A)(new Date)},{label:"Last Week",startDate:(0,U.A)((0,V.A)(new Date,-1)),endDate:(0,G.A)((0,V.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,V.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,Q.A)(new Date),endDate:(0,X.A)(new Date)},{label:"Last Month",startDate:(0,Q.A)((0,_.A)(new Date,-1)),endDate:(0,X.A)((0,_.A)(new Date,-1))}]})}),(0,ae.jsx)(m.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2.5,pt:1},children:(0,ae.jsx)(H.A,{variant:"contained",onClick:()=>{Ve(!1)},sx:{borderRadius:999,px:3,py:1,fontWeight:800,bgcolor:"#f59e0b",boxShadow:"0 6px 18px ".concat(ye("#f59e0b")),"&:hover":{bgcolor:"#d97706"}},children:"Apply"})})]}),(0,ae.jsxs)(O.A,{fullWidth:!0,open:he,onClose:Cr,scroll:"paper",maxWidth:"sm",TransitionComponent:q.s,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:Ae,boxShadow:pe,overflow:"hidden"}},children:[(0,ae.jsx)(w.A,{sx:{height:4,background:"linear-gradient(90deg, #10b981 0%, ".concat(Se("#10b981")," 100%)")}}),(0,ae.jsx)(B.A,{sx:{p:3,pb:1.5},children:(0,ae.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,ae.jsx)(A.A,{sx:{width:44,height:44,bgcolor:Se("#10b981"),color:"#10b981"},children:(0,ae.jsx)(u.mU9,{size:22})}),(0,ae.jsxs)(m.A,{children:[(0,ae.jsx)(j.A,{variant:"h4",sx:{fontWeight:800,color:ge},children:"Update Delivery Status"}),(0,ae.jsx)(j.A,{variant:"caption",sx:{color:fe},children:null!==lo&&void 0!==lo&&lo.orderid?"Order #".concat(lo.orderid):"Modify delivery details"})]})]})}),(0,ae.jsx)(N.A,{dividers:!0,sx:{p:3,bgcolor:me},children:(0,ae.jsxs)(S.Ay,{container:!0,spacing:2,children:[[{label:"KMs",value:_e,set:e=>$e(e),color:"#ef4444"},{label:"Actual KMs",value:eo,set:e=>oo(+e),color:"#10b981"},{label:"Delivery Latitude",value:ao,set:e=>co(e),color:"#06b6d4"},{label:"Delivery Longitude",value:ho,set:e=>xo(e),color:"#06b6d4"}].map((e=>(0,ae.jsxs)(S.Ay,{item:!0,xs:12,sm:6,children:[(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:700,color:fe,letterSpacing:.5,textTransform:"uppercase"},children:e.label}),(0,ae.jsx)(W.A,{fullWidth:!0,value:e.value,type:"number",onChange:o=>e.set(o.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:Ae},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye(e.color))}}}})]},e.label))),(0,ae.jsxs)(S.Ay,{item:!0,xs:12,children:[(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:700,color:fe,letterSpacing:.5,textTransform:"uppercase"},children:"Amount"}),(0,ae.jsx)(W.A,{fullWidth:!0,type:"number",value:ro,onChange:e=>to(+e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:Ae},"&:hover fieldset":{borderColor:"#10b981"},"&.Mui-focused fieldset":{borderColor:"#10b981",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye("#10b981"))}}}})]}),(0,ae.jsxs)(S.Ay,{item:!0,xs:12,children:[(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:700,color:fe,letterSpacing:.5,textTransform:"uppercase"},children:"Status"}),(0,ae.jsx)(W.A,{select:!0,fullWidth:!0,value:go,onChange:e=>fo(e.target.value),SelectProps:{MenuProps:{PaperProps:{sx:{borderRadius:2,mt:.5,boxShadow:pe}}}},sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:Ae},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye("#6366f1"))}}},children:["pending","accepted","started","arrived","delivered","cancelled"].map((e=>{const o=We[e]||{label:e,color:"#6366f1",icon:u.bfP},r=o.icon;return(0,ae.jsxs)(K.A,{value:e,sx:{gap:1},children:[(0,ae.jsx)(Ye,{color:o.color,size:22,children:(0,ae.jsx)(r,{size:13})}),o.label]},e)}))})]}),(0,ae.jsxs)(S.Ay,{item:!0,xs:12,children:[(0,ae.jsx)(j.A,{variant:"caption",sx:{fontWeight:700,color:fe,letterSpacing:.5,textTransform:"uppercase"},children:"Notes"}),(0,ae.jsx)(W.A,{value:no,fullWidth:!0,multiline:!0,minRows:2,onChange:e=>io(e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:Ae},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ye("#6366f1"))}}}})]})]})}),(0,ae.jsx)(J.A,{sx:{p:3},children:(0,ae.jsxs)(m.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,ae.jsx)(H.A,{fullWidth:!0,variant:"outlined",onClick:Cr,sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:Ae,color:fe,"&:hover":{borderColor:be,bgcolor:me}},children:"Close"}),(0,ae.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{_e?eo?ao?ho?ro?Qr.mutate({deliveryid:lo.deliveryid,orderheaderid:lo.orderheaderid,orderstatus:go,deliverytime:c()().format("YYYY-MM-DD HH:mm:ss"),deliverylat:ao,deliverylong:ho,kms:_e,cumulativekms:eo,deliveryamt:parseFloat(ro),notes:no,userid:+To.userid}):Sr("Fill Delivery Amount","warning"):Sr("Fill Delivery Longitude","warning"):Sr("Fill Delivery Latitude","warning"):Sr("Fill Actual Kms","warning"):Sr("Fill Kms","warning")},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#10b981",boxShadow:"0 6px 18px ".concat(ye("#10b981")),"&:hover":{bgcolor:"#059669"}},children:"Update"})]})})]})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var t=r(89379),n=r(9950),i=r(2660),l=r(2046),s=r(83274),d=r(25333),a=r(97125),c=r(7762),h=r(52097),x=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const b=(0,n.useRef)(null),[A]=(0,h.d7)(o,p);return(0,n.useEffect)((()=>{u&&u(A)}),[A,u]),(0,n.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=b.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,x.jsx)(i.A,{sx:(0,t.A)({},f),inputRef:b,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,x.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,x.jsx)(a.A,{})}),endAdornment:(0,x.jsx)(s.A,{title:"Clear",children:(0,x.jsx)(d.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,x.jsx)(c.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var t=r(16491),n=r(46639),i=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(t.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(n.A,{size:o}),(0,l.jsx)(t.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:i,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>x});var t=r(89379),n=r(9950),i=r(93230),l=r(41413),s=r(77922),d=r(29925),a=r(26910),c=r(31222),h=r(44414);const x=(0,n.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:x,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:b=!1,accentColor:A="#6366f1",icon:v,placeholder:m="Select Zone",paperComponent:j}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(A).concat(e),C=y("08"),k=y("26"),W=y("55"),R=y("18"),D=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:A},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(k)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:A}}:{},M=b&&(0,h.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,h.jsx)(l.A,{sx:{width:24,height:24,bgcolor:R,color:A,transition:"background-color 0.15s, color 0.15s"},children:v||(0,h.jsx)(c.HPi,{size:14})})});return(0,h.jsx)(s.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:j,sx:(0,t.A)({},p),onChange:(e,o,t)=>{"clear"===t?(null===r||void 0===r||r(0),null===x||void 0===x||x(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===x||void 0===x||x(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>b?(0,h.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,placeholder:m,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:M}),sx:(0,t.A)((0,t.A)({},D),f||g||{})})):(0,h.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,t.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},96646:(e,o,r)=>{r.d(o,{r:()=>d});var t=r(9213),n=r(21671),i=r(82917),l=r(93230),s=r(44414);const d=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(t.A,{children:[(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,s.jsx)(n.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(i.A,{variant:"text",width:100}),(0,s.jsx)(i.A,{variant:"text",width:80})]})},o))),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:150})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(n.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/2851.b582cabe.chunk.js b/build/static/js/2851.b582cabe.chunk.js new file mode 100644 index 0000000..1f49972 --- /dev/null +++ b/build/static/js/2851.b582cabe.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2851],{22851:(e,o,r)=>{r.r(o),r.d(o,{default:()=>Ke});var t=r(89379),n=r(85571),i=r(8881),l=r(24513),s=r(36256),d=r(9950),c=r(4159),a=r.n(c),x=r(26910),h=r(14857),u=r(31222),p=r(51778),g=r(36150),f=r(60010),b=r(2235),v=r(41413),A=r(47223),m=r(55158),j=r(93230),w=r(82053),S=r(16491),y=r(60899),C=r(82917),W=r(77922),k=r(25277),R=r(29925),z=r(1320),D=r(93038),I=r(25333),P=r(15769),L=r(69780),M=r(9213),Y=r(21671),T=r(34075),F=r(83274),E=r(33738),K=r(17239),O=r(23266),N=r(96583),H=r(28170),B=r(82223),J=r(40033),q=r(79739),Z=r(37476),U=r(56712),G=r(81417),V=r(96600),Q=r(53132),X=r(94289),_=r(57326),$=r(50624),ee=r(55916),oe=r(52351),re=r(67562),te=r(49883),ne=r(81425),ie=r(56311),le=r(20466),se=r(96646),de=r(59212),ce=r(58691),ae=r(23787),xe=r(44414),he=r(36220);a().extend(he);const ue=999,pe=16,ge="0 8px 24px rgba(15, 23, 42, 0.08)",fe="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",Ae="#94a3b8",me="#e2e8f0",je="#f1f5f9",we="#f8fafc",Se=(e,o)=>"".concat(e).concat(o),ye=e=>Se(e,"08"),Ce=e=>Se(e,"18"),We=e=>Se(e,"26"),ke=e=>Se(e,"55"),Re=e=>({cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:ue+"px",bgcolor:ye(e),fontWeight:600,color:be,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:ke(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e}}),ze={pending:{label:"Pending",color:"#f59e0b",icon:u.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:u.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:u.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:u.gsJ},active:{label:"Active",color:"#14b8a6",icon:u.pk7},skipped:{label:"Skipped",color:"#f97316",icon:u.ivF},delivered:{label:"Delivered",color:"#10b981",icon:u.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:u.uDv}},De=[{status:"pending",countKey:"uncoveredLength"},{status:"accepted",countKey:"assignedLength"},{status:"arrived",countKey:"arrivedLength"},{status:"picked",countKey:"pickedLength"},{status:"active",countKey:"activeLength"},{status:"skipped",countKey:"skippedLength"},{status:"delivered",countKey:"coveredLength"},{status:"cancelled",countKey:"cancelLength"}],Ie=[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:u.F6S},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:u.tX0},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:u.mU9},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:u.uDv}],Pe=[{id:"all",label:"All Batches",range:"Across the day",color:"#7c3aed",iconKey:"all"},{id:"morning",label:"Morning Batch",range:"12 AM to 8 AM",color:"#0ea5e9",iconKey:"morning",startHour:0,endHour:8},{id:"afternoon",label:"Afternoon Batch",range:"9 AM to 12:30 PM",color:"#f59e0b",iconKey:"afternoon",startHour:9,endHour:12.5},{id:"evening",label:"Evening Batch",range:"4 PM to 7 PM",color:"#6366f1",iconKey:"evening",startHour:16,endHour:19}],Le={all:u.lB9,morning:u.N3N,afternoon:u.aSE,evening:u.giK},Me=()=>{const e=a()(),o=e.hour()+e.minute()/60;for(const r of Pe)if("all"!==r.id&&o>=r.startHour&&o{let o=null;for(const i of Ye)if(null!==e&&void 0!==e&&e[i]){o=e[i];break}if(!o)return null;const r=String(o).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(r))return null;const t=a()(o);if(!t.isValid())return null;const n=t.hour()+t.minute()/60;for(const i of Pe)if("all"!==i.id&&n>=i.startHour&&n(0,xe.jsx)(b.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:fe,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Ee=e=>{let{color:o,selected:r,size:t=24,children:n}=e;return(0,xe.jsx)(v.A,{sx:{width:t,height:t,bgcolor:r?o:Ce(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:n})},Ke=()=>{const e=localStorage.getItem("userid"),o=(0,h.A)(),r=(0,A.A)(o.breakpoints.down("md")),c=(0,d.useRef)(),he=(0,d.useRef)(),[ue,Se]=(0,d.useState)([]),[Ye,Ke]=(0,d.useState)(!1),[Oe,Ne]=(0,d.useState)("All"),[He,Be]=(0,d.useState)(0),[Je,qe]=(0,d.useState)(a()().format("YYYY-MM-DD")),[Ze,Ue]=(0,d.useState)(a()().format("YYYY-MM-DD")),[Ge,Ve]=(0,d.useState)("Pending"),[Qe,Xe]=(0,d.useState)(0),[_e,$e]=(0,d.useState)(!1),[eo,oo]=(0,d.useState)("Today"),[ro,to]=(0,d.useState)(""),[no,io]=(0,d.useState)(),[lo,so]=(0,d.useState)(),[co,ao]=(0,d.useState)(""),[xo,ho]=(0,d.useState)({}),[uo,po]=(0,d.useState)(""),[go,fo]=(0,d.useState)(""),[bo,vo]=(0,d.useState)("pending"),[Ao,mo]=(0,d.useState)("delivered"),jo=(0,d.useRef)(null),wo=(0,d.useRef)(null),[So,yo]=d.useState(0),[Co,Wo]=d.useState(50),[ko,Ro]=d.useState(),[zo,Do]=(0,d.useState)(null),[Io,Po]=(0,d.useState)(null),[Lo,Mo]=(0,d.useState)(""),[Yo,To]=(0,d.useState)(""),[Fo,Eo]=d.useState(null),[Ko,Oo]=(0,d.useState)(null),[No,Ho]=(0,d.useState)(!1),[Bo,Jo]=d.useState(null),[qo,Zo]=(0,d.useState)(""),[Uo,Go]=(0,d.useState)(!1),[Vo,Qo]=(0,d.useState)(!1),[Xo,_o]=(0,d.useState)(""),[$o,er]=(0,d.useState)(null),[or,rr]=(0,d.useState)(0),[tr,nr]=(0,d.useState)(0),[ir,lr]=(0,d.useState)(null),[sr,dr]=(0,d.useState)(null),[cr,ar]=(0,d.useState)(0),[xr,hr]=(0,d.useState)(Me),ur=localStorage.getItem("roleid");(0,d.useEffect)((()=>{rr(0),lr(null),nr(0),dr(null)}),[He]),(0,d.useEffect)((()=>{nr(0),dr(null)}),[or]);const pr=Boolean(Fo),gr=(e,o)=>{Oo(o),console.log("selectedRow",o),Eo(e.currentTarget)},fr=()=>{Eo(null)},{mutate:br}=(0,p.n)({mutationFn:e=>{let{selectedRow:o,cancelFeed:r}=e;return(0,ne.zF)(o,r)},onSuccess:()=>{Rr("Delivery Cancelled Successfully","success"),Go(!1),Qr(),Mr(),Or()},onError:e=>{Rr(e.message,"error")}}),{data:vr,isLoading:Ar,isError:mr,error:jr}=(0,g.I)({queryKey:["tenantlist",He],queryFn:()=>(0,ne.Mn)(He),enabled:0!==He}),{data:wr,isLoading:Sr,isError:yr,error:Cr}=(0,g.I)({queryKey:["gettenantlocations",or],queryFn:()=>(0,ne.DL)(or),enabled:0!==or}),Wr=(0,p.n)({mutationFn:ne.k3,onSuccess:()=>{(0,i.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},onError:e=>{(0,i.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}}),kr=(0,p.n)({mutationFn:e=>{let{selectedRider:o,selectedRow:r}=e;return(0,ne.R_)(o,r)},onSuccess:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;Ho(!1),Qo(!1),"Success"===e.data.message&&(n.A.info("Rider changed successfully for order ID ".concat(null===t||void 0===t?void 0:t.orderid,". New Rider: ").concat(null===r||void 0===r?void 0:r.firstname," ").concat(null===r||void 0===r?void 0:r.lastname)),Rr("Rider Changed Successfully","success")),Qr(),Mr(),Or(),Wr.mutate(r.userfcmtoken)},onError:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;n.A.error("Failed to change rider for order ID ".concat(null===t||void 0===t?void 0:t.orderid,":"),e),Rr(e.message,"error"),Ho(!1)}}),Rr=(e,o)=>{(0,i.M8)(e,{variant:o,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},{data:zr}=(0,g.I)({queryKey:["orderdetails",Io],queryFn:()=>(0,ne.z3)(Io),enabled:!!Io}),Dr=()=>{Ke(!1)},{isLoading:Ir,isError:Pr,error:Lr,refetch:Mr}=(0,f.q)({queryKey:["fetchdeliveries",He,e,bo,Je,Ze,Co,Yo,or,tr,cr],queryFn:ne.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),{data:Yr,fetchNextPage:Tr,hasNextPage:Fr,isFetchingNextPage:Er,isLoading:Kr,refetch:Or}=(0,f.q)({queryKey:["fetchdeliveries-batchcounts",He,e,"all",Je,Ze,200,"",or,tr,cr],queryFn:ne.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),Nr=(0,d.useMemo)((()=>((null===Yr||void 0===Yr?void 0:Yr.pages)||[]).flatMap((e=>e.rows||[]))),[Yr]);(0,d.useEffect)((()=>{Fr&&!Er&&Tr()}),[Fr,Er,Tr,Nr.length]);const Hr=Fr||Er,Br=(0,d.useMemo)((()=>{const e=String(bo||"").toLowerCase(),o=String(Yo||"").trim().toLowerCase();return Nr.filter((r=>{if("all"!==xr&&Te(r)!==xr)return!1;const t=String(r.orderstatus||"").toLowerCase();if(e&&t!==e)return!1;if(o){if(![r.deliverycustomer,r.deliveryaddress,r.deliverysuburb,r.pickupcustomer,r.pickupaddress,r.pickupsuburb,r.orderid,r.tenantname,r.ridername,r.username].map((e=>String(e||"").toLowerCase())).join(" ").includes(o))return!1}return!0}))}),[Nr,xr,bo,Yo]),Jr=(0,d.useMemo)((()=>{const e={uncoveredLength:0,assignedLength:0,arrivedLength:0,pickedLength:0,activeLength:0,skippedLength:0,coveredLength:0,cancelLength:0};return Nr.forEach((o=>{if("all"!==xr&&Te(o)!==xr)return;switch(String(o.orderstatus||"").toLowerCase()){case"pending":e.uncoveredLength+=1;break;case"accepted":case"assigned":e.assignedLength+=1;break;case"arrived":e.arrivedLength+=1;break;case"picked":e.pickedLength+=1;break;case"active":e.activeLength+=1;break;case"skipped":e.skippedLength+=1;break;case"delivered":e.coveredLength+=1;break;case"cancelled":case"canceled":e.cancelLength+=1}})),e}),[Nr,xr]),qr=(0,d.useMemo)((()=>{const e={all:0};return Pe.forEach((o=>{"all"!==o.id&&(e[o.id]=0)})),Nr.forEach((o=>{const r=Te(o);r&&(e[r]=(e[r]||0)+1,e.all+=1)})),e}),[Nr]);(0,d.useEffect)((()=>{if(!Fr)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Tr()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return c.current&&e.observe(c.current),()=>{c.current&&e.unobserve(c.current)}}),[Fr,Tr]);const{data:Zr={},isLoading:Ur,isError:Gr,error:Vr,refetch:Qr}=(0,g.I)({queryKey:["fetchCountData",He,e,Je,Ze,Co,Yo,or,tr,cr,Ge],queryFn:()=>(0,ne.qB)(He,e,Je,Ze,Co,Yo,or,tr,cr)});(0,d.useEffect)((()=>{console.log("countData",Zr),0===Qe&&Zr&&Ro(Zr.uncoveredLength)}),[Zr]);const{data:Xr=[],isLoading:_r,isError:$r,error:et}=(0,g.I)({queryKey:["ridersList",He],queryFn:ne.Sd,enabled:Boolean(He),onError:e=>{(0,le.k)(e.message,"error",2e3)}}),ot=(0,p.n)({mutationFn:e=>(0,ne.wT)(e),onSuccess:e=>{console.log(e),e.data.status&&(Rr("Updated Successfully","success"),so(""),ao(""),Ke(!1),Mr(),Qr(),Or())},onError:e=>{console.log(e),Rr(e.message,"success")}}),rt=Pr?"Error fetching deliveries: ".concat(null===Lr||void 0===Lr?void 0:Lr.message):Gr?"Error fetching count summary: ".concat(null===Vr||void 0===Vr?void 0:Vr.message):$r?"Error fetching riders: ".concat(null===et||void 0===et?void 0:et.message):mr?"Error tenant list: ".concat(null===jr||void 0===jr?void 0:jr.message):yr?"Error location list: ".concat(null===Cr||void 0===Cr?void 0:Cr.message):null;return rt?(console.log("errorMessage",rt),(0,le.k)(rt,"error",2e3),null):(0,xe.jsxs)(xe.Fragment,{children:[(Ur||Kr||Ar||Sr||_r)&&(0,xe.jsx)(xe.Fragment,{children:(0,xe.jsx)(oe.A,{})}),(0,xe.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Ur||Ir||Ar||Sr||_r}),(0,xe.jsx)(b.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"linear-gradient(135deg, ".concat(ye("#6366f1")," 0%, ").concat(ye("#0ea5e9")," 100%)"),boxShadow:ge},children:(0,xe.jsxs)(j.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,xe.jsx)(v.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,xe.jsx)(u.F6S,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Deliveries"}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,xe.jsx)(S.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve,fontWeight:600},children:["Live \xb7 ",Oe||"All Zones"]})]})]})]}),(0,xe.jsx)(de.A,{ref:jo,locaName:Oe,setAppId:Be,setLocoName:Ne,setPage:yo,pill:!0,accentColor:"#6366f1",icon:(0,xe.jsx)(u.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Fe,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,xe.jsx)(y.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:[(0,t.A)((0,t.A)({},Ie[0]),{},{value:qr.all,percentage:null}),(0,t.A)((0,t.A)({},Ie[1]),{},{value:null===Zr||void 0===Zr?void 0:Zr.uncoveredLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.uncoveredLength/Zr.total*100):0}),(0,t.A)((0,t.A)({},Ie[2]),{},{value:null===Zr||void 0===Zr?void 0:Zr.coveredLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.coveredLength/Zr.total*100):0}),(0,t.A)((0,t.A)({},Ie[3]),{},{value:null===Zr||void 0===Zr?void 0:Zr.cancelLength,percentage:null!==Zr&&void 0!==Zr&&Zr.total?Math.round(Zr.cancelLength/Zr.total*100):0})].map((e=>{var o;const r=e.icon,t="number"===typeof e.percentage?e.percentage:Number(e.percentage),n=!Number.isNaN(t)&&void 0!==e.percentage&&null!==e.percentage;return(0,xe.jsx)(y.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,xe.jsxs)(b.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:ge,borderColor:ke(e.color)}},children:[(0,xe.jsx)(S.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Ce(e.color)," 100%)")}}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(j.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Ur?(0,xe.jsx)(C.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,xe.jsx)(w.A,{sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:null!==(o=e.value)&&void 0!==o?o:0}),n&&(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.5,flexWrap:"wrap"},children:[(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:999,bgcolor:Ce(e.color),color:e.color,fontSize:{xs:10,sm:11},fontWeight:800},children:[Math.abs(t),"%"]}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,display:{xs:"none",sm:"inline"}},children:"of total"})]})]}),(0,xe.jsx)(v.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Ce(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(ke(e.color)),flexShrink:0},children:(0,xe.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,xe.jsxs)(b.A,{elevation:0,sx:{mt:{xs:1.5,md:2},mb:{xs:1.5,md:2},p:{xs:1.5,md:2},borderRadius:pe/8,border:"1px solid",borderColor:me,background:"#fff",boxShadow:ge},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:{xs:1,md:1.5},color:ve},children:[(0,xe.jsx)(v.A,{sx:{width:28,height:28,bgcolor:Ce("#6366f1"),color:"#6366f1"},children:(0,xe.jsx)(u.MiI,{size:16})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.6,textTransform:"uppercase",color:ve},children:"Filters"})]}),(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1.25,sx:{flexWrap:"wrap"},children:[(0,xe.jsxs)(j.A,{direction:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",children:[(()=>{const e=Pe.find((e=>e.id===xr))||Pe[0],o=Le[e.iconKey]||u.VP9;return(0,xe.jsx)(W.A,{disableClearable:!0,size:"small",openOnFocus:!0,selectOnFocus:!0,filterOptions:e=>e,options:Pe,value:e,onChange:(e,o)=>o&&hr(o.id),getOptionLabel:e=>e.label,isOptionEqualToValue:(e,o)=>e.id===o.id,PaperComponent:Fe,ListboxProps:{sx:{py:0,maxHeight:360}},renderOption:(e,o,r)=>{var n;let{selected:i}=r;const l=Le[o.iconKey]||u.VP9,s=null!==(n=qr[o.id])&&void 0!==n?n:0;return(0,d.createElement)("li",(0,t.A)((0,t.A)({},e),{},{key:o.id,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderBottom:"1px solid #f1f5f9",backgroundColor:i?"".concat(o.color,"10"):"transparent",transition:"background-color 0.15s"}}),(0,xe.jsx)(v.A,{sx:{width:36,height:36,bgcolor:i?o.color:"".concat(o.color,"18"),color:i?"#fff":o.color,transition:"background-color 0.15s, color 0.15s"},children:(0,xe.jsx)(l,{size:20})}),(0,xe.jsxs)(j.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,xe.jsx)(w.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:o.label}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:o.range})]}),(0,xe.jsx)(k.A,{size:"small",label:s,sx:{minWidth:36,height:22,fontWeight:800,fontSize:11,bgcolor:s>0?"".concat(o.color,"18"):"#f1f5f9",color:s>0?o.color:"#94a3b8",border:"1px solid ".concat(s>0?o.color+"55":"#e2e8f0"),"& .MuiChip-label":{px:.75}}}),i&&(0,xe.jsx)(v.A,{sx:{width:22,height:22,bgcolor:o.color,color:"#fff"},children:(0,xe.jsx)(u.g9_,{size:14})}))},renderInput:r=>{var n;return(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},r),{},{placeholder:"Batch",inputProps:(0,t.A)((0,t.A)({},r.inputProps),{},{readOnly:!0,style:(0,t.A)((0,t.A)({},(null===(n=r.inputProps)||void 0===n?void 0:n.style)||{}),{},{cursor:"pointer",caretColor:"transparent"})}),InputProps:(0,t.A)((0,t.A)({},r.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(v.A,{sx:{width:24,height:24,bgcolor:"".concat(e.color,"18"),color:e.color},children:(0,xe.jsx)(o,{size:14})})})}),sx:{minWidth:{xs:180,sm:220,md:240},cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:"".concat(e.color,"08"),fontWeight:700,color:e.color,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:"".concat(e.color,"55"),borderWidth:1.5},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(e.color,"26")},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:e.color}}}))}})})(),Je&&Ze&&(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,onClick:()=>$e(!0),sx:{pl:.5,pr:1.25,py:.5,borderRadius:999,cursor:"pointer",bgcolor:ye("#f59e0b"),border:"1.5px solid ".concat(ke("#f59e0b")),transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(We("#f59e0b"))}},children:[(0,xe.jsx)(Ee,{color:"#f59e0b",children:(0,xe.jsx)(u.tjE,{size:14})}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{fontWeight:700,color:"#f59e0b",whiteSpace:"nowrap"},children:[a()(Je).format("DD MMM")," \u2013 ",a()(Ze).format("DD MMM")]})]})]}),(0,xe.jsx)(W.A,{disablePortal:!0,options:vr||[],value:ir,PaperComponent:Fe,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{He||(e.preventDefault(),(0,le.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(rr(0),lr(null),nr(0),dr(null)):(rr((null===o||void 0===o?void 0:o.tenantid)||0),lr(o),nr(0),dr(null))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{inputRef:wo,placeholder:"Select Tenant",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#0ea5e9",children:(0,xe.jsx)(u.gl1,{size:14})})})}),sx:Re("#0ea5e9")}))}),(0,xe.jsx)(W.A,{disablePortal:!0,options:wr||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:sr,PaperComponent:Fe,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{He||or?or||(e.preventDefault(),(0,le.k)("Please select your Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=wo.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,le.k)("Please select your Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(nr(0),dr(null)):(nr(o.locationid||0),dr(o))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Select Location",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#14b8a6",children:(0,xe.jsx)(u.gwi,{size:14})})})}),sx:Re("#14b8a6")}))}),(0,xe.jsx)(W.A,{disabled:_r,options:Xr,PaperComponent:Fe,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onChange:(e,o,r)=>{ar("clear"===r?0:o.userid)},onOpen:e=>{He||(e.preventDefault(),(0,le.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=jo.current)||void 0===e?void 0:e.focus()}),0))},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#8b5cf6",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Re("#8b5cf6")}))})]})]}),(0,xe.jsx)(b.A,{elevation:0,sx:{p:{xs:1,md:1.5},borderTopLeftRadius:pe/8,borderTopRightRadius:pe/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:me,borderBottom:0,background:"#fff"},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,xe.jsx)(j.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:me,borderRadius:4}},children:De.map(((e,o)=>{var r;const t=ze[e.status],n=t.icon,i=Qe===o,l=null!==(r=Jr[e.countKey])&&void 0!==r?r:0;return(0,xe.jsxs)(S.A,{onClick:e=>{return r=o,yo(0),Xe(r),Wo(50),0===r&&(Ve("Pending"),vo("pending"),Ro(null===Zr||void 0===Zr?void 0:Zr.uncoveredLength)),1===r&&(Ve("Assigned"),vo("accepted"),Ro(null===Zr||void 0===Zr?void 0:Zr.assignedLength)),2===r&&(Ve("Arrived"),vo("arrived"),Ro(null===Zr||void 0===Zr?void 0:Zr.arrivedLength)),3===r&&(Ve("Picked"),vo("picked"),Ro(null===Zr||void 0===Zr?void 0:Zr.pickedLength)),4===r&&(Ve("Active"),vo("active"),Ro(null===Zr||void 0===Zr?void 0:Zr.activeLength)),5===r&&(Ve("Skipped"),vo("skipped"),Ro(null===Zr||void 0===Zr?void 0:Zr.skippedLength)),6===r&&(Ve("Delivered"),vo("delivered"),Ro(null===Zr||void 0===Zr?void 0:Zr.coveredLength)),7===r&&(Ve("Cancelled"),vo("cancelled"),Ro(null===Zr||void 0===Zr?void 0:Zr.cancelLength)),console.log(r),void Mo("");var r},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?t.color:ke(t.color)),bgcolor:i?t.color:ye(t.color),color:i?"#fff":t.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(We(t.color)):"none",transition:"all 0.18s","&:hover":{borderColor:t.color,boxShadow:i?"0 6px 18px ".concat(We(t.color)):"0 0 0 3px ".concat(We(t.color))}},children:[(0,xe.jsx)(v.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":Ce(t.color),color:i?"#fff":t.color},children:(0,xe.jsx)(n,{size:13})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:t.label}),(0,xe.jsx)(S.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":t.color,border:i?"none":"1px solid ".concat(ke(t.color))},children:l})]},e.status)}))}),(0,xe.jsx)(S.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,xe.jsx)(ie.A,{value:Lo,onChange:Mo,onDebouncedChange:To,sx:{m:0,width:"100%",borderRadius:999,bgcolor:ye("#6366f1"),"& fieldset":{borderColor:ke("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}})})]})}),(0,xe.jsx)(b.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:pe/8,borderBottomRightRadius:pe/8,border:"1px solid",borderColor:me,overflow:"hidden",background:"#fff"},children:(0,xe.jsx)(z.A,{ref:he,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:t}=e.currentTarget;o+t>=r-50&&Fr&&!Er&&Tr()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto",overflowX:"auto","&::-webkit-scrollbar":{width:"10px",height:"10px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:ke("#6366f1"),borderRadius:"8px",cursor:"pointer","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:we}},children:((e,o,n,i,s,x)=>{const h="Cancelled"!==Ge&&"Delivered"!==Ge,p="Created"==Ge,g=15+(h?1:0)+(p?1:0);return r?(0,xe.jsxs)(ae.nV,{sx:{p:1.25},children:[0===Br.length&&!No&&!Hr&&(0,xe.jsxs)(j.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#94a3b8"),color:Ae},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No deliveries to show"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,textAlign:"center",px:2},children:"all"===xr?"No ".concat(((null===(e=ze[bo])||void 0===e?void 0:e.label)||Ge).toLowerCase()," orders for this filter."):"No ".concat(((null===(o=ze[bo])||void 0===o?void 0:o.label)||Ge).toLowerCase()," orders in ").concat((null===(n=Pe.find((e=>e.id===xr)))||void 0===n?void 0:n.label)||"this batch",".")})]}),0===Br.length&&Hr&&(0,xe.jsxs)(j.A,{alignItems:"center",sx:{py:6},children:[(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading deliveries\u2026"})]}),Br.map(((e,o)=>{var r,n,i,s,d,c,x,g;const f=ze[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},b=f.icon,v=!!ue.find((o=>o.orderheaderid==e.orderheaderid)),A=(null===zo||void 0===zo?void 0:zo.orderid)===(null===e||void 0===e?void 0:e.orderid),m=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.25,borderRadius:999,bgcolor:ye(e),color:e,fontWeight:700,fontSize:11,border:"1px solid ".concat(ke(e)),whiteSpace:"nowrap"});return(0,xe.jsxs)(ae.pg,{accent:f.color,selected:v,header:(0,xe.jsxs)(j.A,{spacing:1.25,children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[p&&(0,xe.jsx)(D.A,{size:"small",sx:{p:.25},onChange:o=>{if(o.target.checked){let o=ue;o.push((0,t.A)((0,t.A)({},e),{},{sno:ue.length+1})),Se([...o])}else{let o=ue.find((o=>o.orderheaderid==e.orderheaderid));if(o){let e=ue;e.splice(o.sno-1,1),e.map(((e,o)=>{e.sno=o+1})),Se([...e])}}},checked:!!ue.find((o=>o.orderheaderid==e.orderheaderid))}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:Ae},children:String(So*Co+o+1).padStart(2,"0")}),(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ye(f.color),border:"1px solid ".concat(ke(f.color)),color:f.color},children:[(0,xe.jsx)(Ee,{color:f.color,size:18,children:(0,xe.jsx)(b,{size:11})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:10.5,lineHeight:1},children:f.label})]})]}),(0,xe.jsxs)(j.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:["C"==e.deliverytype&&(0,xe.jsx)(I.A,{size:"small",onClick:()=>{(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(Do(null),Po(null)):(Do(e),Po(e.orderheaderid))},sx:{borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(ke("#06b6d4")),"&:hover":{bgcolor:Ce("#06b6d4")}},children:A?(0,xe.jsx)(re.A,{fontSize:"small"}):(0,xe.jsx)(te.A,{fontSize:"small"})}),h&&(0,xe.jsx)(I.A,{size:"small",onClick:o=>gr(o,e),sx:{borderRadius:999,bgcolor:ye("#6366f1"),color:"#6366f1",border:"1px solid ".concat(ke("#6366f1")),"&:hover":{bgcolor:Ce("#6366f1")}},children:(0,xe.jsx)(l.A,{})})]})]}),(0,xe.jsxs)(S.A,{sx:{minWidth:0},children:[(0,xe.jsx)(w.A,{sx:{fontWeight:800,color:be,fontSize:15},noWrap:!0,children:e.tenantname}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:[e.tenantsuburb,e.applocation].filter(Boolean).join(" \xb7 ")||"\u2014"})]})]}),children:[(0,xe.jsxs)(ae.FG,{children:[(0,xe.jsxs)(ae.pY,{label:"Order / Location",full:!0,children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:[e.orderid," \xb7 ",e.deliveryid]})]}),(0,xe.jsxs)(ae.pY,{label:"Pickup",children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:e.pickupcustomer||"\u2014"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:e.pickupcontactno})]}),(0,xe.jsxs)(ae.pY,{label:"Drop",children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:be},noWrap:!0,children:e.deliverycustomer||"\u2014"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:e.deliverycontactno})]}),(0,xe.jsx)(ae.pY,{label:"Rider",full:!0,children:e.ridername?(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:24,children:(0,xe.jsx)(u.bsz,{size:13})}),(0,xe.jsxs)(j.A,{sx:{minWidth:0},children:[(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:700,color:be},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},noWrap:!0,children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(ae.pY,{label:"ETA",value:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"}),(0,xe.jsx)(ae.pY,{label:"Transit",children:(0,xe.jsxs)(S.A,{sx:m("#06b6d4"),children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(ae.pY,{label:"Kms \xb7 plan / act",children:(0,xe.jsxs)(j.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(S.A,{sx:m("#ef4444"),children:[e.kms||0," km"]}),(0,xe.jsxs)(S.A,{sx:m("#10b981"),children:[e.cumulativekms||0," km"]})]})}),(0,xe.jsx)(ae.pY,{label:"Amount \xb7 chg / amt",children:(0,xe.jsxs)(j.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(S.A,{sx:m("#ef4444"),children:["\u20b9 ",null!==(n=null===(i=e.deliverycharges)||void 0===i?void 0:i.toFixed(2))&&void 0!==n?n:"0.00"]}),(0,xe.jsxs)(S.A,{sx:m("#10b981"),children:["\u20b9 ",null!==(s=null===(d=e.deliveryamt)||void 0===d?void 0:d.toFixed(2))&&void 0!==s?s:"0.00"]})]})}),(0,xe.jsx)(ae.pY,{label:"Qty",value:e.Quantity||"\u2014"}),(0,xe.jsx)(ae.pY,{label:"COD",children:(0,xe.jsx)(w.A,{sx:{fontSize:13,fontWeight:800,color:e.collectionamt?"#ef4444":Ae},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),(0,xe.jsx)(ae.pY,{label:"Step",children:e.step?(0,xe.jsx)(S.A,{sx:(0,t.A)((0,t.A)({},m("#6366f1")),{},{minWidth:30,fontWeight:800}),children:e.step}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),e.notes&&(0,xe.jsx)(ae.pY,{label:"Notes",full:!0,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.notes})})]}),A&&(0,xe.jsxs)(S.A,{sx:{mt:1.5,p:1.25,borderRadius:2,bgcolor:we,border:"1px solid ".concat(je)},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[(0,xe.jsx)(Ee,{color:"#6366f1",size:22,children:(0,xe.jsx)(u.gsJ,{size:12})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#6366f1"},children:"Product Details"})]}),(0,xe.jsxs)(j.A,{spacing:1,children:[null===zr||void 0===zr||null===(c=zr.details)||void 0===c?void 0:c.map(((e,o)=>(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.25,sx:{p:1,borderRadius:1.5,bgcolor:"#fff",border:"1px solid ".concat(je)},children:[(0,xe.jsx)(S.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(je),flexShrink:0}}),(0,xe.jsxs)(j.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(w.A,{variant:"body2",sx:{fontWeight:600,color:be},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:["Qty ",(null===e||void 0===e?void 0:e.orderqty)||0," \xb7 \u20b9 ",(null===e||void 0===e?void 0:e.price)||0]})]}),(0,xe.jsxs)(w.A,{variant:"body2",sx:{fontWeight:800,color:be,flexShrink:0},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o))),(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"space-between",sx:{pt:.5},children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve},children:"Total Amount"}),(0,xe.jsxs)(w.A,{variant:"body2",sx:{fontWeight:800,color:"#10b981"},children:["\u20b9 ",null===zr||void 0===zr||null===(x=zr.pricedetails)||void 0===x||null===(g=x.orderamount)||void 0===g?void 0:g.toFixed(2)]})]})]})]})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Nr||void 0===Nr?void 0:Nr.length)&&(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Er||Fr?(0,xe.jsx)(ce.A,{}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"\xb7 End of list \xb7"})})]}):(0,xe.jsxs)(P.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,lg:1300,xl:1400}},children:[(0,xe.jsx)(L.A,{children:(0,xe.jsxs)(M.A,{sx:{"& th":{backgroundColor:we,color:ve,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(me),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[p&&(0,xe.jsx)(Y.A,{sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(D.A,{indeterminate:ue.length>0&&ue.length!=Br.length,onChange:e=>{e.target.checked?Se([...Br]):Se([])},checked:ue.length>0&&ue.length==Br.length})}),(0,xe.jsx)(Y.A,{children:"#"}),(0,xe.jsx)(Y.A,{children:"Status"}),(0,xe.jsx)(Y.A,{children:"Tenant"}),(0,xe.jsx)(Y.A,{children:"Order / Location"}),(0,xe.jsx)(Y.A,{children:"Pickup"}),(0,xe.jsx)(Y.A,{children:"Drop"}),(0,xe.jsx)(Y.A,{children:"Rider"}),(0,xe.jsx)(Y.A,{children:"ETA"}),(0,xe.jsx)(Y.A,{children:"Transit"}),(0,xe.jsx)(Y.A,{children:"Kms"}),(0,xe.jsx)(Y.A,{children:"Amount"}),(0,xe.jsx)(Y.A,{children:"Notes"}),(0,xe.jsx)(Y.A,{children:"Step"}),(0,xe.jsx)(Y.A,{children:"Qty"}),(0,xe.jsx)(Y.A,{children:"COD"}),h&&(0,xe.jsx)(Y.A,{align:"right",children:"Action"})]})}),(No||Kr)&&(0,xe.jsx)(se.r,{col:8}),(0,xe.jsxs)(T.A,{children:[0==Br.length&&!No&&!Hr&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,sx:{py:6},children:(0,xe.jsxs)(j.A,{alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#94a3b8"),color:Ae},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No deliveries to show"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"all"===xr?"No ".concat(((null===(i=ze[bo])||void 0===i?void 0:i.label)||Ge).toLowerCase()," orders for this filter."):"No ".concat(((null===(s=ze[bo])||void 0===s?void 0:s.label)||Ge).toLowerCase()," orders in ").concat((null===(x=Pe.find((e=>e.id===xr)))||void 0===x?void 0:x.label)||"this batch",".")})]})})}),0==Br.length&&Hr&&(0,xe.jsx)(M.A,{children:(0,xe.jsxs)(Y.A,{colSpan:g,sx:{textAlign:"center",py:6},children:[(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(w.A,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"Loading deliveries\u2026"})]})}),Br.map(((e,o)=>{var r,n,i,s,c,x,h,p;const f=ze[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},v=f.icon,A=!!ue.find((o=>o.orderheaderid==e.orderheaderid));return(0,xe.jsxs)(d.Fragment,{children:[(0,xe.jsxs)(M.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(je),py:{xs:1,md:1.5},px:{xs:1,md:2}},backgroundColor:A?Ce("#8b5cf6"):"transparent","&:hover":{backgroundColor:A?Ce("#8b5cf6"):we}},children:["Created"==Ge&&(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(D.A,{onChange:o=>{if(o.target.checked){let o=ue;o.push((0,t.A)((0,t.A)({},e),{},{sno:ue.length+1})),Se([...o])}else{if(ue.find((o=>o.orderheaderid==e.orderheaderid))){let o=ue,r=ue.find((o=>o.orderheaderid==e.orderheaderid));o.splice(r.sno-1,1),o.map(((e,o)=>{e.sno=o+1})),Se([...o])}}console.log("list",ue)},checked:ue.find((o=>o.orderheaderid==e.orderheaderid))})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:Ae},children:String(So*Co+o+1).padStart(2,"0")})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ye(f.color),border:"1px solid ".concat(ke(f.color)),color:f.color},children:[(0,xe.jsx)(Ee,{color:f.color,size:20,children:(0,xe.jsx)(v,{size:12})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:f.label})]})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(F.A,{title:e.tenantadress,children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{noWrap:!0,variant:"subtitle2",sx:{fontWeight:700,color:be},children:e.tenantname}),(0,xe.jsx)(w.A,{noWrap:!0,variant:"caption",sx:{color:ve},children:e.tenantsuburb}),(0,xe.jsx)(w.A,{noWrap:!0,variant:"caption",sx:{color:Ae},children:e.applocation})]})})}),(0,xe.jsxs)(Y.A,{align:"left",children:[(0,xe.jsx)(F.A,{title:"Location Name-Suburb",placement:"top",children:(0,xe.jsx)(w.A,{variant:"subtitle1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,xe.jsxs)(j.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(F.A,{title:"Order Id",placement:"top",children:(0,xe.jsx)(w.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,xe.jsxs)(F.A,{title:"Ordered date",placement:"top",children:[(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.orderdate).utc().format("hh:mm A")})]})]}),"-",(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(F.A,{title:"Delivery Id",placement:"top",children:(0,xe.jsx)(w.A,{variant:"body2",noWrap:!0,children:e.deliveryid})}),(0,xe.jsxs)(F.A,{title:"Delivery date",placement:"top",children:[(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(w.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.deliverydate).utc().format("hh:mm A")})]})]})]})]}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.pickupcustomer}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.pickupcontactno}),(0,xe.jsx)(F.A,{title:e.Pickupaddress,sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:e.pickuplocation||(e.Pickupaddress?e.Pickupaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.deliverycustomer}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:e.deliverycontactno}),(0,xe.jsx)(F.A,{title:e.deliveryaddress,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,whiteSpace:"nowrap"},children:e.deliverylocation||(e.deliveryaddress?e.deliveryaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(Y.A,{children:e.ridername?(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:28,children:(0,xe.jsx)(u.bsz,{size:14})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(w.A,{variant:"caption",sx:{color:ve},children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",fontWeight:700,fontSize:12,border:"1px solid ".concat(ke("#06b6d4"))},children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(F.A,{title:"Planned KMS",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#ef4444")),whiteSpace:"nowrap",minWidth:75},children:[e.kms||0," km"]})}),(0,xe.jsx)(F.A,{title:"Actual KMS",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#10b981")),whiteSpace:"nowrap",minWidth:75},children:[e.cumulativekms||0," km"]})})]})}),(0,xe.jsx)(Y.A,{align:"left",children:(0,xe.jsxs)(j.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(F.A,{title:"Delivery Charge",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#ef4444")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(n=null===(i=e.deliverycharges)||void 0===i?void 0:i.toFixed(2))&&void 0!==n?n:"0.00"]})}),(0,xe.jsx)(F.A,{title:"Delivery Amount",placement:"top",children:(0,xe.jsxs)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:ye("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(ke("#10b981")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(s=null===(c=e.deliveryamt)||void 0===c?void 0:c.toFixed(2))&&void 0!==s?s:"0.00"]})})]})}),(0,xe.jsx)(Y.A,{children:e.notes?(0,xe.jsx)(F.A,{title:e.notes,children:(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,maxWidth:160,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.notes})}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),(0,xe.jsx)(Y.A,{align:"center",children:e.step?(0,xe.jsx)(S.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:24,px:.875,borderRadius:999,bgcolor:ye("#6366f1"),border:"1px solid ".concat(ke("#6366f1")),color:"#6366f1",fontWeight:800,fontSize:11},children:e.step}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae},children:"\u2014"})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:e.Quantity?be:Ae,whiteSpace:"nowrap"},children:e.Quantity||"\u2014"})}),(0,xe.jsx)(Y.A,{children:(0,xe.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:800,color:e.collectionamt?"#ef4444":Ae,whiteSpace:"nowrap"},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),"Cancelled"!==Ge&&"Delivered"!==Ge&&(0,xe.jsx)(Y.A,{align:"right",children:(0,xe.jsxs)(j.A,{direction:"row",justifyContent:"flex-end",spacing:.75,children:["C"==e.deliverytype&&(0,xe.jsx)(F.A,{title:"Product details",placement:"top",children:(0,xe.jsx)(I.A,{size:"small",onClick:()=>{(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(Do(null),Po(null)):(Do(e),Po(e.orderheaderid))},sx:{borderRadius:999,bgcolor:ye("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(ke("#06b6d4")),"&:hover":{bgcolor:Ce("#06b6d4")}},children:(null===zo||void 0===zo?void 0:zo.orderid)===e.orderid?(0,xe.jsx)(re.A,{fontSize:"small"}):(0,xe.jsx)(te.A,{fontSize:"small"})})}),(0,xe.jsx)(F.A,{title:"Actions",placement:"top",children:(0,xe.jsx)(I.A,{size:"small",onClick:o=>gr(o,e),sx:{borderRadius:999,bgcolor:ye("#6366f1"),color:"#6366f1",border:"1px solid ".concat(ke("#6366f1")),"&:hover":{bgcolor:Ce("#6366f1")}},children:(0,xe.jsx)(l.A,{})})})]})})]}),(null===zo||void 0===zo?void 0:zo.orderid)===(null===e||void 0===e?void 0:e.orderid)&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,sx:{p:0,border:0,backgroundColor:we},children:(0,xe.jsx)(E.A,{in:!0,timeout:"auto",unmountOnExit:!0,children:(0,xe.jsx)(S.A,{sx:{width:"100%",p:2.5},children:(0,xe.jsxs)(b.A,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:me,overflow:"hidden",background:"#fff"},children:[(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,borderBottom:"1px solid ".concat(je),bgcolor:ye("#6366f1")},children:[(0,xe.jsx)(Ee,{color:"#6366f1",children:(0,xe.jsx)(u.gsJ,{size:14})}),(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#6366f1"},children:"Product Details"})]}),(0,xe.jsxs)(P.A,{size:"small",sx:{minWidth:800},children:[(0,xe.jsx)(L.A,{children:(0,xe.jsxs)(M.A,{sx:{"& th":{fontSize:11,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:ve,borderBottom:"1px solid ".concat(je)},"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(Y.A,{children:"#"}),(0,xe.jsx)(Y.A,{children:"Product"}),(0,xe.jsx)(Y.A,{children:"Description"}),(0,xe.jsx)(Y.A,{align:"right",children:"Qty"}),(0,xe.jsx)(Y.A,{align:"right",children:"Cost"}),(0,xe.jsx)(Y.A,{align:"right",children:"Price"}),(0,xe.jsx)(Y.A,{align:"right",children:"Tax"}),(0,xe.jsx)(Y.A,{align:"right",children:"Amount"})]})}),(0,xe.jsxs)(T.A,{children:[null===zr||void 0===zr||null===(x=zr.details)||void 0===x?void 0:x.map(((e,o)=>{var r,t;return(0,xe.jsxs)(M.A,{sx:{"&:hover":{backgroundColor:we+" !important"}},children:[(0,xe.jsx)(Y.A,{sx:{color:Ae,fontWeight:700},children:String(o+1).padStart(2,"0")}),(0,xe.jsx)(Y.A,{children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.25,alignItems:"center",children:[(0,xe.jsx)(S.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(je)}}),(0,xe.jsx)(w.A,{variant:"body2",sx:{fontWeight:600,color:be},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"})]})}),(0,xe.jsx)(Y.A,{sx:{color:ve},children:(null===e||void 0===e?void 0:e.productdescription)||"-"}),(0,xe.jsx)(Y.A,{align:"right",sx:{fontWeight:700},children:(null===e||void 0===e?void 0:e.orderqty)||0}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null===e||void 0===e?void 0:e.price)||0]}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null!==(r=null===e||void 0===e?void 0:e.productsumprice)&&void 0!==r?r:0).toFixed(2)]}),(0,xe.jsxs)(Y.A,{align:"right",children:["\u20b9 ",(null!==(t=null===e||void 0===e?void 0:e.taxamount)&&void 0!==t?t:0).toFixed(2)]}),(0,xe.jsxs)(Y.A,{align:"right",sx:{fontWeight:800,color:be},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o)})),(0,xe.jsxs)(M.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(Y.A,{align:"right",colSpan:7,sx:{fontWeight:700,color:ve,borderTop:"1px solid ".concat(je)},children:"Total Amount"}),(0,xe.jsxs)(Y.A,{align:"right",sx:{fontWeight:800,color:"#10b981",borderTop:"1px solid ".concat(je)},children:["\u20b9 ",null===zr||void 0===zr||null===(h=zr.pricedetails)||void 0===h||null===(p=h.orderamount)||void 0===p?void 0:p.toFixed(2)]})]})]})]})]})})})})})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Nr||void 0===Nr?void 0:Nr.length)&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(Y.A,{colSpan:g,rowSpan:3,children:(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Er||Fr?(0,xe.jsx)(ce.A,{}):(0,xe.jsx)(w.A,{variant:"caption",sx:{color:Ae,fontWeight:600},children:"\xb7 End of list \xb7"})})})})]})]})})()})}),(0,xe.jsxs)(K.A,{anchorEl:Fo,open:pr,onClose:fr,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{elevation:0,sx:{minWidth:220,borderRadius:2,mt:.75,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden","& .MuiMenuItem-root":{fontSize:13,fontWeight:600,py:1.1,px:1.5,gap:1,transition:"background-color 0.15s","&:hover":{bgcolor:we}}}},children:["delivered"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{onClick:()=>{Wr.mutate(Ko.userfcmtoken),fr()},children:[(0,xe.jsx)(Ee,{color:"#0ea5e9",size:22,children:(0,xe.jsx)(u.q53,{size:13})}),"Notify Rider"]}),["pending","accepted","arrived"].includes(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{onClick:()=>{var e;if(!He)return Rr("Please select a location first!","warning"),void(null===(e=jo.current)||void 0===e||e.focus());Qo(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#8b5cf6",size:22,children:(0,xe.jsx)(u.bsz,{size:13})}),"Change Rider"]}),(1==ur||2==ur)&&(0,xe.jsxs)(O.A,{onClick:()=>{to(Ko.kms),io(Ko.cumulativekms),po(Ko.droplat),fo(Ko.droplon),ao(Ko.notes),so(Ko.deliveryamount),mo(Ko.orderstatus||"delivered"),ho(Ko),Ke(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#10b981",size:22,children:(0,xe.jsx)(u.mU9,{size:13})}),"Update Status"]}),"cancelled"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&"delivered"!==(null===Ko||void 0===Ko?void 0:Ko.orderstatus)&&(0,xe.jsxs)(O.A,{sx:{color:"#ef4444 !important"},onClick:()=>{Go(!0),fr()},children:[(0,xe.jsx)(Ee,{color:"#ef4444",size:22,children:(0,xe.jsx)(u.uDv,{size:13})}),"Cancel Delivery"]})]}),(0,xe.jsxs)(N.A,{open:Uo,onClose:()=>Go(!1),maxWidth:"xs",fullWidth:!0,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #ef4444 0%, ".concat(Ce("#ef4444")," 100%)")}}),(0,xe.jsx)(H.A,{sx:{p:3.5},children:(0,xe.jsxs)(j.A,{alignItems:"center",spacing:2.5,children:[(0,xe.jsx)(v.A,{sx:{width:64,height:64,bgcolor:Ce("#ef4444"),color:"#ef4444"},children:(0,xe.jsx)(s.A,{style:{fontSize:28}})}),(0,xe.jsxs)(j.A,{spacing:.5,alignItems:"center",children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Cancel Delivery?"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve,textAlign:"center",px:1},children:"This action will cancel the delivery and notify the rider. Please share a brief reason."})]}),(0,xe.jsx)(R.A,{fullWidth:!0,placeholder:"Reason for cancellation",multiline:!0,minRows:2,maxRows:4,onChange:e=>_o(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:we,"& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#ef4444"},"&.Mui-focused fieldset":{borderColor:"#ef4444",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#ef4444"))}}}}),(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,onClick:()=>Go(!1),variant:"outlined",sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Keep Delivery"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{""==Xo?Rr("Enter FeedBack","error"):br({selectedRow:Ko,cancelFeed:Xo}),(async()=>{console.log("cancelridernotification",Ko);try{return(await x.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:Ko.userfcmtoken,notification:{title:"NearleXpress",body:"".concat(Ko.orderid," have been Cancelled"),sound:"ring",image:""},data:{type:"cancel"}})).data}catch(e){Rr(e.message,"error",2e3),console.log(e)}})()},autoFocus:!0,sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#ef4444",boxShadow:"0 6px 18px ".concat(We("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,xe.jsxs)(N.A,{open:Vo,onClose:()=>Qo(!1),maxWidth:"sm",fullWidth:!0,TransitionComponent:Z.s,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #8b5cf6 0%, ".concat(Ce("#8b5cf6")," 100%)")}}),(0,xe.jsx)(J.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#8b5cf6"),color:"#8b5cf6"},children:(0,xe.jsx)(u.bsz,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Change Rider"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"Assign this delivery to a different rider"})]})]})}),(0,xe.jsx)(H.A,{sx:{p:3,pt:2},children:(0,xe.jsx)(W.A,{fullWidth:!0,options:Xr,PaperComponent:Fe,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),onChange:(e,o)=>{er(o),n.A.debug("Rider selected in dropdown:",o?"".concat(o.firstname," ").concat(o.lastname):"None")},renderInput:e=>(0,xe.jsx)(R.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(j.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(Ee,{color:"#8b5cf6",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Re("#8b5cf6")}))})}),(0,xe.jsx)(q.A,{sx:{p:3,pt:1},children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,variant:"outlined",onClick:()=>Qo(!1),sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Cancel"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{Ho(!0),n.A.info("Initiating rider assignment change for order ID ".concat(null===Ko||void 0===Ko?void 0:Ko.orderid," to rider: ").concat(null===$o||void 0===$o?void 0:$o.firstname," ").concat(null===$o||void 0===$o?void 0:$o.lastname)),kr.mutate({selectedRider:$o,selectedRow:Ko})},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#8b5cf6",boxShadow:"0 6px 18px ".concat(We("#8b5cf6")),"&:hover":{bgcolor:"#7c3aed"}},children:"Change Rider"})]})})]}),(0,xe.jsxs)(N.A,{open:_e,onClose:()=>$e(!1),fullScreen:r,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #f59e0b 0%, ".concat(Ce("#f59e0b")," 100%)")}}),(0,xe.jsx)(J.A,{align:"left",sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#f59e0b"),color:"#f59e0b"},children:(0,xe.jsx)(u.tjE,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Date Range"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:"Pick a window to filter the deliveries"})]})]})}),(0,xe.jsx)(H.A,{sx:{width:"100%"},className:"datedialog",children:(0,xe.jsx)(ee.U,{open:_e,toggle:()=>$e(!_e),id:"daterange1",onChange:e=>{"All"===e.label?(qe(""),Ue(""),$e(!1)):(qe(a()(e.startDate).format("YYYY-MM-DD")),Ue(a()(e.endDate).format("YYYY-MM-DD")),e.label?oo(e.label):oo("")),console.log(e)},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,U.A)(new Date,-1),endDate:(0,U.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,U.A)(new Date,1),endDate:(0,U.A)(new Date,1)},{label:"This Week",startDate:(0,G.A)(new Date),endDate:(0,V.A)(new Date)},{label:"Last Week",startDate:(0,G.A)((0,Q.A)(new Date,-1)),endDate:(0,V.A)((0,Q.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,Q.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,X.A)(new Date),endDate:(0,_.A)(new Date)},{label:"Last Month",startDate:(0,X.A)((0,$.A)(new Date,-1)),endDate:(0,_.A)((0,$.A)(new Date,-1))}]})}),(0,xe.jsx)(j.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2.5,pt:1},children:(0,xe.jsx)(B.A,{variant:"contained",onClick:()=>{$e(!1)},sx:{borderRadius:999,px:3,py:1,fontWeight:800,bgcolor:"#f59e0b",boxShadow:"0 6px 18px ".concat(We("#f59e0b")),"&:hover":{bgcolor:"#d97706"}},children:"Apply"})})]}),(0,xe.jsxs)(N.A,{fullWidth:!0,open:Ye,onClose:Dr,scroll:"paper",maxWidth:"sm",fullScreen:r,TransitionComponent:Z.s,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:me,boxShadow:fe,overflow:"hidden"}},children:[(0,xe.jsx)(S.A,{sx:{height:4,background:"linear-gradient(90deg, #10b981 0%, ".concat(Ce("#10b981")," 100%)")}}),(0,xe.jsx)(J.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(v.A,{sx:{width:44,height:44,bgcolor:Ce("#10b981"),color:"#10b981"},children:(0,xe.jsx)(u.mU9,{size:22})}),(0,xe.jsxs)(j.A,{children:[(0,xe.jsx)(w.A,{variant:"h4",sx:{fontWeight:800,color:be},children:"Update Delivery Status"}),(0,xe.jsx)(w.A,{variant:"caption",sx:{color:ve},children:null!==xo&&void 0!==xo&&xo.orderid?"Order #".concat(xo.orderid):"Modify delivery details"})]})]})}),(0,xe.jsx)(H.A,{dividers:!0,sx:{p:3,bgcolor:we},children:(0,xe.jsxs)(y.Ay,{container:!0,spacing:2,children:[[{label:"KMs",value:ro,set:e=>to(e),color:"#ef4444"},{label:"Actual KMs",value:no,set:e=>io(+e),color:"#10b981"},{label:"Delivery Latitude",value:uo,set:e=>po(e),color:"#06b6d4"},{label:"Delivery Longitude",value:go,set:e=>fo(e),color:"#06b6d4"}].map((e=>(0,xe.jsxs)(y.Ay,{item:!0,xs:12,sm:6,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:e.label}),(0,xe.jsx)(R.A,{fullWidth:!0,value:e.value,type:"number",onChange:o=>e.set(o.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(e.color))}}}})]},e.label))),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Amount"}),(0,xe.jsx)(R.A,{fullWidth:!0,type:"number",value:lo,onChange:e=>so(+e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#10b981"},"&.Mui-focused fieldset":{borderColor:"#10b981",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#10b981"))}}}})]}),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Status"}),(0,xe.jsx)(R.A,{select:!0,fullWidth:!0,value:Ao,onChange:e=>mo(e.target.value),SelectProps:{MenuProps:{PaperProps:{sx:{borderRadius:2,mt:.5,boxShadow:fe}}}},sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}},children:["pending","accepted","started","arrived","delivered","cancelled"].map((e=>{const o=ze[e]||{label:e,color:"#6366f1",icon:u.bfP},r=o.icon;return(0,xe.jsxs)(O.A,{value:e,sx:{gap:1},children:[(0,xe.jsx)(Ee,{color:o.color,size:22,children:(0,xe.jsx)(r,{size:13})}),o.label]},e)}))})]}),(0,xe.jsxs)(y.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:ve,letterSpacing:.5,textTransform:"uppercase"},children:"Notes"}),(0,xe.jsx)(R.A,{value:co,fullWidth:!0,multiline:!0,minRows:2,onChange:e=>ao(e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:me},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We("#6366f1"))}}}})]})]})}),(0,xe.jsx)(q.A,{sx:{p:3},children:(0,xe.jsxs)(j.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(B.A,{fullWidth:!0,variant:"outlined",onClick:Dr,sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:me,color:ve,"&:hover":{borderColor:Ae,bgcolor:we}},children:"Close"}),(0,xe.jsx)(B.A,{fullWidth:!0,variant:"contained",onClick:()=>{ro?no?uo?go?lo?ot.mutate({deliveryid:xo.deliveryid,orderheaderid:xo.orderheaderid,orderstatus:Ao,deliverytime:a()().format("YYYY-MM-DD HH:mm:ss"),deliverylat:uo,deliverylong:go,kms:ro,cumulativekms:no,deliveryamt:parseFloat(lo),notes:co,userid:+Ko.userid}):Rr("Fill Delivery Amount","warning"):Rr("Fill Delivery Longitude","warning"):Rr("Fill Delivery Latitude","warning"):Rr("Fill Actual Kms","warning"):Rr("Fill Kms","warning")},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#10b981",boxShadow:"0 6px 18px ".concat(We("#10b981")),"&:hover":{bgcolor:"#059669"}},children:"Update"})]})})]})]})}},23787:(e,o,r)=>{r.d(o,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var t=r(89379),n=r(80045),i=r(93230),l=r(2235),s=r(16491),d=r(82053),c=r(44414);const a=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:l,sx:s}=e,d=(0,n.A)(e,a);return(0,c.jsx)(i.A,(0,t.A)((0,t.A)({spacing:1.25,onScroll:l,sx:(0,t.A)((0,t.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),s)},d),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:n,selected:i=!1,onClick:d,children:a,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:d,sx:(0,t.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?o:"#e2e8f0",background:i?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(s.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,c.jsxs)(s.A,{sx:{p:1.5,pl:2},children:[r,a,n]})]})},u=e=>{let{children:o,columns:r=2,sx:n}=e;return(0,c.jsx)(s.A,{sx:(0,t.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:o})},p=e=>{let{label:o,value:r,children:t,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(s.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(d.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,c.jsx)(s.A,{sx:{mt:.25,minWidth:0},children:void 0!==t?t:(0,c.jsx)(d.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var t=r(89379),n=r(9950),i=r(2660),l=r(2046),s=r(83274),d=r(25333),c=r(97125),a=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const b=(0,n.useRef)(null),[v]=(0,x.d7)(o,p);return(0,n.useEffect)((()=>{u&&u(v)}),[v,u]),(0,n.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=b.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,t.A)({},f),inputRef:b,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(s.A,{title:"Clear",children:(0,h.jsx)(d.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(a.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var t=r(16491),n=r(46639),i=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(t.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(n.A,{size:o}),(0,l.jsx)(t.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:i,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>h});var t=r(89379),n=r(9950),i=r(93230),l=r(41413),s=r(77922),d=r(29925),c=r(26910),a=r(31222),x=r(44414);const h=(0,n.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:b=!1,accentColor:v="#6366f1",icon:A,placeholder:m="Select Zone",paperComponent:j}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(v).concat(e),C=y("08"),W=y("26"),k=y("55"),R=y("18"),z=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:v},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(W)},"&.Mui-focused fieldset":{borderColor:v,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:v}}:{},D=b&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:R,color:v,transition:"background-color 0.15s, color 0.15s"},children:A||(0,x.jsx)(a.HPi,{size:14})})});return(0,x.jsx)(s.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:j,sx:(0,t.A)({},p),onChange:(e,o,t)=>{"clear"===t?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===h||void 0===h||h(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>b?(0,x.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,placeholder:m,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:D}),sx:(0,t.A)((0,t.A)({},z),f||g||{})})):(0,x.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,t.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},96646:(e,o,r)=>{r.d(o,{r:()=>d});var t=r(9213),n=r(21671),i=r(82917),l=r(93230),s=r(44414);const d=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(t.A,{children:[(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,s.jsx)(n.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(i.A,{variant:"text",width:100}),(0,s.jsx)(i.A,{variant:"text",width:80})]})},o))),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:150})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(n.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/4263.640b9077.chunk.js b/build/static/js/4263.640b9077.chunk.js new file mode 100644 index 0000000..cc8558c --- /dev/null +++ b/build/static/js/4263.640b9077.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4263],{14263:(e,t,r)=>{r.r(t),r.d(t,{default:()=>T});var i=r(9950),n=r(14857),o=r(47223),s=r(16491),l=r(71525),a=r(249),c=r(26050),d=r(38614),h=r(93038),x=r(83563),u=r(74745),p=r(82917),g=r(93230),v=r(82053),m=r(88060),A=r(83239),j=r(25333),f=r(82223),w=r(99624),y=r(89379),b=r(25979),k=r(2660),C=r(2046),S=r(33425),Y=r(7762),z=r(44414);const W=e=>{let{value:t,onChange:r,sx:o,placeholder:s="Search (Ctrl + K)",delay:l=300}=e;const a=(0,n.A)(),c=(0,i.useRef)(null),[d,h]=(0,i.useState)(t||"");return(0,i.useEffect)((()=>{h(t||"")}),[t]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{d!==t&&r({target:{value:d}})}),l);return()=>clearTimeout(e)}),[d]),(0,i.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=c.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===c.current&&c.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,z.jsx)(b.A,{fullWidth:!0,children:(0,z.jsx)(k.A,{inputRef:c,placeholder:s,sx:(0,y.A)({borderRadius:0},o),value:d,onChange:e=>h(e.target.value),autoComplete:"off",size:"large",startAdornment:(0,z.jsx)(C.A,{position:"start",sx:{mr:-.5,color:a.palette.secondary.main},children:(0,z.jsx)(S.A,{})}),endAdornment:(0,z.jsx)(j.A,{sx:{visibility:d?"visible":"hidden"},onClick:()=>h(""),children:(0,z.jsx)(Y.A,{style:{fontSize:"large",color:a.palette.primary.main}})})})})};var E=r(36150),I=r(81425),M=r(10523);const R={width:"100%",height:"calc(100vh - 150px)"};function L(e){var t,r;let{riderLocations:i}=e;console.log("riderLocations",i);const n={lat:Number((null===i||void 0===i||null===(t=i[0])||void 0===t?void 0:t.latitude)||11.0056),lng:Number((null===i||void 0===i||null===(r=i[0])||void 0===r?void 0:r.longitude)||76.9661)},o={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)},s={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)};return(0,z.jsx)(M.BH,{googleMapsApiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",children:(0,z.jsx)(M.u6,{mapContainerStyle:R,zoom:12,center:n,children:i&&(null===i||void 0===i?void 0:i.map(((e,t)=>{const r=Number(e.latitude),i=Number(e.longitude);return(0,z.jsxs)("div",{children:[(0,z.jsx)(M.pH,{position:{lat:r,lng:i},icon:"active"==e.status?o:s,label:{fontSize:"14px",fontWeight:"bold"}}),(0,z.jsx)(M.i3,{position:{lat:r,lng:i},mapPaneName:M.i3.OVERLAY_LAYER,children:(0,z.jsx)("div",{style:{background:"none",color:"green",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",transform:"translate(-50%, -140%)",pointerEvents:"none",ml:20},children:(0,z.jsxs)(f.A,{variant:"contained",color:"primary",size:"small",children:[" ".concat(e.username," "),(0,z.jsx)("br",{}),"(".concat(e.orderid||"",") ")]})})})]},t)})))})})}var D=r(50027),F=r(23787),H=r(4159),K=r.n(H),_=r(96088);const N=350,T=()=>{const e=(0,n.A)(),t=(0,o.A)("(min-width:900px)"),r=(0,o.A)(e.breakpoints.down("md")),[y,b]=(0,i.useState)(!1),[k,C]=(0,i.useState)([]),[S,Y]=(0,i.useState)(""),{data:M,isLoading:R,isFetching:H,refetch:T,error:G}=(0,E.I)({queryKey:[1,K()().format("YYYY-MM-DD"),S],queryFn:I.zb,refetchInterval:3e5});return(0,i.useEffect)((()=>{C(M)}),[M]),(0,i.useEffect)((()=>{console.log("selectedRiders",k)}),[k]),(0,i.useEffect)((()=>{b(t)}),[t]),(0,z.jsx)(D.A,{content:!1,children:(0,z.jsxs)(s.A,{sx:{display:"flex",width:"100%",height:"100%",position:"relative"},children:[(0,z.jsxs)(l.Ay,{variant:t?"persistent":"temporary",open:y,onClose:()=>!t&&b(!1),ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:r?"100vw":N,maxWidth:r?"100vw":N,position:"absolute",left:0,top:0,height:"100%",overflowY:"auto",transition:"transform 0.35s ease-in-out",zIndex:13}},children:[(0,z.jsxs)(s.A,{sx:{position:"sticky",top:0,zIndex:1},children:[(0,z.jsx)(W,{value:S,placeholder:"Search Rider",onChange:e=>Y(e.target.value),sx:{height:60,bgcolor:"white","& .MuiOutlinedInput-notchedOutline":{borderBottom:"1px solid",borderColor:e.palette.secondary.light}}}),(0,z.jsxs)(a.A,{children:[(0,z.jsxs)(c.Ay,{sx:{cursor:"pointer","&:hover":{bgcolor:e.palette.secondary.lighter},bgcolor:"white",mt:-1},children:[(0,z.jsx)(d.A,{children:(0,z.jsx)(h.A,{checked:(null===M||void 0===M?void 0:M.length)==(null===k||void 0===k?void 0:k.length),onChange:e=>{e.target.checked&&C(M)}})}),(0,z.jsx)(x.A,{primary:"All"})]}),(0,z.jsx)(u.A,{})]})]}),(0,z.jsx)(a.A,{children:R||H?Array.from({length:10}).map(((e,t)=>(0,z.jsxs)(i.Fragment,{children:[(0,z.jsxs)(c.Ay,{sx:{py:1.5,px:2},children:[(0,z.jsx)(d.A,{children:(0,z.jsx)(p.A,{variant:"circular",width:24,height:24})}),(0,z.jsx)(x.A,{primary:(0,z.jsx)(p.A,{variant:"text",width:"60%",height:22}),secondary:(0,z.jsx)(p.A,{variant:"text",width:"40%",height:18})}),(0,z.jsxs)(g.A,{spacing:.5,textAlign:"right",children:[(0,z.jsx)(p.A,{variant:"text",width:50,height:18}),(0,z.jsx)(p.A,{variant:"text",width:80,height:16})]})]}),(0,z.jsx)(u.A,{})]},t))):!r&&(null===M||void 0===M?void 0:M.map((t=>{var r,n,o;return(0,z.jsxs)(i.Fragment,{children:[(0,z.jsxs)(c.Ay,{sx:{cursor:"pointer",py:1,px:2,borderRadius:1,"&:hover":{bgcolor:e.palette.secondary.lighter}},secondaryAction:(0,z.jsxs)(g.A,{textAlign:"right",spacing:.5,children:[(0,z.jsx)(v.A,{variant:"body2",noWrap:!0,sx:{color:"active"==t.status?"success.main":"error.main"},children:t.userid}),(0,z.jsx)(v.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:K()(t.logdate).format("DD/MM/YYYY hh:mm A")})]}),children:[(0,z.jsx)(d.A,{children:(0,z.jsx)(h.A,{sx:{color:"active"==t.status?"green":"red","&.Mui-checked":{color:"active"==t.status?"green":"red"}},checked:1===(null===k||void 0===k?void 0:k.length)&&(null===(r=k[0])||void 0===r?void 0:r.userid)===(null===t||void 0===t?void 0:t.userid),onChange:e=>{e.target.checked?C([t]):C(M)}})}),(0,z.jsx)(x.A,{primary:(0,z.jsxs)(v.A,{noWrap:!0,children:[(null===(n=t.username)||void 0===n?void 0:n.slice(0,25))||"",(null===(o=t.username)||void 0===o?void 0:o.length)>25&&"..."]}),secondary:(0,z.jsx)(v.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:t.contactno||"##########"})})]}),(0,z.jsx)(u.A,{})]},t.userid)})))}),r&&!R&&!H&&(0,z.jsx)(F.nV,{children:null===M||void 0===M?void 0:M.map((e=>{var t,r,i;const n="active"==e.status,o=1===(null===k||void 0===k?void 0:k.length)&&(null===(t=k[0])||void 0===t?void 0:t.userid)===(null===e||void 0===e?void 0:e.userid);return(0,z.jsx)(F.pg,{accent:n?"#10b981":"#ef4444",selected:o,header:(0,z.jsxs)(g.A,{direction:"row",alignItems:"flex-start",spacing:1,children:[(0,z.jsx)(h.A,{sx:{p:.5,color:n?"green":"red","&.Mui-checked":{color:n?"green":"red"}},checked:o,onChange:t=>{t.target.checked?C([e]):C(M)}}),(0,z.jsxs)(s.A,{sx:{minWidth:0,flexGrow:1},children:[(0,z.jsxs)(v.A,{noWrap:!0,sx:{fontWeight:600},children:[(null===(r=e.username)||void 0===r?void 0:r.slice(0,25))||"",(null===(i=e.username)||void 0===i?void 0:i.length)>25&&"..."]}),(0,z.jsx)(v.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:e.contactno||"##########"})]})]}),children:(0,z.jsxs)(F.FG,{children:[(0,z.jsx)(F.pY,{label:"User ID",children:(0,z.jsx)(v.A,{sx:{fontSize:13,fontWeight:600,color:n?"success.main":"error.main"},noWrap:!0,children:e.userid})}),(0,z.jsx)(F.pY,{label:"Status",value:n?"Active":"Inactive"}),(0,z.jsx)(F.pY,{label:"Last Log",value:K()(e.logdate).format("DD/MM/YYYY hh:mm A"),full:!0})]})},e.userid)}))})]}),(0,z.jsx)(m.A,{elevation:0,position:"absolute",sx:{top:0,left:y&&t?"".concat(N,"px"):0,width:y&&t?"calc(100% - ".concat(N,"px)"):"100%",transition:"left 0.3s ease, width 0.3s ease",backgroundColor:"white",borderBottom:"1px solid",borderColor:e.palette.secondary.light},children:(0,z.jsx)(A.A,{children:(0,z.jsxs)(g.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{width:"100%"},children:[(0,z.jsxs)(g.A,{direction:"row",alignItems:"center",children:[(0,z.jsx)(j.A,{color:"primary",onClick:()=>b(!y),children:(0,z.jsx)(w.A,{})}),(0,z.jsx)(v.A,{variant:"h5",color:"primary",sx:{ml:2},children:"Riders Locations"})]}),(0,z.jsx)(f.A,{variant:"outlined",color:"primary",onClick:()=>{T()},children:"Refresh"})]})})}),(0,z.jsxs)(s.A,{sx:{flexGrow:1,overflow:"auto",pt:"64px",pl:y&&t?"".concat(N,"px"):0,transition:"padding-left 0.3s ease",minHeight:"80vh"},children:[(R||H)&&(0,z.jsx)(s.A,{position:"relative",width:"100%",height:"80vh",display:"grid",placeItems:"center",children:(0,z.jsx)(p.A,{variant:"rectangular",width:"100%",height:"100%",animation:"wave",sx:{position:"absolute",top:0,left:0,borderRadius:1,zIndex:1}})}),(null===k||void 0===k?void 0:k.length)>0&&(0,z.jsx)(L,{riderLocations:k}),G&&(0,z.jsx)(s.A,{sx:{width:"100% ",height:"100%"},children:(0,z.jsx)("img",{src:_,alt:"mantis",style:{height:"100%",width:"100%"}})})]})]})})}},23787:(e,t,r)=>{r.d(t,{FG:()=>u,nV:()=>h,pY:()=>p,pg:()=>x});var i=r(89379),n=r(80045),o=r(93230),s=r(2235),l=r(16491),a=r(82053),c=r(44414);const d=["children","scroll","onScroll","sx"],h=e=>{let{children:t,scroll:r=!1,onScroll:s,sx:l}=e,a=(0,n.A)(e,d);return(0,c.jsx)(o.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:s,sx:(0,i.A)((0,i.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},x=e=>{let{accent:t="#662582",header:r,footer:n,selected:o=!1,onClick:a,children:d,sx:h}=e;return(0,c.jsxs)(s.A,{elevation:0,onClick:a,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:o?t:"#e2e8f0",background:o?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},h),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[r,d,n]})]})},u=e=>{let{children:t,columns:r=2,sx:n}=e;return(0,c.jsx)(l.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:t})},p=e=>{let{label:t,value:r,children:i,full:n=!1,align:o="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:o},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},96088:(e,t,r)=>{e.exports=r.p+"static/media/Error500.1619a596c73d5cce4899.png"}}]); \ No newline at end of file diff --git a/build/static/js/4263.b73de124.chunk.js b/build/static/js/4263.b73de124.chunk.js deleted file mode 100644 index a0cd9ef..0000000 --- a/build/static/js/4263.b73de124.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4263],{14263:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var i=r(9950),n=r(14857),o=r(47223),s=r(16491),a=r(71525),l=r(249),c=r(26050),d=r(38614),h=r(93038),x=r(83563),u=r(74745),p=r(82917),g=r(93230),m=r(82053),v=r(88060),A=r(83239),j=r(25333),y=r(82223),f=r(99624),w=r(89379),b=r(25979),k=r(2660),C=r(2046),S=r(33425),z=r(7762),E=r(44414);const Y=e=>{let{value:t,onChange:r,sx:o,placeholder:s="Search (Ctrl + K)",delay:a=300}=e;const l=(0,n.A)(),c=(0,i.useRef)(null),[d,h]=(0,i.useState)(t||"");return(0,i.useEffect)((()=>{h(t||"")}),[t]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{d!==t&&r({target:{value:d}})}),a);return()=>clearTimeout(e)}),[d]),(0,i.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=c.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===c.current&&c.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,E.jsx)(b.A,{fullWidth:!0,children:(0,E.jsx)(k.A,{inputRef:c,placeholder:s,sx:(0,w.A)({borderRadius:0},o),value:d,onChange:e=>h(e.target.value),autoComplete:"off",size:"large",startAdornment:(0,E.jsx)(C.A,{position:"start",sx:{mr:-.5,color:l.palette.secondary.main},children:(0,E.jsx)(S.A,{})}),endAdornment:(0,E.jsx)(j.A,{sx:{visibility:d?"visible":"hidden"},onClick:()=>h(""),children:(0,E.jsx)(z.A,{style:{fontSize:"large",color:l.palette.primary.main}})})})})};var R=r(36150),I=r(81425),M=r(10523);const L={width:"100%",height:"calc(100vh - 150px)"};function W(e){var t,r;let{riderLocations:i}=e;console.log("riderLocations",i);const n={lat:Number((null===i||void 0===i||null===(t=i[0])||void 0===t?void 0:t.latitude)||11.0056),lng:Number((null===i||void 0===i||null===(r=i[0])||void 0===r?void 0:r.longitude)||76.9661)},o={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)},s={url:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",scaledSize:new window.google.maps.Size(25,41),anchor:new window.google.maps.Point(12,41)};return(0,E.jsx)(M.BH,{googleMapsApiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",children:(0,E.jsx)(M.u6,{mapContainerStyle:L,zoom:12,center:n,children:i&&(null===i||void 0===i?void 0:i.map(((e,t)=>{const r=Number(e.latitude),i=Number(e.longitude);return(0,E.jsxs)("div",{children:[(0,E.jsx)(M.pH,{position:{lat:r,lng:i},icon:"active"==e.status?o:s,label:{fontSize:"14px",fontWeight:"bold"}}),(0,E.jsx)(M.i3,{position:{lat:r,lng:i},mapPaneName:M.i3.OVERLAY_LAYER,children:(0,E.jsx)("div",{style:{background:"none",color:"green",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",transform:"translate(-50%, -140%)",pointerEvents:"none",ml:20},children:(0,E.jsxs)(y.A,{variant:"contained",color:"primary",size:"small",children:[" ".concat(e.username," "),(0,E.jsx)("br",{}),"(".concat(e.orderid||"",") ")]})})})]},t)})))})})}var D=r(50027),K=r(4159),_=r.n(K),F=r(96088);const H=350,N=()=>{const e=(0,n.A)(),t=(0,o.A)("(min-width:900px)"),[r,w]=(0,i.useState)(!1),[b,k]=(0,i.useState)([]),[C,S]=(0,i.useState)(""),{data:z,isLoading:M,isFetching:L,refetch:K,error:N}=(0,R.I)({queryKey:[1,_()().format("YYYY-MM-DD"),C],queryFn:I.zb,refetchInterval:3e5});return(0,i.useEffect)((()=>{k(z)}),[z]),(0,i.useEffect)((()=>{console.log("selectedRiders",b)}),[b]),(0,i.useEffect)((()=>{w(t)}),[t]),(0,E.jsx)(D.A,{content:!1,children:(0,E.jsxs)(s.A,{sx:{display:"flex",width:"100%",height:"100%",position:"relative"},children:[(0,E.jsxs)(a.Ay,{variant:t?"persistent":"temporary",open:r,onClose:()=>!t&&w(!1),ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:H,position:"absolute",left:0,top:0,height:"100%",overflowY:"auto",transition:"transform 0.35s ease-in-out",zIndex:13}},children:[(0,E.jsxs)(s.A,{sx:{position:"sticky",top:0,zIndex:1},children:[(0,E.jsx)(Y,{value:C,placeholder:"Search Rider",onChange:e=>S(e.target.value),sx:{height:60,bgcolor:"white","& .MuiOutlinedInput-notchedOutline":{borderBottom:"1px solid",borderColor:e.palette.secondary.light}}}),(0,E.jsxs)(l.A,{children:[(0,E.jsxs)(c.Ay,{sx:{cursor:"pointer","&:hover":{bgcolor:e.palette.secondary.lighter},bgcolor:"white",mt:-1},children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(h.A,{checked:(null===z||void 0===z?void 0:z.length)==(null===b||void 0===b?void 0:b.length),onChange:e=>{e.target.checked&&k(z)}})}),(0,E.jsx)(x.A,{primary:"All"})]}),(0,E.jsx)(u.A,{})]})]}),(0,E.jsx)(l.A,{children:M||L?Array.from({length:10}).map(((e,t)=>(0,E.jsxs)(i.Fragment,{children:[(0,E.jsxs)(c.Ay,{sx:{py:1.5,px:2},children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(p.A,{variant:"circular",width:24,height:24})}),(0,E.jsx)(x.A,{primary:(0,E.jsx)(p.A,{variant:"text",width:"60%",height:22}),secondary:(0,E.jsx)(p.A,{variant:"text",width:"40%",height:18})}),(0,E.jsxs)(g.A,{spacing:.5,textAlign:"right",children:[(0,E.jsx)(p.A,{variant:"text",width:50,height:18}),(0,E.jsx)(p.A,{variant:"text",width:80,height:16})]})]}),(0,E.jsx)(u.A,{})]},t))):null===z||void 0===z?void 0:z.map((t=>{var r,n,o;return(0,E.jsxs)(i.Fragment,{children:[(0,E.jsxs)(c.Ay,{sx:{cursor:"pointer",py:1,px:2,borderRadius:1,"&:hover":{bgcolor:e.palette.secondary.lighter}},secondaryAction:(0,E.jsxs)(g.A,{textAlign:"right",spacing:.5,children:[(0,E.jsx)(m.A,{variant:"body2",noWrap:!0,sx:{color:"active"==t.status?"success.main":"error.main"},children:t.userid}),(0,E.jsx)(m.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:_()(t.logdate).format("DD/MM/YYYY hh:mm A")})]}),children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(h.A,{sx:{color:"active"==t.status?"green":"red","&.Mui-checked":{color:"active"==t.status?"green":"red"}},checked:1===(null===b||void 0===b?void 0:b.length)&&(null===(r=b[0])||void 0===r?void 0:r.userid)===(null===t||void 0===t?void 0:t.userid),onChange:e=>{e.target.checked?k([t]):k(z)}})}),(0,E.jsx)(x.A,{primary:(0,E.jsxs)(m.A,{noWrap:!0,children:[(null===(n=t.username)||void 0===n?void 0:n.slice(0,25))||"",(null===(o=t.username)||void 0===o?void 0:o.length)>25&&"..."]}),secondary:(0,E.jsx)(m.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:t.contactno||"##########"})})]}),(0,E.jsx)(u.A,{})]},t.userid)}))})]}),(0,E.jsx)(v.A,{elevation:0,position:"absolute",sx:{top:0,left:r&&t?"".concat(H,"px"):0,width:r&&t?"calc(100% - ".concat(H,"px)"):"100%",transition:"left 0.3s ease, width 0.3s ease",backgroundColor:"white",borderBottom:"1px solid",borderColor:e.palette.secondary.light},children:(0,E.jsx)(A.A,{children:(0,E.jsxs)(g.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{width:"100%"},children:[(0,E.jsxs)(g.A,{direction:"row",alignItems:"center",children:[(0,E.jsx)(j.A,{color:"primary",onClick:()=>w(!r),children:(0,E.jsx)(f.A,{})}),(0,E.jsx)(m.A,{variant:"h5",color:"primary",sx:{ml:2},children:"Riders Locations"})]}),(0,E.jsx)(y.A,{variant:"outlined",color:"primary",onClick:()=>{K()},children:"Refresh"})]})})}),(0,E.jsxs)(s.A,{sx:{flexGrow:1,overflow:"auto",pt:"64px",pl:r&&t?"".concat(H,"px"):0,transition:"padding-left 0.3s ease",minHeight:"80vh"},children:[(M||L)&&(0,E.jsx)(s.A,{position:"relative",width:"100%",height:"80vh",display:"grid",placeItems:"center",children:(0,E.jsx)(p.A,{variant:"rectangular",width:"100%",height:"100%",animation:"wave",sx:{position:"absolute",top:0,left:0,borderRadius:1,zIndex:1}})}),(null===b||void 0===b?void 0:b.length)>0&&(0,E.jsx)(W,{riderLocations:b}),N&&(0,E.jsx)(s.A,{sx:{width:"100% ",height:"100%"},children:(0,E.jsx)("img",{src:F,alt:"mantis",style:{height:"100%",width:"100%"}})})]})]})})}},96088:(e,t,r)=>{e.exports=r.p+"static/media/Error500.1619a596c73d5cce4899.png"}}]); \ No newline at end of file diff --git a/build/static/js/4793.84e511ac.chunk.js b/build/static/js/4793.84e511ac.chunk.js new file mode 100644 index 0000000..301bf0e --- /dev/null +++ b/build/static/js/4793.84e511ac.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4793],{20466:(e,t,a)=>{a.d(t,{k:()=>n});var o=a(8881);const n=(e,t,a)=>(0,o.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||2e3})},23266:(e,t,a)=>{a.d(t,{A:()=>w});var o=a(98587),n=a(58168),s=a(9950),i=a(72004),l=a(3484),r=a(99269),c=a(59254),d=a(19608),u=a(18463),p=a(13372),m=a(24184),g=a(79044),h=a(31506),A=a(40777),v=a(92455),x=a(88543),f=a(45558),b=a(1614);function y(e){return(0,b.Ay)("MuiMenuItem",e)}const j=(0,f.A)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var C=a(44414);const _=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],S=(0,c.Ay)(m.A,{shouldForwardProp:e=>(0,d.A)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,a.dense&&t.dense,a.divider&&t.divider,!a.disableGutters&&t.gutters]}})((e=>{let{theme:t,ownerState:a}=e;return(0,n.A)({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.divider&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider),backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(j.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(j.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},["&.".concat(j.selected,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity)}},["&.".concat(j.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(j.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},["& + .".concat(A.A.root)]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},["& + .".concat(A.A.inset)]:{marginLeft:52},["& .".concat(x.A.root)]:{marginTop:0,marginBottom:0},["& .".concat(x.A.inset)]:{paddingLeft:36},["& .".concat(v.A.root)]:{minWidth:36}},!a.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},a.dense&&(0,n.A)({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{["& .".concat(v.A.root," svg")]:{fontSize:"1.25rem"}}))})),w=s.forwardRef((function(e,t){const a=(0,u.b)({props:e,name:"MuiMenuItem"}),{autoFocus:r=!1,component:c="li",dense:d=!1,divider:m=!1,disableGutters:A=!1,focusVisibleClassName:v,role:x="menuitem",tabIndex:f,className:b}=a,j=(0,o.A)(a,_),w=s.useContext(p.A),k=s.useMemo((()=>({dense:d||w.dense||!1,disableGutters:A})),[w.dense,d,A]),I=s.useRef(null);(0,g.A)((()=>{r&&I.current&&I.current.focus()}),[r]);const M=(0,n.A)({},a,{dense:k.dense,divider:m,disableGutters:A}),O=(e=>{const{disabled:t,dense:a,divider:o,disableGutters:s,selected:i,classes:r}=e,c={root:["root",a&&"dense",t&&"disabled",!s&&"gutters",o&&"divider",i&&"selected"]},d=(0,l.A)(c,y,r);return(0,n.A)({},r,d)})(a),N=(0,h.A)(I,t);let E;return a.disabled||(E=void 0!==f?f:-1),(0,C.jsx)(p.A.Provider,{value:k,children:(0,C.jsx)(S,(0,n.A)({ref:N,role:x,tabIndex:E,component:c,focusVisibleClassName:(0,i.A)(O.focusVisible,v),className:(0,i.A)(O.root,b)},j,{ownerState:M,classes:O}))})}))},59212:(e,t,a)=>{a.d(t,{A:()=>p});var o=a(89379),n=a(9950),s=a(93230),i=a(41413),l=a(77922),r=a(29925),c=a(26910),d=a(31222),u=a(44414);const p=(0,n.forwardRef)(((e,t)=>{let{setAppId:a,setLocoName:p,setPage:m,sx:g,textfeildSx:h,textfieldSx:A,pill:v=!1,accentColor:x="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:y}=e;const[j,C]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===j.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),C(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[j.length]);const _=e=>"".concat(x).concat(e),S=_("08"),w=_("26"),k=_("55"),I=_("18"),M=v?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:S,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:x},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(w)},"&.Mui-focused fieldset":{borderColor:x,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:x}}:{},O=v&&(0,u.jsx)(s.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,u.jsx)(i.A,{sx:{width:24,height:24,bgcolor:I,color:x,transition:"background-color 0.15s, color 0.15s"},children:f||(0,u.jsx)(d.HPi,{size:14})})});return(0,u.jsx)(l.A,{id:"location-autocomplete",options:j||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:y,sx:(0,o.A)({},g),onChange:(e,t,o)=>{"clear"===o?(null===a||void 0===a||a(0),null===p||void 0===p||p(""),null===m||void 0===m||m(0)):t&&(null===a||void 0===a||a(t.applocationid),null===p||void 0===p||p(t.locationname),null===m||void 0===m||m(0))},renderInput:e=>v?(0,u.jsx)(r.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:O}),sx:(0,o.A)((0,o.A)({},M),A||h||{})})):(0,u.jsx)(r.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},A||h||{})}))})}))},94793:(e,t,a)=>{a.r(t),a.d(t,{default:()=>k});var o=a(89379),n=a(9950),s=a(14857),i=a(47223),l=a(60899),r=a(93230),c=a(82053),d=a(77922),u=a(29925),p=a(19647),m=a(70006),g=a(23266),h=a(25333),A=a(82223),v=a(50027),x=a(26910),f=a(52351),b=a(99459),y=a(8881),j=a(28429),C=a(96319),_=a(59212),S=a(20466),w=a(44414);const k=()=>{const e=(0,s.A)(),t=(0,i.A)(e.breakpoints.down("md")),[a,k]=(0,n.useState)(0),I=(0,n.useRef)(null),[M,O]=(0,n.useState)(""),[N,E]=(0,n.useState)(""),[L,F]=(0,n.useState)(""),[W,z]=(0,n.useState)(""),[P,H]=(0,n.useState)(""),[R,D]=(0,n.useState)(""),[B,V]=(0,n.useState)(""),[G,T]=(0,n.useState)(),[X,Z]=(0,n.useState)(),[J,K]=(0,n.useState)(),[Y,q]=(0,n.useState)("Select Location"),[Q,U]=(0,n.useState)([]),[$,ee]=(0,n.useState)(0),[te,ae]=(0,n.useState)({}),[oe,ne]=(0,n.useState)({latitude:0,longitude:0}),[se,ie]=(0,n.useState)(!1),le=(0,j.Zp)();b.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,n.useEffect)((()=>{if(B){const e=document.getElementById("addressAuto1"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(G,X),radius:1e3*J}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();V("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log(" pick (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),ne({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),F("".concat(e.name," ").concat(e.formatted_address)),ae((0,o.A)((0,o.A)({},te),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),ae((0,o.A)((0,o.A)({},te),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.administrative_area_level_3,city:a.locality,state:a.administrative_area_level_1,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Pick Address:",a)}))}}),[B]);(0,n.useEffect)((()=>{a&&(async()=>{ie(!0),await x.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocations/?applocationid=").concat(a)).then((e=>{console.log("getapplocations",e);const{latitude:t,longitude:a,radius:o}=e.data.details[0];e.data.status&&(T(t),Z(a),K(o),console.log("radius",o)),ie(!1)})).catch((e=>{console.log(e),ie(!1)}))})()}),[a]);(0,n.useEffect)((()=>{a&&(async e=>{ie(!0),await x.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(e,"&status=active")).then((e=>{if(console.log(e),e.data.status){let t=[];e.data.details.map((e=>{t.push((0,o.A)((0,o.A)({},e),{},{label:"".concat(e.tenantname)}))})),U(t)}ie(!1)})).catch((e=>{console.log(e),ie(!1)}))})(a)}),[a]);const re=e=>{(0,y.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})};return(0,w.jsxs)(w.Fragment,{children:[se&&(0,w.jsx)(f.A,{}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sx:{mb:2},children:(0,w.jsx)(r.A,{direction:"row",justifyContent:"space-between",alignItems:"center",children:(0,w.jsx)(c.A,{variant:"h3",children:"Create Customer"})})}),(0,w.jsx)(v.A,{sx:{p:{xs:1.5,md:3}},children:(0,w.jsxs)(l.Ay,{container:!0,spacing:{xs:2,md:3},children:[(0,w.jsx)(l.Ay,{item:!0,xs:12,children:(0,w.jsxs)(l.Ay,{container:!0,spacing:{xs:2,md:3},children:[(0,w.jsx)(l.Ay,{item:!0,xs:12,md:6,children:(0,w.jsx)(_.A,{ref:I,locaName:Y,setAppId:k,setLocoName:q,sx:{}})}),(0,w.jsxs)(l.Ay,{item:!0,xs:12,md:6,children:[(0,w.jsx)(d.A,{fullWidth:!0,disabled:0==a,id:"free-solo-demo",sx:{},options:Q||[],renderInput:e=>(0,w.jsx)(u.A,(0,o.A)((0,o.A)({},e),{},{label:"Choose Client",focused:!0})),onChange:(e,t,a)=>{t?(console.log("Client",t),(async e=>{try{const t=await x.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e));console.log("gettenantlocations",t.data.details),t.data.details.length}catch(t){console.log("gettenantlocations",t)}})(t.tenantid),ee(t.tenantid)):(setClientinfo({}),setTenantid(""))}})," "]}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-last-name",children:"Name"}),(0,w.jsx)(u.A,{fullWidth:!0,id:"personal-last-name",placeholder:"Name",onChange:e=>z(e.target.value),value:W,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,w.jsxs)(r.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,w.jsx)(m.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,w.jsx)(g.A,{value:"+1",children:"+91"})}),(0,w.jsx)(u.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&O(e.target.value)},value:M,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-email",children:"Email "}),(0,w.jsx)(u.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email ",onChange:e=>E(e.target.value),value:N,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-location",children:"Door No"}),(0,w.jsx)(u.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>H(e.target.value),value:P,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-email",children:" Address"}),(0,w.jsx)(u.A,{variant:"outlined",id:"addressAuto1",fullWidth:!0,value:B,onChange:e=>{a?a&&V(e.target.value):(0,S.k)("Select Location First","warning",3e3)},InputProps:{endAdornment:(0,w.jsx)(h.A,{onClick:()=>{V(""),ae((0,o.A)((0,o.A)({},te),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),ne({latitude:0,longitude:0})},size:"small",children:(0,w.jsx)(C.A,{})})}})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-location",children:"Location"}),(0,w.jsx)(u.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>ae((0,o.A)((0,o.A)({},te),{},{suburb:e.target.value})),value:te.suburb,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-zipcode",children:"City"}),(0,w.jsx)(u.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>ae((0,o.A)((0,o.A)({},te),{},{city:e.target.value})),value:te.city,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-location",children:"State"}),(0,w.jsx)(u.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>ae((0,o.A)((0,o.A)({},te),{},{state:e.target.value})),value:te.state,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,w.jsx)(u.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>ae((0,o.A)((0,o.A)({},te),{},{postcode:e.target.value})),value:te.postcode,autoComplete:"off"})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,children:(0,w.jsxs)(r.A,{spacing:1.25,children:[(0,w.jsx)(p.A,{htmlFor:"personal-email",children:"Landmark"}),(0,w.jsx)(u.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>D(e.target.value),value:R,autoComplete:"off"})]})})]})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,children:(0,w.jsx)(r.A,{direction:{xs:"column",sm:"row"},justifyContent:"flex-end",alignItems:{xs:"stretch",sm:"center"},spacing:2,children:(0,w.jsx)(A.A,{variant:"contained",fullWidth:t,onClick:()=>{""===a?re("Select Applocation "):""===$?re("Select Tenant"):""===W?re("Enter Name"):""===M?re("Enter Mobile Number "):""===L?re("Enter Address "):""===te.city?re("Enter City "):""===te.state?re("Enter State "):""===te.suburb?re("Enter location "):""===te.postcode?re("Enter Post Code "):""===R?re("Enter Land Mark "):""===te.latitude?re("Invalid latitude "):""===te.longitude?re("Invaiid Longitude "):(async()=>{let e={applocationid:+a,tenantid:+$,customerid:0,configid:1,firstname:W,dialcode:"+91",contactno:M,email:N,doorno:P,address:te.address,suburb:te.suburb,city:te.city,state:te.state,postcode:te.postcode,landmark:R,latitude:oe.latitude.toString(),longitude:oe.longitude.toString(),profileimage:"",devicetype:"",deviceid:"",customertoken:"",primaryaddress:1};console.log(e),ie(!0);try{await x.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),e).then((e=>{console.log(e),e.data.status?((0,y.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),le("/nearle/customers")):"Customer Already available"==e.data.message&&(0,y.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ie(!1)})).catch((e=>{console.log(e),ie(!1),(0,y.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(t){console.log(t),ie(!1)}})()},children:"Create"})})})]})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/4793.ba46570e.chunk.js b/build/static/js/4793.ba46570e.chunk.js deleted file mode 100644 index 0954f22..0000000 --- a/build/static/js/4793.ba46570e.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4793],{20466:(e,t,a)=>{a.d(t,{k:()=>n});var o=a(8881);const n=(e,t,a)=>(0,o.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||2e3})},23266:(e,t,a)=>{a.d(t,{A:()=>w});var o=a(98587),n=a(58168),s=a(9950),i=a(72004),l=a(3484),r=a(99269),c=a(59254),d=a(19608),u=a(18463),p=a(13372),m=a(24184),g=a(79044),h=a(31506),A=a(40777),v=a(92455),x=a(88543),f=a(45558),b=a(1614);function y(e){return(0,b.Ay)("MuiMenuItem",e)}const j=(0,f.A)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var C=a(44414);const _=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],S=(0,c.Ay)(m.A,{shouldForwardProp:e=>(0,d.A)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,a.dense&&t.dense,a.divider&&t.divider,!a.disableGutters&&t.gutters]}})((e=>{let{theme:t,ownerState:a}=e;return(0,n.A)({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.divider&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider),backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},["&.".concat(j.selected)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity),["&.".concat(j.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},["&.".concat(j.selected,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.primary.mainChannel," / ").concat(t.vars.palette.action.selectedOpacity,")"):(0,r.X4)(t.palette.primary.main,t.palette.action.selectedOpacity)}},["&.".concat(j.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["&.".concat(j.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity},["& + .".concat(A.A.root)]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},["& + .".concat(A.A.inset)]:{marginLeft:52},["& .".concat(x.A.root)]:{marginTop:0,marginBottom:0},["& .".concat(x.A.inset)]:{paddingLeft:36},["& .".concat(v.A.root)]:{minWidth:36}},!a.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},a.dense&&(0,n.A)({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{["& .".concat(v.A.root," svg")]:{fontSize:"1.25rem"}}))})),w=s.forwardRef((function(e,t){const a=(0,u.b)({props:e,name:"MuiMenuItem"}),{autoFocus:r=!1,component:c="li",dense:d=!1,divider:m=!1,disableGutters:A=!1,focusVisibleClassName:v,role:x="menuitem",tabIndex:f,className:b}=a,j=(0,o.A)(a,_),w=s.useContext(p.A),k=s.useMemo((()=>({dense:d||w.dense||!1,disableGutters:A})),[w.dense,d,A]),I=s.useRef(null);(0,g.A)((()=>{r&&I.current&&I.current.focus()}),[r]);const M=(0,n.A)({},a,{dense:k.dense,divider:m,disableGutters:A}),O=(e=>{const{disabled:t,dense:a,divider:o,disableGutters:s,selected:i,classes:r}=e,c={root:["root",a&&"dense",t&&"disabled",!s&&"gutters",o&&"divider",i&&"selected"]},d=(0,l.A)(c,y,r);return(0,n.A)({},r,d)})(a),N=(0,h.A)(I,t);let E;return a.disabled||(E=void 0!==f?f:-1),(0,C.jsx)(p.A.Provider,{value:k,children:(0,C.jsx)(S,(0,n.A)({ref:N,role:x,tabIndex:E,component:c,focusVisibleClassName:(0,i.A)(O.focusVisible,v),className:(0,i.A)(O.root,b)},j,{ownerState:M,classes:O}))})}))},59212:(e,t,a)=>{a.d(t,{A:()=>p});var o=a(89379),n=a(9950),s=a(93230),i=a(41413),l=a(77922),r=a(29925),c=a(26910),d=a(31222),u=a(44414);const p=(0,n.forwardRef)(((e,t)=>{let{setAppId:a,setLocoName:p,setPage:m,sx:g,textfeildSx:h,textfieldSx:A,pill:v=!1,accentColor:x="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:y}=e;const[j,C]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===j.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),C(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[j.length]);const _=e=>"".concat(x).concat(e),S=_("08"),w=_("26"),k=_("55"),I=_("18"),M=v?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:S,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:x},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(w)},"&.Mui-focused fieldset":{borderColor:x,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:x}}:{},O=v&&(0,u.jsx)(s.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,u.jsx)(i.A,{sx:{width:24,height:24,bgcolor:I,color:x,transition:"background-color 0.15s, color 0.15s"},children:f||(0,u.jsx)(d.HPi,{size:14})})});return(0,u.jsx)(l.A,{id:"location-autocomplete",options:j||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:y,sx:(0,o.A)({},g),onChange:(e,t,o)=>{"clear"===o?(null===a||void 0===a||a(0),null===p||void 0===p||p(""),null===m||void 0===m||m(0)):t&&(null===a||void 0===a||a(t.applocationid),null===p||void 0===p||p(t.locationname),null===m||void 0===m||m(0))},renderInput:e=>v?(0,u.jsx)(r.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:O}),sx:(0,o.A)((0,o.A)({},M),A||h||{})})):(0,u.jsx)(r.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},A||h||{})}))})}))},94793:(e,t,a)=>{a.r(t),a.d(t,{default:()=>S});var o=a(89379),n=a(9950),s=a(60899),i=a(93230),l=a(82053),r=a(77922),c=a(29925),d=a(19647),u=a(70006),p=a(23266),m=a(25333),g=a(82223),h=a(50027),A=a(26910),v=a(52351),x=a(99459),f=a(8881),b=a(28429),y=a(96319),j=a(59212),C=a(20466),_=a(44414);const S=()=>{const[e,t]=(0,n.useState)(0),a=(0,n.useRef)(null),[S,w]=(0,n.useState)(""),[k,I]=(0,n.useState)(""),[M,O]=(0,n.useState)(""),[N,E]=(0,n.useState)(""),[L,F]=(0,n.useState)(""),[z,W]=(0,n.useState)(""),[P,H]=(0,n.useState)(""),[R,D]=(0,n.useState)(),[B,V]=(0,n.useState)(),[G,T]=(0,n.useState)(),[X,Z]=(0,n.useState)("Select Location"),[J,K]=(0,n.useState)([]),[Y,q]=(0,n.useState)(0),[Q,U]=(0,n.useState)({}),[$,ee]=(0,n.useState)({latitude:0,longitude:0}),[te,ae]=(0,n.useState)(!1),oe=(0,b.Zp)();x.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,n.useEffect)((()=>{if(P){const e=document.getElementById("addressAuto1"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(R,B),radius:1e3*G}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();H("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log(" pick (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),ee({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),O("".concat(e.name," ").concat(e.formatted_address)),U((0,o.A)((0,o.A)({},Q),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),U((0,o.A)((0,o.A)({},Q),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.administrative_area_level_3,city:a.locality,state:a.administrative_area_level_1,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Pick Address:",a)}))}}),[P]);(0,n.useEffect)((()=>{e&&(async()=>{ae(!0),await A.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocations/?applocationid=").concat(e)).then((e=>{console.log("getapplocations",e);const{latitude:t,longitude:a,radius:o}=e.data.details[0];e.data.status&&(D(t),V(a),T(o),console.log("radius",o)),ae(!1)})).catch((e=>{console.log(e),ae(!1)}))})()}),[e]);(0,n.useEffect)((()=>{e&&(async e=>{ae(!0),await A.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(e,"&status=active")).then((e=>{if(console.log(e),e.data.status){let t=[];e.data.details.map((e=>{t.push((0,o.A)((0,o.A)({},e),{},{label:"".concat(e.tenantname)}))})),K(t)}ae(!1)})).catch((e=>{console.log(e),ae(!1)}))})(e)}),[e]);const ne=e=>{(0,f.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})};return(0,_.jsxs)(_.Fragment,{children:[te&&(0,_.jsx)(v.A,{}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sx:{mb:2},children:(0,_.jsx)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",children:(0,_.jsx)(l.A,{variant:"h3",children:"Create Customer"})})}),(0,_.jsx)(h.A,{children:(0,_.jsxs)(s.Ay,{container:!0,spacing:3,children:[(0,_.jsx)(s.Ay,{item:!0,xs:12,children:(0,_.jsxs)(s.Ay,{container:!0,spacing:3,children:[(0,_.jsx)(s.Ay,{item:!0,xs:12,md:6,children:(0,_.jsx)(j.A,{ref:a,locaName:X,setAppId:t,setLocoName:Z,sx:{}})}),(0,_.jsxs)(s.Ay,{item:!0,xs:12,md:6,children:[(0,_.jsx)(r.A,{fullWidth:!0,disabled:0==e,id:"free-solo-demo",sx:{},options:J||[],renderInput:e=>(0,_.jsx)(c.A,(0,o.A)((0,o.A)({},e),{},{label:"Choose Client",focused:!0})),onChange:(e,t,a)=>{t?(console.log("Client",t),(async e=>{try{const t=await A.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e));console.log("gettenantlocations",t.data.details),t.data.details.length}catch(t){console.log("gettenantlocations",t)}})(t.tenantid),q(t.tenantid)):(setClientinfo({}),setTenantid(""))}})," "]}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-last-name",children:"Name"}),(0,_.jsx)(c.A,{fullWidth:!0,id:"personal-last-name",placeholder:"Name",onChange:e=>E(e.target.value),value:N,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,_.jsxs)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,_.jsx)(u.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,_.jsx)(p.A,{value:"+1",children:"+91"})}),(0,_.jsx)(c.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{e.target.value.toString().length<=10&&w(e.target.value)},value:S,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-email",children:"Email "}),(0,_.jsx)(c.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email ",onChange:e=>I(e.target.value),value:k,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-location",children:"Door No"}),(0,_.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"Door No",onChange:e=>F(e.target.value),value:L,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-email",children:" Address"}),(0,_.jsx)(c.A,{variant:"outlined",id:"addressAuto1",fullWidth:!0,value:P,onChange:t=>{e?e&&H(t.target.value):(0,C.k)("Select Location First","warning",3e3)},InputProps:{endAdornment:(0,_.jsx)(m.A,{onClick:()=>{H(""),U((0,o.A)((0,o.A)({},Q),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),ee({latitude:0,longitude:0})},size:"small",children:(0,_.jsx)(y.A,{})})}})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-location",children:"Location"}),(0,_.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>U((0,o.A)((0,o.A)({},Q),{},{suburb:e.target.value})),value:Q.suburb,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-zipcode",children:"City"}),(0,_.jsx)(c.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>U((0,o.A)((0,o.A)({},Q),{},{city:e.target.value})),value:Q.city,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-location",children:"State"}),(0,_.jsx)(c.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>U((0,o.A)((0,o.A)({},Q),{},{state:e.target.value})),value:Q.state,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,sm:6,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-zipcode",children:"Post Code"}),(0,_.jsx)(c.A,{fullWidth:!0,type:"number",id:"personal-zipcode",placeholder:"Zipcode",onChange:e=>U((0,o.A)((0,o.A)({},Q),{},{postcode:e.target.value})),value:Q.postcode,autoComplete:"off"})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,children:(0,_.jsxs)(i.A,{spacing:1.25,children:[(0,_.jsx)(d.A,{htmlFor:"personal-email",children:"Landmark"}),(0,_.jsx)(c.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Landmark",onChange:e=>W(e.target.value),value:z,autoComplete:"off"})]})})]})}),(0,_.jsx)(s.Ay,{item:!0,xs:12,children:(0,_.jsx)(i.A,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:2,children:(0,_.jsx)(g.A,{variant:"contained",onClick:()=>{""===e?ne("Select Applocation "):""===Y?ne("Select Tenant"):""===N?ne("Enter Name"):""===S?ne("Enter Mobile Number "):""===M?ne("Enter Address "):""===Q.city?ne("Enter City "):""===Q.state?ne("Enter State "):""===Q.suburb?ne("Enter location "):""===Q.postcode?ne("Enter Post Code "):""===z?ne("Enter Land Mark "):""===Q.latitude?ne("Invalid latitude "):""===Q.longitude?ne("Invaiid Longitude "):(async()=>{let t={applocationid:+e,tenantid:+Y,customerid:0,configid:1,firstname:N,dialcode:"+91",contactno:S,email:k,doorno:L,address:Q.address,suburb:Q.suburb,city:Q.city,state:Q.state,postcode:Q.postcode,landmark:z,latitude:$.latitude.toString(),longitude:$.longitude.toString(),profileimage:"",devicetype:"",deviceid:"",customertoken:"",primaryaddress:1};console.log(t),ae(!0);try{await A.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/customers/create"),t).then((e=>{console.log(e),e.data.status?((0,f.M8)(" Created Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),oe("/nearle/customers")):"Customer Already available"==e.data.message&&(0,f.M8)("Customer Already available",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ae(!1)})).catch((e=>{console.log(e),ae(!1),(0,f.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(a){console.log(a),ae(!1)}})()},children:"Create"})})})]})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/4917.4066be6b.chunk.js b/build/static/js/4917.4066be6b.chunk.js deleted file mode 100644 index 6343b9a..0000000 --- a/build/static/js/4917.4066be6b.chunk.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4917],{4159:function(e){e.exports=function(){"use strict";var e=1e3,r=6e4,t=36e5,n="millisecond",i="second",s="minute",o="hour",a="day",d="week",c="month",l="quarter",u="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},g=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},x={s:g,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+g(n,2,"0")+":"+g(i,2,"0")},m:function e(r,t){if(r.date()1)return e(o[0])}else{var a=r.name;A[a]=r,i=a}return!n&&i&&(y=i),i||!n&&y},$=function(e,r){if(S(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new j(t)},w=x;w.l=_,w.i=S,w.w=function(e,r){return $(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var j=function(){function v(e){this.$L=_(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(w.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(m);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(r)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return w},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,r){var t=$(e);return this.startOf(r)<=t&&t<=this.endOf(r)},g.isAfter=function(e,r){return $(e){"use strict";t.r(r),t.d(r,{default:()=>Y});var n=t(89379),i=t(9950),s=t(28429),o=t(16491),a=t(55158),d=t(93230),c=t(83274),l=t(25333),u=t(82053),f=t(77922),h=t(29925),m=t(82223),p=t(48159),v=t(84142),g=t(48089),x=t(25277),y=t(96583),A=t(40033),b=t(28170),S=t(79739),_=t(36150),$=t(51778),w=t(4159),j=t.n(w),k=t(63189),M=t(99324),D=t(6604),z=t(31222),C=t(81425),O=t(20466),I=t(90376),R=t(94826),N=t(54413),W=t(84702),E=t(44414);const H=[{tuneid:1,type:"Balanced",value:"balanced"},{tuneid:2,type:"Aggressive Speed",value:"aggressive_speed"},{tuneid:3,type:"Fuel Saver",value:"fuel_saver"},{tuneid:4,type:"Zone Strict",value:"zone_strict"}];function T(e){return e.map((e=>{const r=Number(e.cumulativekms||0),t=Number(e.minkm||0),i=Number(e.baseprice||0),s=Number(e.priceperkm||0);return r<=t?(0,n.A)((0,n.A)({},e),{},{deliveryamt:i}):(0,n.A)((0,n.A)({},e),{},{deliveryamt:(r-t)*s+i})}))}const Y=()=>{var e,r;const t=(0,s.Zp)(),w=(0,s.zy)().state||{},[Y,F]=(0,i.useState)(w.dispatchPreviewData||null);(0,i.useEffect)((()=>{var e;w.dispatchPreviewData?"undefined"!==typeof window&&null!==(e=window.history)&&void 0!==e&&e.state&&window.history.replaceState((0,n.A)((0,n.A)({},window.history.state),{},{usr:null}),""):t("/nearle/orders",{replace:!0})}),[]);const[L,J]=(0,i.useState)([]),[U,B]=(0,i.useState)(!1),[Z,P]=(0,i.useState)(0),[V,q]=(0,i.useState)(!1),[K,Q]=(0,i.useState)(!1),[G,X]=(0,i.useState)((()=>new Set)),[ee,re]=(0,i.useState)(!1),[te,ne]=(0,i.useState)(null),[ie,se]=(0,i.useState)(null),[oe,ae]=(0,i.useState)(null),de=null!==(e=w.aiMode)&&void 0!==e?e:1,ce=w.selectedMode||null,le=w.deliveryData||[],ue=w.autoRiders||[],fe=w.absentRidersPayload||[],he=w.rider||null,me=(0,i.useMemo)((()=>{if(w.appId)return w.appId;if("undefined"!==typeof window){const e=localStorage.getItem("applocationid");return e?Number(e):0}return 0}),[w.appId]),{data:pe}=(0,_.I)({queryKey:["ridersList",me],queryFn:C.Sd,enabled:!!me,staleTime:3e5}),ve=(0,i.useMemo)((()=>(e=>{if(!e)return[];const r=new Map,t=new Set,n=(e,n,i)=>{if(null==e)return;const s=String(e);r.has(s)||r.set(s,{rider_id:e,rider_name:n,orders:[]});const o=r.get(s);(i||[]).forEach((e=>{const r=null!=(null===e||void 0===e?void 0:e.orderid)?String(e.orderid):null;if(r){if(t.has(r))return;t.add(r)}o.orders.push(e)})),!o.rider_name&&n&&(o.rider_name=n)};return Array.isArray(e.zones)&&e.zones.length?e.zones.forEach((e=>{(e.riders||[]).forEach((e=>{var r;const t=null!==(r=e.rider_id)&&void 0!==r?r:e.userid,i=e.rider_name||e.username||"Rider ".concat(t);n(t,i,e.orders)}))})):Array.isArray(e.details)&&e.details.forEach((e=>{var r;const t=null!==(r=e.rider_id)&&void 0!==r?r:e.userid,i=e.rider_name||e.ridername||"Rider ".concat(t);n(t,i,[e])})),Array.from(r.values())})(Y)),[Y]),ge=(0,i.useMemo)((()=>{const e=(e=>{const r=[];return e.forEach((e=>{const t=Number(e.rider_id),i=Number.isFinite(t)?t:e.rider_id;(e.orders||[]).forEach((t=>{r.push((0,n.A)((0,n.A)({},t),{},{rider_id:i,userid:i,rider_name:e.rider_name,rider:e.rider_name}))}))})),r})(ve);return e.length?T(e):Array.isArray(null===Y||void 0===Y?void 0:Y.details)?T(Y.details):[]}),[ve,Y]);(0,i.useEffect)((()=>{const e=ge.map((e=>({zone_name:e.zone_name,ordernotes:e.ordernotes,rider:e.rider,step:e.step,ordertype:e.ordertype,orderamount:e.orderamount,riderkms:e.riderkms,cumulativekms:e.cumulativekms,baseprice:e.baseprice,minkm:e.minkm,priceperkm:e.priceperkm,kms:e.kms,actualkms:e.actualkms,rider_charge:e.rider_charge,deliveryamt:e.deliveryamt,deliverycharges:e.deliverycharges,profit:e.profit})));J(e)}),[ge]);const xe=(0,$.n)({mutationFn:C.k3,onSuccess:()=>(0,O.k)("Notification sent Successfully","success",2e3),onError:e=>(0,O.k)(e.message,"error",2e3)}),ye=(0,$.n)({mutationFn:0==de?C.FC:C.Yk,onSuccess:e=>{(0,O.k)("Orders Optimised Successfully","success",2e3),F(e),Q(!1),X(new Set),B(!1)},onError:e=>{(0,O.k)(e.message,"error",4e3),B(!1)},onSettled:()=>B(!1)}),Ae=(0,$.n)({mutationFn:C.H2,onSuccess:()=>{(0,O.k)("Delivery Created Successfully","success",2e3),B(!1),null!==he&&void 0!==he&&he.userfcmtoken&&xe.mutate(he.userfcmtoken),t("/nearle/deliveries")},onError:e=>{(0,O.k)(e.message,"error",4e3),B(!1)},onSettled:()=>B(!1)}),be=(0,$.n)({mutationFn:C.U8,onMutate:()=>q(!0),onSuccess:e=>{Array.isArray(null===e||void 0===e?void 0:e.riders)?(F((r=>((e,r)=>{if(!e||!Array.isArray(null===r||void 0===r?void 0:r.riders))return e;const t=JSON.parse(JSON.stringify(e)),i=new Map(r.riders.map((e=>[String(e.rider_id),e.orders||[]])));Array.isArray(t.zones)&&t.zones.length?(t.zones.forEach((e=>{Array.isArray(e.riders)&&e.riders.forEach((e=>{var r;const t=String(null!==(r=e.rider_id)&&void 0!==r?r:e.userid);i.has(t)&&(e.orders=[])}))})),i.forEach(((e,r)=>{let n=!1;for(const s of t.zones){if(!Array.isArray(s.riders))continue;const t=s.riders.find((e=>{var t;return String(null!==(t=e.rider_id)&&void 0!==t?t:e.userid)===r}));if(t){t.orders=e,n=!0;break}}if(!n){var i;const n=t.zones[0];n.riders=n.riders||[],n.riders.push({rider_id:Number(r)||r,rider_name:(null===(i=e[0])||void 0===i?void 0:i.rider_name)||"Rider ".concat(r),orders:e})}}))):t.zones=[{zone_name:"Reconciled",riders:r.riders.map((e=>({rider_id:e.rider_id,rider_name:e.rider_name||"Rider ".concat(e.rider_id),orders:e.orders||[]})))}];const s=[];return t.zones.forEach((e=>{(e.riders||[]).forEach((e=>{(e.orders||[]).forEach((r=>{s.push((0,n.A)((0,n.A)({},r),{},{rider_id:e.rider_id,userid:e.rider_id,rider_name:e.rider_name,rider:e.rider_name}))}))}))})),t.details=s,t})(r,e))),Q(!0),X((r=>{const t=new Set(r);return e.riders.forEach((e=>t.delete(String(e.rider_id)))),t})),(0,O.k)("Steps reconciled \u2014 preview updated","success",2e3)):(0,O.k)("Reconcile returned no rider data","warning",3e3)},onError:e=>{(0,O.k)(e.message||"Reconcile failed","error",4e3)},onSettled:()=>q(!1)}),Se=e=>{B(!0),0==de?ye.mutate({deliveries:le}):ce&&1==(null===ce||void 0===ce?void 0:ce.value)?ye.mutate({deliveries:le,hypertuning_params:e||null,selectedMode:ce,absent_riders:fe}):ye.mutate({data:{orders:le,riders:ue,config:{pay_type:"hourly",base_pay:300,strategy:"multi_trip"},absent_riders:fe},selectedMode:ce})},_e=(e,r)=>{var t,n,i,s;const o=null!==(t=null!==(n=null!==(i=null!==(s=null===e||void 0===e?void 0:e.rider_id)&&void 0!==s?s:null===e||void 0===e?void 0:e.id)&&void 0!==i?i:null===r||void 0===r?void 0:r.rider_id)&&void 0!==n?n:null===r||void 0===r?void 0:r.userid)&&void 0!==t?t:null;se(o),ne(r),ae(null),re(!0)};return(0,E.jsxs)(o.A,{sx:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden",position:"relative"},children:[(0,E.jsx)(a.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:U,children:(0,E.jsx)(R.A,{color:"inherit"})}),(0,E.jsx)(o.A,{sx:{py:1.25,px:2,borderBottom:"1px solid #eef2f6"},children:(0,E.jsxs)(d.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,E.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,E.jsx)(c.A,{title:"Back to orders",placement:"top",children:(0,E.jsx)(l.A,{onClick:()=>t("/nearle/orders"),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"}},children:(0,E.jsx)(M.eQE,{size:20})})}),(0,E.jsx)(u.A,{variant:"h3",fontWeight:600,children:"Assign Orders"})]}),(0,E.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,E.jsx)(f.A,{options:H||[],getOptionLabel:e=>e.type,sx:{minWidth:250,maxWidth:600,flex:1},renderInput:e=>(0,E.jsx)(h.A,(0,n.A)((0,n.A)({},e),{},{label:"Hyper Tuning"})),onChange:(e,r,t)=>{Se("clear"===t?null:r.value)}}),(0,E.jsx)(m.A,{variant:"contained",color:"primary",startIcon:(0,E.jsx)(D.UF6,{}),onClick:()=>{B(!0),Se("reshuffle")},children:"Re-Assign"}),(0,E.jsx)(I.Ay,{data:L,filename:"Orders_Detail_".concat(j()().format("YYYY-MM-DD_HHmmss"),".csv"),label:" CSV",style:{m:1}})]})]})}),(0,E.jsx)(o.A,{sx:{px:2,borderBottom:"1px solid #eef2f6"},children:(0,E.jsxs)(p.A,{value:Z,onChange:(e,r)=>P(r),sx:{minHeight:40},children:[(0,E.jsx)(v.A,{label:"Dispatch",sx:{minHeight:40,textTransform:"none",fontWeight:600}}),(0,E.jsx)(v.A,{label:"Reconcile",sx:{minHeight:40,textTransform:"none",fontWeight:600}})]})}),(0,E.jsxs)(o.A,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[0===Z&&Y&&(0,E.jsx)(N.default,{data:Y,embedded:!0,onChangeRider:(e,r)=>_e(r,e)},(null===Y||void 0===Y?void 0:Y.__cacheKey)||JSON.stringify(ve.length)),1===Z&&(0,E.jsx)(o.A,{sx:{flex:1,overflow:"auto",p:2,bgcolor:"#f8fafc"},children:0===ve.length?(0,E.jsx)(u.A,{sx:{color:"#94a3b8",textAlign:"center",mt:4},children:"No rider data available to reconcile."}):(0,E.jsxs)(d.A,{spacing:1.75,children:[(0,E.jsx)(o.A,{sx:{bgcolor:K?"#ecfdf5":"#fffbeb",border:"1px solid ".concat(K?"#a7f3d0":"#fde68a"),color:K?"#065f46":"#92400e",borderRadius:"10px",px:1.5,py:1,fontSize:13},children:K?"Steps have been reconciled. The Dispatch tab and Assign payload are updated.":"Click a numbered step to change its rider. Hit Reconcile to verify the corrected steps with the server."}),ve.map((e=>{const r=e.orders.reduce(((e,r)=>e+parseFloat(r.actualkms||r.kms||0)),0);return(0,E.jsxs)(g.A,{sx:{p:2,borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.06)"},children:[(0,E.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1.25},children:[(0,E.jsxs)(d.A,{direction:"row",alignItems:"center",gap:1.25,children:[(0,E.jsx)(o.A,{sx:{width:32,height:32,borderRadius:"8px",bgcolor:"#eef2ff",color:"#4f46e5",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,E.jsx)(z.aVM,{size:18})}),(0,E.jsxs)(o.A,{children:[(0,E.jsx)(u.A,{sx:{fontWeight:700,fontSize:14,color:"#1e293b"},children:e.rider_name}),(0,E.jsxs)(u.A,{sx:{fontSize:11.5,color:"#64748b"},children:["ID: ",e.rider_id]})]})]}),(0,E.jsxs)(d.A,{direction:"row",gap:1,children:[(0,E.jsx)(x.A,{size:"small",label:"".concat(e.orders.length," stops"),sx:{fontWeight:600}}),(0,E.jsx)(x.A,{size:"small",label:"".concat(r.toFixed(1)," km"),variant:"outlined"})]})]}),(0,E.jsx)(d.A,{direction:"row",gap:1.25,sx:{flexWrap:"wrap",alignItems:"center"},children:e.orders.map(((r,t)=>{var n;const i=null!==(n=r.step)&&void 0!==n?n:t+1,s=(0,W.gM)(Number(i)-1);return(0,E.jsx)(c.A,{title:(0,E.jsxs)(o.A,{children:[(0,E.jsxs)("div",{children:["Order #",r.orderid]}),(0,E.jsx)("div",{children:r.deliveryaddress||r.deliverysuburb||""}),(0,E.jsx)("div",{style:{marginTop:4,opacity:.8},children:"Click to change rider"})]}),children:(0,E.jsx)(o.A,{onClick:()=>_e(e,r),sx:{width:36,height:36,borderRadius:"50%",bgcolor:s,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:14,cursor:"pointer",boxShadow:"0 0 0 2px rgba(255,255,255,0.6), 0 1px 3px rgba(15,23,42,0.15)",transition:"transform 0.15s","&:hover":{transform:"scale(1.08)"}},children:i})},"".concat(r.orderid,"-").concat(t))}))})]},e.rider_id)})),(0,E.jsx)(o.A,{sx:{display:"flex",justifyContent:"center",pt:1.5,pb:2},children:(0,E.jsx)(m.A,{variant:"contained",color:"primary",size:"large",startIcon:(0,E.jsx)(z.$G1,{}),onClick:()=>{if(!ve.length)return void(0,O.k)("No riders to reconcile","warning",3e3);const e=ve.filter((e=>G.has(String(e.rider_id))));e.length?be.mutate({riders:e.map((e=>({rider_id:e.rider_id,orders:e.orders})))}):(0,O.k)("No edits to reconcile","info",2500)},disabled:V||0===G.size,sx:{minWidth:220,borderRadius:"10px",textTransform:"none",fontWeight:700},children:V?"Reconciling...":0===G.size?"Reconcile":"Reconcile (".concat(G.size,")")})})]})})]}),(0,E.jsx)(o.A,{sx:{px:2,py:1.25,borderTop:"1px solid #eef2f6"},children:(0,E.jsxs)(d.A,{direction:"row",gap:2,alignItems:"center",justifyContent:"end",children:[(0,E.jsx)(m.A,{variant:"contained",color:"secondary",startIcon:(0,E.jsx)(k.A,{}),onClick:()=>t(-1),children:"Back"}),(0,E.jsx)(m.A,{variant:"contained",onClick:()=>{null!==ge&&void 0!==ge&&ge.length?(B(!0),Ae.mutate({deliveries:ge})):(0,O.k)("No deliveries to assign","error",3e3)},children:"Assign Orders"})]})}),(0,E.jsxs)(y.A,{open:ee,onClose:()=>re(!1),maxWidth:"xs",fullWidth:!0,children:[(0,E.jsx)(A.A,{sx:{fontWeight:700},children:"Change Rider"}),(0,E.jsxs)(b.A,{children:[(0,E.jsxs)(u.A,{sx:{mb:2,fontSize:13,color:"text.secondary"},children:["Move order #",null===te||void 0===te?void 0:te.orderid," (step ",null!==(r=null===te||void 0===te?void 0:te.step)&&void 0!==r?r:"\u2014",") to:"]}),(0,E.jsx)(f.A,{options:pe||[],getOptionLabel:e=>(null===e||void 0===e?void 0:e.label)||"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"",value:oe,onChange:(e,r)=>ae(r),renderInput:e=>(0,E.jsx)(h.A,(0,n.A)((0,n.A)({},e),{},{label:"New rider",placeholder:"Pick a rider"}))})]}),(0,E.jsxs)(S.A,{sx:{px:3,pb:2},children:[(0,E.jsx)(m.A,{onClick:()=>re(!1),children:"Cancel"}),(0,E.jsx)(m.A,{variant:"contained",disabled:!oe,onClick:()=>{if(!oe||!te)return;const e=Number(oe.userid),r=oe.label||"".concat(oe.firstname||""," ").concat(oe.lastname||"").trim()||"Rider ".concat(e);F((t=>((e,r)=>{let{orderId:t,newRiderId:i,newRiderName:s}=r;if(!e)return e;const o=JSON.parse(JSON.stringify(e));if(Array.isArray(o.details)&&(o.details=o.details.map((e=>String(e.orderid)===String(t)?(0,n.A)((0,n.A)({},e),{},{rider_id:i,userid:i,rider_name:s,rider:s}):e))),Array.isArray(o.zones)){let e=null,r=-1;for(let n=0;nString(e.orderid)===String(t)));-1!==a&&(e=o.orders[a],o.orders.splice(a,1),r=n)}}if(e){const t=(0,n.A)((0,n.A)({},e),{},{rider_id:i,userid:i,rider_name:s,rider:s});let a=!1;for(const e of o.zones){if(!Array.isArray(e.riders))continue;const r=e.riders.find((e=>{var r;return String(null!==(r=e.rider_id)&&void 0!==r?r:e.userid)===String(i)}));if(r){r.orders=r.orders||[],r.orders.push(t),a=!0;break}}!a&&r>=0&&o.zones[r].riders.push({rider_id:i,userid:i,rider_name:s,orders:[t]})}}return o})(t,{orderId:te.orderid,oldRiderId:ie,newRiderId:e,newRiderName:r}))),X((r=>{const t=new Set(r);return null!=ie&&t.add(String(ie)),null!=e&&Number.isFinite(e)&&t.add(String(e)),t})),Q(!1),re(!1),(0,O.k)("Rider changed \u2014 click Reconcile to verify steps","info",2500)},children:"Change Rider"})]})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/4917.59b39eb6.chunk.js b/build/static/js/4917.59b39eb6.chunk.js new file mode 100644 index 0000000..8ea2cb3 --- /dev/null +++ b/build/static/js/4917.59b39eb6.chunk.js @@ -0,0 +1 @@ +(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4917],{4159:function(e){e.exports=function(){"use strict";var e=1e3,r=6e4,t=36e5,n="millisecond",i="second",s="minute",o="hour",a="day",d="week",c="month",l="quarter",u="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},x=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},g={s:x,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+x(n,2,"0")+":"+x(i,2,"0")},m:function e(r,t){if(r.date()1)return e(o[0])}else{var a=r.name;A[a]=r,i=a}return!n&&i&&(y=i),i||!n&&y},$=function(e,r){if(S(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new j(t)},w=g;w.l=_,w.i=S,w.w=function(e,r){return $(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var j=function(){function v(e){this.$L=_(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var x=v.prototype;return x.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(w.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(m);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(r)}(e),this.init()},x.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},x.$utils=function(){return w},x.isValid=function(){return!(this.$d.toString()===h)},x.isSame=function(e,r){var t=$(e);return this.startOf(r)<=t&&t<=this.endOf(r)},x.isAfter=function(e,r){return $(e){"use strict";t.r(r),t.d(r,{default:()=>L});var n=t(89379),i=t(9950),s=t(28429),o=t(14857),a=t(47223),d=t(16491),c=t(55158),l=t(93230),u=t(83274),f=t(25333),h=t(82053),m=t(77922),p=t(29925),v=t(82223),x=t(48159),g=t(84142),y=t(48089),A=t(25277),b=t(96583),S=t(40033),_=t(28170),$=t(79739),w=t(36150),j=t(51778),k=t(4159),M=t.n(k),D=t(63189),z=t(99324),C=t(6604),O=t(31222),I=t(81425),R=t(20466),W=t(90376),N=t(94826),E=t(54413),H=t(84702),T=t(44414);const Y=[{tuneid:1,type:"Balanced",value:"balanced"},{tuneid:2,type:"Aggressive Speed",value:"aggressive_speed"},{tuneid:3,type:"Fuel Saver",value:"fuel_saver"},{tuneid:4,type:"Zone Strict",value:"zone_strict"}];function F(e){return e.map((e=>{const r=Number(e.cumulativekms||0),t=Number(e.minkm||0),i=Number(e.baseprice||0),s=Number(e.priceperkm||0);return r<=t?(0,n.A)((0,n.A)({},e),{},{deliveryamt:i}):(0,n.A)((0,n.A)({},e),{},{deliveryamt:(r-t)*s+i})}))}const L=()=>{var e,r;const t=(0,s.Zp)(),k=(0,s.zy)().state||{},L=(0,o.A)(),J=(0,a.A)(L.breakpoints.down("md")),[P,U]=(0,i.useState)(k.dispatchPreviewData||null);(0,i.useEffect)((()=>{var e;k.dispatchPreviewData?"undefined"!==typeof window&&null!==(e=window.history)&&void 0!==e&&e.state&&window.history.replaceState((0,n.A)((0,n.A)({},window.history.state),{},{usr:null}),""):t("/nearle/orders",{replace:!0})}),[]);const[B,Z]=(0,i.useState)([]),[V,q]=(0,i.useState)(!1),[K,Q]=(0,i.useState)(0),[G,X]=(0,i.useState)(!1),[ee,re]=(0,i.useState)(!1),[te,ne]=(0,i.useState)((()=>new Set)),[ie,se]=(0,i.useState)(!1),[oe,ae]=(0,i.useState)(null),[de,ce]=(0,i.useState)(null),[le,ue]=(0,i.useState)(null),fe=null!==(e=k.aiMode)&&void 0!==e?e:1,he=k.selectedMode||null,me=k.deliveryData||[],pe=k.autoRiders||[],ve=k.absentRidersPayload||[],xe=k.rider||null,ge=(0,i.useMemo)((()=>{if(k.appId)return k.appId;if("undefined"!==typeof window){const e=localStorage.getItem("applocationid");return e?Number(e):0}return 0}),[k.appId]),{data:ye}=(0,w.I)({queryKey:["ridersList",ge],queryFn:I.Sd,enabled:!!ge,staleTime:3e5}),Ae=(0,i.useMemo)((()=>(e=>{if(!e)return[];const r=new Map,t=new Set,n=(e,n,i)=>{if(null==e)return;const s=String(e);r.has(s)||r.set(s,{rider_id:e,rider_name:n,orders:[]});const o=r.get(s);(i||[]).forEach((e=>{const r=null!=(null===e||void 0===e?void 0:e.orderid)?String(e.orderid):null;if(r){if(t.has(r))return;t.add(r)}o.orders.push(e)})),!o.rider_name&&n&&(o.rider_name=n)};return Array.isArray(e.zones)&&e.zones.length?e.zones.forEach((e=>{(e.riders||[]).forEach((e=>{var r;const t=null!==(r=e.rider_id)&&void 0!==r?r:e.userid,i=e.rider_name||e.username||"Rider ".concat(t);n(t,i,e.orders)}))})):Array.isArray(e.details)&&e.details.forEach((e=>{var r;const t=null!==(r=e.rider_id)&&void 0!==r?r:e.userid,i=e.rider_name||e.ridername||"Rider ".concat(t);n(t,i,[e])})),Array.from(r.values())})(P)),[P]),be=(0,i.useMemo)((()=>{const e=(e=>{const r=[];return e.forEach((e=>{const t=Number(e.rider_id),i=Number.isFinite(t)?t:e.rider_id;(e.orders||[]).forEach((t=>{r.push((0,n.A)((0,n.A)({},t),{},{rider_id:i,userid:i,rider_name:e.rider_name,rider:e.rider_name}))}))})),r})(Ae);return e.length?F(e):Array.isArray(null===P||void 0===P?void 0:P.details)?F(P.details):[]}),[Ae,P]);(0,i.useEffect)((()=>{const e=be.map((e=>({zone_name:e.zone_name,ordernotes:e.ordernotes,rider:e.rider,step:e.step,ordertype:e.ordertype,orderamount:e.orderamount,riderkms:e.riderkms,cumulativekms:e.cumulativekms,baseprice:e.baseprice,minkm:e.minkm,priceperkm:e.priceperkm,kms:e.kms,actualkms:e.actualkms,rider_charge:e.rider_charge,deliveryamt:e.deliveryamt,deliverycharges:e.deliverycharges,profit:e.profit})));Z(e)}),[be]);const Se=(0,j.n)({mutationFn:I.k3,onSuccess:()=>(0,R.k)("Notification sent Successfully","success",2e3),onError:e=>(0,R.k)(e.message,"error",2e3)}),_e=(0,j.n)({mutationFn:0==fe?I.FC:I.Yk,onSuccess:e=>{(0,R.k)("Orders Optimised Successfully","success",2e3),U(e),re(!1),ne(new Set),q(!1)},onError:e=>{(0,R.k)(e.message,"error",4e3),q(!1)},onSettled:()=>q(!1)}),$e=(0,j.n)({mutationFn:I.H2,onSuccess:()=>{(0,R.k)("Delivery Created Successfully","success",2e3),q(!1),null!==xe&&void 0!==xe&&xe.userfcmtoken&&Se.mutate(xe.userfcmtoken),t("/nearle/deliveries")},onError:e=>{(0,R.k)(e.message,"error",4e3),q(!1)},onSettled:()=>q(!1)}),we=(0,j.n)({mutationFn:I.U8,onMutate:()=>X(!0),onSuccess:e=>{Array.isArray(null===e||void 0===e?void 0:e.riders)?(U((r=>((e,r)=>{if(!e||!Array.isArray(null===r||void 0===r?void 0:r.riders))return e;const t=JSON.parse(JSON.stringify(e)),i=new Map(r.riders.map((e=>[String(e.rider_id),e.orders||[]])));Array.isArray(t.zones)&&t.zones.length?(t.zones.forEach((e=>{Array.isArray(e.riders)&&e.riders.forEach((e=>{var r;const t=String(null!==(r=e.rider_id)&&void 0!==r?r:e.userid);i.has(t)&&(e.orders=[])}))})),i.forEach(((e,r)=>{let n=!1;for(const s of t.zones){if(!Array.isArray(s.riders))continue;const t=s.riders.find((e=>{var t;return String(null!==(t=e.rider_id)&&void 0!==t?t:e.userid)===r}));if(t){t.orders=e,n=!0;break}}if(!n){var i;const n=t.zones[0];n.riders=n.riders||[],n.riders.push({rider_id:Number(r)||r,rider_name:(null===(i=e[0])||void 0===i?void 0:i.rider_name)||"Rider ".concat(r),orders:e})}}))):t.zones=[{zone_name:"Reconciled",riders:r.riders.map((e=>({rider_id:e.rider_id,rider_name:e.rider_name||"Rider ".concat(e.rider_id),orders:e.orders||[]})))}];const s=[];return t.zones.forEach((e=>{(e.riders||[]).forEach((e=>{(e.orders||[]).forEach((r=>{s.push((0,n.A)((0,n.A)({},r),{},{rider_id:e.rider_id,userid:e.rider_id,rider_name:e.rider_name,rider:e.rider_name}))}))}))})),t.details=s,t})(r,e))),re(!0),ne((r=>{const t=new Set(r);return e.riders.forEach((e=>t.delete(String(e.rider_id)))),t})),(0,R.k)("Steps reconciled \u2014 preview updated","success",2e3)):(0,R.k)("Reconcile returned no rider data","warning",3e3)},onError:e=>{(0,R.k)(e.message||"Reconcile failed","error",4e3)},onSettled:()=>X(!1)}),je=e=>{q(!0),0==fe?_e.mutate({deliveries:me}):he&&1==(null===he||void 0===he?void 0:he.value)?_e.mutate({deliveries:me,hypertuning_params:e||null,selectedMode:he,absent_riders:ve}):_e.mutate({data:{orders:me,riders:pe,config:{pay_type:"hourly",base_pay:300,strategy:"multi_trip"},absent_riders:ve},selectedMode:he})},ke=(e,r)=>{var t,n,i,s;const o=null!==(t=null!==(n=null!==(i=null!==(s=null===e||void 0===e?void 0:e.rider_id)&&void 0!==s?s:null===e||void 0===e?void 0:e.id)&&void 0!==i?i:null===r||void 0===r?void 0:r.rider_id)&&void 0!==n?n:null===r||void 0===r?void 0:r.userid)&&void 0!==t?t:null;ce(o),ae(r),ue(null),se(!0)};return(0,T.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden",position:"relative"},children:[(0,T.jsx)(c.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:V,children:(0,T.jsx)(N.A,{color:"inherit"})}),(0,T.jsx)(d.A,{sx:{py:1.25,px:2,borderBottom:"1px solid #eef2f6"},children:(0,T.jsxs)(l.A,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,T.jsxs)(l.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,T.jsx)(u.A,{title:"Back to orders",placement:"top",children:(0,T.jsx)(f.A,{onClick:()=>t("/nearle/orders"),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"}},children:(0,T.jsx)(z.eQE,{size:20})})}),(0,T.jsx)(h.A,{variant:"h3",fontWeight:600,children:"Assign Orders"})]}),(0,T.jsxs)(l.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},spacing:1,sx:{width:{xs:"100%",md:"auto"}},children:[(0,T.jsx)(m.A,{options:Y||[],getOptionLabel:e=>e.type,sx:{minWidth:{xs:0,sm:250},maxWidth:600,flex:1,width:{xs:"100%",sm:"auto"}},renderInput:e=>(0,T.jsx)(p.A,(0,n.A)((0,n.A)({},e),{},{label:"Hyper Tuning"})),onChange:(e,r,t)=>{je("clear"===t?null:r.value)}}),(0,T.jsx)(v.A,{variant:"contained",color:"primary",startIcon:(0,T.jsx)(C.UF6,{}),fullWidth:J,onClick:()=>{q(!0),je("reshuffle")},children:"Re-Assign"}),(0,T.jsx)(W.Ay,{data:B,filename:"Orders_Detail_".concat(M()().format("YYYY-MM-DD_HHmmss"),".csv"),label:" CSV",style:{m:1}})]})]})}),(0,T.jsx)(d.A,{sx:{px:2,borderBottom:"1px solid #eef2f6"},children:(0,T.jsxs)(x.A,{value:K,onChange:(e,r)=>Q(r),variant:J?"fullWidth":"standard",sx:{minHeight:40},children:[(0,T.jsx)(g.A,{label:"Dispatch",sx:{minHeight:40,textTransform:"none",fontWeight:600}}),(0,T.jsx)(g.A,{label:"Reconcile",sx:{minHeight:40,textTransform:"none",fontWeight:600}})]})}),(0,T.jsxs)(d.A,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[0===K&&P&&(0,T.jsx)(E.default,{data:P,embedded:!0,onChangeRider:(e,r)=>ke(r,e)},(null===P||void 0===P?void 0:P.__cacheKey)||JSON.stringify(Ae.length)),1===K&&(0,T.jsx)(d.A,{sx:{flex:1,overflow:"auto",p:2,bgcolor:"#f8fafc"},children:0===Ae.length?(0,T.jsx)(h.A,{sx:{color:"#94a3b8",textAlign:"center",mt:4},children:"No rider data available to reconcile."}):(0,T.jsxs)(l.A,{spacing:1.75,children:[(0,T.jsx)(d.A,{sx:{bgcolor:ee?"#ecfdf5":"#fffbeb",border:"1px solid ".concat(ee?"#a7f3d0":"#fde68a"),color:ee?"#065f46":"#92400e",borderRadius:"10px",px:1.5,py:1,fontSize:13},children:ee?"Steps have been reconciled. The Dispatch tab and Assign payload are updated.":"Click a numbered step to change its rider. Hit Reconcile to verify the corrected steps with the server."}),Ae.map((e=>{const r=e.orders.reduce(((e,r)=>e+parseFloat(r.actualkms||r.kms||0)),0);return(0,T.jsxs)(y.A,{sx:{p:{xs:1.5,md:2},borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.06)"},children:[(0,T.jsxs)(l.A,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1.25,flexWrap:"wrap",gap:1},children:[(0,T.jsxs)(l.A,{direction:"row",alignItems:"center",gap:1.25,children:[(0,T.jsx)(d.A,{sx:{width:32,height:32,borderRadius:"8px",bgcolor:"#eef2ff",color:"#4f46e5",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,T.jsx)(O.aVM,{size:18})}),(0,T.jsxs)(d.A,{children:[(0,T.jsx)(h.A,{sx:{fontWeight:700,fontSize:14,color:"#1e293b"},children:e.rider_name}),(0,T.jsxs)(h.A,{sx:{fontSize:11.5,color:"#64748b"},children:["ID: ",e.rider_id]})]})]}),(0,T.jsxs)(l.A,{direction:"row",gap:1,children:[(0,T.jsx)(A.A,{size:"small",label:"".concat(e.orders.length," stops"),sx:{fontWeight:600}}),(0,T.jsx)(A.A,{size:"small",label:"".concat(r.toFixed(1)," km"),variant:"outlined"})]})]}),(0,T.jsx)(l.A,{direction:"row",gap:1.25,sx:{flexWrap:"wrap",alignItems:"center"},children:e.orders.map(((r,t)=>{var n;const i=null!==(n=r.step)&&void 0!==n?n:t+1,s=(0,H.gM)(Number(i)-1);return(0,T.jsx)(u.A,{title:(0,T.jsxs)(d.A,{children:[(0,T.jsxs)("div",{children:["Order #",r.orderid]}),(0,T.jsx)("div",{children:r.deliveryaddress||r.deliverysuburb||""}),(0,T.jsx)("div",{style:{marginTop:4,opacity:.8},children:"Click to change rider"})]}),children:(0,T.jsx)(d.A,{onClick:()=>ke(e,r),sx:{width:36,height:36,borderRadius:"50%",bgcolor:s,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:14,cursor:"pointer",boxShadow:"0 0 0 2px rgba(255,255,255,0.6), 0 1px 3px rgba(15,23,42,0.15)",transition:"transform 0.15s","&:hover":{transform:"scale(1.08)"}},children:i})},"".concat(r.orderid,"-").concat(t))}))})]},e.rider_id)})),(0,T.jsx)(d.A,{sx:{display:"flex",justifyContent:"center",pt:1.5,pb:2},children:(0,T.jsx)(v.A,{variant:"contained",color:"primary",size:"large",startIcon:(0,T.jsx)(O.$G1,{}),onClick:()=>{if(!Ae.length)return void(0,R.k)("No riders to reconcile","warning",3e3);const e=Ae.filter((e=>te.has(String(e.rider_id))));e.length?we.mutate({riders:e.map((e=>({rider_id:e.rider_id,orders:e.orders})))}):(0,R.k)("No edits to reconcile","info",2500)},disabled:G||0===te.size,fullWidth:J,sx:{minWidth:{xs:0,sm:220},borderRadius:"10px",textTransform:"none",fontWeight:700},children:G?"Reconciling...":0===te.size?"Reconcile":"Reconcile (".concat(te.size,")")})})]})})]}),(0,T.jsx)(d.A,{sx:{px:2,py:1.25,borderTop:"1px solid #eef2f6"},children:(0,T.jsxs)(l.A,{direction:{xs:"column-reverse",sm:"row"},gap:{xs:1,sm:2},alignItems:{xs:"stretch",sm:"center"},justifyContent:"end",children:[(0,T.jsx)(v.A,{variant:"contained",color:"secondary",startIcon:(0,T.jsx)(D.A,{}),fullWidth:J,onClick:()=>t(-1),children:"Back"}),(0,T.jsx)(v.A,{variant:"contained",fullWidth:J,onClick:()=>{null!==be&&void 0!==be&&be.length?(q(!0),$e.mutate({deliveries:be})):(0,R.k)("No deliveries to assign","error",3e3)},children:"Assign Orders"})]})}),(0,T.jsxs)(b.A,{open:ie,onClose:()=>se(!1),maxWidth:"xs",fullWidth:!0,fullScreen:J,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,T.jsx)(S.A,{sx:{fontWeight:700},children:"Change Rider"}),(0,T.jsxs)(_.A,{children:[(0,T.jsxs)(h.A,{sx:{mb:2,fontSize:13,color:"text.secondary"},children:["Move order #",null===oe||void 0===oe?void 0:oe.orderid," (step ",null!==(r=null===oe||void 0===oe?void 0:oe.step)&&void 0!==r?r:"\u2014",") to:"]}),(0,T.jsx)(m.A,{options:ye||[],getOptionLabel:e=>(null===e||void 0===e?void 0:e.label)||"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"",value:le,onChange:(e,r)=>ue(r),renderInput:e=>(0,T.jsx)(p.A,(0,n.A)((0,n.A)({},e),{},{label:"New rider",placeholder:"Pick a rider"}))})]}),(0,T.jsxs)($.A,{sx:{px:3,pb:2,flexDirection:{xs:"column-reverse",sm:"row"},gap:{xs:1,sm:0}},children:[(0,T.jsx)(v.A,{fullWidth:J,onClick:()=>se(!1),children:"Cancel"}),(0,T.jsx)(v.A,{variant:"contained",fullWidth:J,disabled:!le,onClick:()=>{if(!le||!oe)return;const e=Number(le.userid),r=le.label||"".concat(le.firstname||""," ").concat(le.lastname||"").trim()||"Rider ".concat(e);U((t=>((e,r)=>{let{orderId:t,newRiderId:i,newRiderName:s}=r;if(!e)return e;const o=JSON.parse(JSON.stringify(e));if(Array.isArray(o.details)&&(o.details=o.details.map((e=>String(e.orderid)===String(t)?(0,n.A)((0,n.A)({},e),{},{rider_id:i,userid:i,rider_name:s,rider:s}):e))),Array.isArray(o.zones)){let e=null,r=-1;for(let n=0;nString(e.orderid)===String(t)));-1!==a&&(e=o.orders[a],o.orders.splice(a,1),r=n)}}if(e){const t=(0,n.A)((0,n.A)({},e),{},{rider_id:i,userid:i,rider_name:s,rider:s});let a=!1;for(const e of o.zones){if(!Array.isArray(e.riders))continue;const r=e.riders.find((e=>{var r;return String(null!==(r=e.rider_id)&&void 0!==r?r:e.userid)===String(i)}));if(r){r.orders=r.orders||[],r.orders.push(t),a=!0;break}}!a&&r>=0&&o.zones[r].riders.push({rider_id:i,userid:i,rider_name:s,orders:[t]})}}return o})(t,{orderId:oe.orderid,oldRiderId:de,newRiderId:e,newRiderName:r}))),ne((r=>{const t=new Set(r);return null!=de&&t.add(String(de)),null!=e&&Number.isFinite(e)&&t.add(String(e)),t})),re(!1),se(!1),(0,R.k)("Rider changed \u2014 click Reconcile to verify steps","info",2500)},children:"Change Rider"})]})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/4947.3f1a9374.chunk.js b/build/static/js/4947.3f1a9374.chunk.js deleted file mode 100644 index 5fc1292..0000000 --- a/build/static/js/4947.3f1a9374.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4947],{13968:(e,r,t)=>{t.r(r),t.d(r,{default:()=>Te});var o=t(89379),n=t(9950),i=t(47965),s=t(44070),l=t(36256),a=t(13838),c=t(4159),d=t.n(c),x=t(36150),h=t(60010),u=t(51778),p=(t(47659),t(14857)),A=t(94118),g=t(37476),m=t(94826),j=t(52351),f=t(67562),b=t(49883),v=t(31222),y=t(35678),k=t(56311),w=t(44414);var S=t(50027),C=t(20466),D=t(96646),I=t(59212);const W=t.p+"static/media/aiImage.89c2ccb91a41d85031e3.png";var z=t(63189),M=t(99324),R=t(6604),O=t(2235),Y=t(41413),P=t(55158),F=t(59382),T=t(28810),L=t(79046),E=t(33092),N=t(93230),q=t(82053),H=t(16491),K=t(60899),_=t(82917),B=t(77922),U=t(29925),Z=t(83274),X=t(1320),Q=t(15769),J=t(69780),V=t(9213),G=t(21671),$=t(93038),ee=t(34075),re=t(25333),te=t(96583),oe=t(40033),ne=t(25277),ie=t(28170),se=t(79739),le=t(82223),ae=t(74745),ce=t(81425),de=t(58691),xe=t(28429),he=t(90376),ue=t(54413),pe=t(36220);d().extend(pe);const Ae=999,ge=16,me="0 14px 40px rgba(15, 23, 42, 0.10)",je="0 8px 24px rgba(15, 23, 42, 0.08)",fe="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",ye="#94a3b8",ke="#e2e8f0",we="#f1f5f9",Se="#f8fafc",Ce=(e,r)=>"".concat(e).concat(r),De=e=>Ce(e,"08"),Ie=e=>Ce(e,"18"),We=e=>Ce(e,"26"),ze=e=>Ce(e,"55"),Me="#662582",Re=e=>(0,w.jsx)(O.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:fe,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Oe=e=>{let{color:r,selected:t,size:o=24,children:n}=e;return(0,w.jsx)(Y.A,{sx:{width:o,height:o,bgcolor:t?r:Ie(r),color:t?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},Ye=e=>({"& .MuiOutlinedInput-root":{borderRadius:Ae+"px",bgcolor:De(e),fontWeight:600,"& fieldset":{borderColor:ze(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}),Pe={created:{label:"Created",color:"#0ea5e9",icon:v.F6S},pending:{label:"Pending",color:"#f59e0b",icon:v.tX0},processing:{label:"Processing",color:"#0ea5e9",icon:v.bfP},modified:{label:"Modified",color:"#06b6d4",icon:v.bfP},confirmed:{label:"Confirmed",color:"#10b981",icon:v.mU9},accepted:{label:"Accepted",color:"#6366f1",icon:v.mU9},delivered:{label:"Delivered",color:"#10b981",icon:v.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:v.uDv}},Fe=[{idx:0,status:"created",label:"Created",color:Me,icon:v.F6S,countKey:"created"},{idx:1,status:"pending",label:"Pending",color:"#f59e0b",icon:v.tX0,countKey:"pending"},{idx:2,status:"delivered",label:"Delivered",color:"#10b981",icon:v.mU9,countKey:"delivered"},{idx:3,status:"cancelled",label:"Cancelled",color:"#ef4444",icon:v.uDv,countKey:"cancelled"}],Te=()=>{const e=(0,p.A)(),r=(0,xe.Zp)(),t=(0,n.useRef)(),c=(0,n.useRef)(),pe=(0,n.useRef)(null),Ae=(0,n.useRef)(null),[fe,Ce]=(0,n.useState)(0),[Te,Le]=(0,n.useState)("All"),[Ee,Ne]=(0,n.useState)(!1),[qe,He]=(0,n.useState)(d()().format("YYYY-MM-DD")),[Ke,_e]=(0,n.useState)(d()().format("YYYY-MM-DD")),[Be,Ue]=(0,n.useState)("Today"),[Ze,Xe]=(0,n.useState)(!1),[Qe,Je]=(0,n.useState)(0),[Ve,Ge]=(0,n.useState)("created"),[$e,er]=(0,n.useState)(!1),[rr,tr]=(0,n.useState)(!1),[or,nr]=(0,n.useState)(!1),[ir,sr]=(0,n.useState)(null),[lr,ar]=(0,n.useState)(null),[cr,dr]=(0,n.useState)(""),[xr,hr]=(0,n.useState)(0),[ur,pr]=(0,n.useState)(null),[Ar,gr]=(0,n.useState)(0),[mr,jr]=(0,n.useState)(0),[fr,br]=(0,n.useState)(""),[vr,yr]=(0,n.useState)(""),[kr,wr]=(0,n.useState)(!1),[Sr,Cr]=(0,n.useState)(!1),[Dr,Ir]=(0,n.useState)(null),[Wr,zr]=(0,n.useState)(null),[Mr,Rr]=(0,n.useState)(!1),[Or,Yr]=(0,n.useState)(!1),[Pr,Fr]=(0,n.useState)(!1),[Tr,Lr]=(0,n.useState)(null),[Er,Nr]=(0,n.useState)([]),[qr,Hr]=(0,n.useState)([]),[Kr,_r]=(0,n.useState)(null),[Br,Ur]=(0,n.useState)(null),[Zr]=(0,n.useState)(0),[Xr,Qr]=(0,n.useState)([]),[Jr,Vr]=(0,n.useState)([]),Gr=(0,n.useRef)(0),$r=(0,n.useRef)(null),[et,rt]=(0,n.useState)(null),[tt,ot]=(0,n.useState)([]);(0,n.useEffect)((()=>{gr(0),Ir(null),jr(0),zr(null)}),[fe]),(0,n.useEffect)((()=>{jr(0),zr(null)}),[Ar]),(0,n.useEffect)((()=>{const e=Jr.map((e=>({zone_name:e.zone_name,ordernotes:e.ordernotes,rider:e.rider,step:e.step,ordertype:e.ordertype,orderamount:e.orderamount,riderkms:e.riderkms,cumulativekms:e.cumulativekms,baseprice:e.baseprice,minkm:e.minkm,priceperkm:e.priceperkm,kms:e.kms,actualkms:e.actualkms,rider_charge:e.rider_charge,deliveryamt:e.deliveryamt,deliverycharges:e.deliverycharges,profit:e.profit})));Qr(e),console.log("csvExportData",e)}),[Jr]),(0,n.useEffect)((()=>{if(null===qr||void 0===qr||!qr.length)return;const e=qr.map((e=>{const r=Number(e.cumulativekms||0),t=Number(e.minkm||0),n=Number(e.baseprice||0),i=Number(e.priceperkm||0);return r<=t?(0,o.A)((0,o.A)({},e),{},{deliveryamt:n}):(0,o.A)((0,o.A)({},e),{},{deliveryamt:(r-t)*i+n})}));Vr(e),console.log("finaldeliveryList",e)}),[qr]);const{data:nt,isLoading:it,isError:st,error:lt,refetch:at}=(0,x.I)({queryKey:["percentageData",fe],queryFn:()=>(0,ce.jy)(fe),enabled:!0}),{data:ct,isLoading:dt,isError:xt,error:ht}=(0,x.I)({queryKey:["tenantlist",fe],queryFn:()=>(0,ce.Mn)(fe),enabled:0!==fe}),{data:ut,isLoading:pt,isError:At,error:gt}=(0,x.I)({queryKey:["gettenantlocations",Ar],queryFn:()=>(0,ce.DL)(Ar),enabled:0!==Ar}),{data:mt=[],isLoading:jt}=(0,x.I)({queryKey:["paymentmodes"],queryFn:ce.HY}),{data:ft=[],isLoading:bt}=(0,x.I)({queryKey:["ridersList",fe],queryFn:ce.Sd,enabled:0!==fe}),{data:vt,isLoading:yt,isError:kt,error:wt,refetch:St}=(0,x.I)({queryKey:["ordersCount",fe,qe,Ke,Ve,Ar,mr],queryFn:ce.Hh,refetchOnMount:!0,refetchOnWindowFocus:!0}),{data:Ct}=(0,x.I)({queryKey:["getallriders"],queryFn:ce.Xw,refetchOnMount:!0,refetchOnWindowFocus:!0}),{data:Dt,isLoading:It,isError:Wt,error:zt,fetchNextPage:Mt,hasNextPage:Rt,isFetchingNextPage:Ot,refetch:Yt}=(0,h.q)({queryKey:["fetchOrders",fe,Ve,vr,qe,Ke,100,Ar,mr],queryFn:ce.nQ,getNextPageParam:e=>{var r;return null!==(r=e.nextPage)&&void 0!==r?r:void 0},refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0,staleTime:0}),Pt=(null===Dt||void 0===Dt?void 0:Dt.pages.flatMap((e=>e.rows)))||[];(0,n.useEffect)((()=>{if(!Rt)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Mt()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[Rt,Mt]);const Ft=(0,u.n)({mutationFn:0==Gr.current?ce.FC:ce.Yk,onSuccess:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(console.log("data",e),console.log("varialbles",t),(0,C.k)("Orders Optimised Successfully","success",2e3),St(),Yt(),Ne(!1),wr(!1),0==Gr.current)Hr(null===e||void 0===e?void 0:e.details),_r(null===e||void 0===e?void 0:e.zones),Ur(null===e||void 0===e?void 0:e.meta),Fr(!0);else{var o,n,i;Hr(null===e||void 0===e?void 0:e.details),_r(null===e||void 0===e?void 0:e.zones),Ur(null===e||void 0===e?void 0:e.meta),Lr(e);const t=$r.current||{};r("/nearle/dispatch/preview",{state:{dispatchPreviewData:e,aiMode:null!==(o=t.aiMode)&&void 0!==o?o:Gr.current,selectedMode:t.selectedMode||et,deliveryData:t.deliveryData||[],autoRiders:t.autoRiders||Ct||[],absentRidersPayload:t.absentRidersPayload||[],rider:t.rider||ir,appId:null!==(n=t.appId)&&void 0!==n?n:fe,tenantId:null!==(i=t.tenantid)&&void 0!==i?i:Ar,startdate:qe}})}},onError:e=>{(0,C.k)(e.message,"error",4e3),wr(!1),Ne(!1)},onSettled:()=>{Kt(),Ne(!1),wr(!1),Cr(!1)}}),Tt=(0,u.n)({mutationFn:ce.H2,onMutate:()=>{Cr(!0)},onSuccess:e=>{console.log("create data",e),(0,C.k)("Delivery Created Successfully","success",2e3),r("/nearle/deliveries"),Nt.mutate(null===ir||void 0===ir?void 0:ir.userfcmtoken)},onError:e=>{(0,C.k)(e.message,"error",4e3)},onSettled:()=>{Cr(!1)}}),Lt=(0,u.n)({mutationFn:ce.N4,onSuccess:e=>{e.status&&(er(!1),(0,C.k)("Order Cancelled Successfully","success",2e3),St(),at())},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),Et=(0,u.n)({mutationFn:ce.zR,onSuccess:e=>{e.status&&(nr(!1),(0,C.k)("Order Cancelled Successfully","success",2e3),Yt(),St(),at(),Nr([]))},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),Nt=(0,u.n)({mutationFn:ce.k3,onSuccess:()=>{(0,C.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),qt=async e=>{Cr(!0),Ne(!0);const r=Er.map((e=>(0,o.A)((0,o.A)({},e),{},{deliveryid:0,deliverydate:d()(e.deliverydate).utc().format("YYYY-MM-DD HH:mm:ss"),assigntime:d()().format("YYYY-MM-DD HH:mm:ss"),orderstatus:"pending",orderamount:e.deliverycharge,droplat:e.deliverylat,droplon:e.deliverylong,pickuplat:e.pickuplat,pickuplon:e.pickuplong,ordernotes:e.ordernotes,deliverycharges:e.deliverycharge,pickuplocation:e.pickupsuburb,deliverylocation:e.deliverysuburb})));console.log("deliveryData",r);const t=(tt||[]).map((e=>({userid:e.userid,username:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||e.username||"Rider ".concat(e.userid)})));$r.current={deliveryData:r,absentRidersPayload:t,autoRiders:Ct,selectedMode:et,aiMode:Gr.current,rider:ir,appId:fe,tenantid:Ar},0==Gr.current?Ft.mutate({deliveries:r}):et&&1==(null===et||void 0===et?void 0:et.value)?Ft.mutate({deliveries:1==et.value?r:{body:r},hypertuning_params:e||null,selectedMode:et,absent_riders:t}):Ft.mutate({data:{orders:r,riders:Ct,config:{pay_type:"hourly",base_pay:300,strategy:"multi_trip"},absent_riders:t},selectedMode:et})},Ht=(0,u.n)({mutationFn:ce.H2,onSuccess:(e,t)=>{console.log("data",e),console.log("varialbles",t),(0,C.k)("Delivery Created Successfully","success",2e3),Cr(!1),r("/nearle/deliveries")},onError:e=>{(0,C.k)(e.message,"error",4e3)},onSettled:()=>{Cr(!1)}}),Kt=()=>{tr(!1),sr(null),ar(null),rt(null),ot([])},_t=st?"Error fetching percentages: ".concat(null===lt||void 0===lt?void 0:lt.message):kt?"Error fetching orders Count: ".concat(null===wt||void 0===wt?void 0:wt.message):Wt?"Error fetching orders : ".concat(null===zt||void 0===zt?void 0:zt.message):xt?"Error Fetching on Tenants:".concat(null===ht||void 0===ht?void 0:ht.message," "):At?"Error Fetching on Tenants Locations:".concat(null===gt||void 0===gt?void 0:gt.message," "):null;return(0,n.useEffect)((()=>{_t&&(console.log(_t),(0,C.k)(_t,"error",3e3))}),[_t]),(0,w.jsxs)(n.Fragment,{children:[(it||yt||It||dt||pt||kr)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(j.A,{}),(0,w.jsx)(m.A,{})]}),(0,w.jsx)(P.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:kr||It,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(P.A,{sx:{zIndex:1e3},open:Mr}),Er.length>0&&(0,w.jsxs)(F.A,{ariaLabel:"Actions",icon:(0,w.jsx)(T.A,{badgeContent:(null===Er||void 0===Er?void 0:Er.length)||"",color:"secondary",children:(0,w.jsx)(L.A,{})}),open:Mr,onOpen:()=>Rr(!0),onClose:()=>Rr(!1),sx:{position:"fixed",bottom:52,right:16,"& .MuiFab-primary":{bgcolor:"#7b1fa2",color:"#fff","&:hover":{bgcolor:"#6a1b9a"},width:64,height:64}},children:[(0,w.jsx)(E.A,{icon:(0,w.jsx)("img",{src:W,alt:"Assign",style:{width:38,height:38,objectFit:"contain",borderRadius:50}}),tooltipTitle:" Optimisation",FabProps:{sx:{bgcolor:"primary.main",color:"#fff","&:hover":{bgcolor:"primary.dark"},width:64,height:64}},onClick:()=>{Gr.current=1,Rr(!1),tr(!0)}}),(0,w.jsx)(E.A,{icon:(0,w.jsx)(i.A,{style:{fontSize:22}}),tooltipTitle:"Manual Assign",FabProps:{sx:{bgcolor:"success.600",color:"#fff","&:hover":{bgcolor:"success.dark"},width:64,height:64}},onClick:()=>{Gr.current=0,Rr(!1),tr(!0)}}),(0,w.jsx)(E.A,{icon:(0,w.jsx)(s.A,{style:{fontSize:22}}),tooltipTitle:"Delete",FabProps:{sx:{bgcolor:"#d32f2f",color:"#fff","&:hover":{bgcolor:"#9a0007"},width:64,height:64}},onClick:()=>{Rr(!1),nr(!0)}})]}),(0,w.jsx)(O.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:ge/8,border:"1px solid",borderColor:ke,background:"linear-gradient(135deg, ".concat(De(Me)," 0%, ").concat(De("#9255AB")," 100%)"),boxShadow:je},children:(0,w.jsxs)(N.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,w.jsx)(Y.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Me,color:"#fff",boxShadow:"0 6px 18px ".concat(We(Me))},children:(0,w.jsx)(v.F6S,{size:22})}),(0,w.jsxs)(N.A,{children:[(0,w.jsx)(q.A,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders"}),(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,w.jsx)(H.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,w.jsxs)(q.A,{variant:"caption",sx:{color:ve,fontWeight:600},children:["Live \xb7 ",Te||"All Zones"," \xb7 ",Be]})]})]})]}),(0,w.jsx)(I.A,{ref:pe,locaName:Te,setAppId:Ce,setLocoName:Le,setPage:hr,pill:!0,accentColor:Me,icon:(0,w.jsx)(v.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Re,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,w.jsx)(K.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:v.F6S,value:null===nt||void 0===nt?void 0:nt.created,percentage:null===nt||void 0===nt?void 0:nt.percentage1},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:v.tX0,value:null===nt||void 0===nt?void 0:nt.uncoveredOrders,percentage:null===nt||void 0===nt?void 0:nt.percentage2},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:v.mU9,value:null===nt||void 0===nt?void 0:nt.coveredOrders,percentage:null===nt||void 0===nt?void 0:nt.percentage3},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:v.uDv,value:null===nt||void 0===nt?void 0:nt.cancelled,percentage:null===nt||void 0===nt?void 0:nt.percentage4}].map((e=>{var r;const t=e.icon;return(0,w.jsx)(K.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,w.jsxs)(O.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:ge/8,border:"1px solid",borderColor:ke,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:je,borderColor:ze(e.color)}},children:[(0,w.jsx)(H.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Ie(e.color)," 100%)")}}),(0,w.jsxs)(N.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,w.jsxs)(N.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,w.jsx)(q.A,{variant:"caption",sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,w.jsx)(q.A,{sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:it?(0,w.jsx)(_.A,{sx:{width:40},animation:"wave"}):null!==(r=e.value)&&void 0!==r?r:0}),null!=e.percentage&&(0,w.jsxs)(q.A,{variant:"caption",sx:{color:ve,fontWeight:700},children:[e.percentage,"%"]})]}),(0,w.jsx)(Y.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Ie(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(ze(e.color)),flexShrink:0},children:(0,w.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,w.jsxs)(O.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:ge/8,border:"1px solid",borderColor:ke,background:"#fff",boxShadow:me},children:[(0,w.jsxs)(K.Ay,{container:!0,spacing:1.25,alignItems:"center",children:[(0,w.jsx)(K.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,w.jsx)(B.A,{options:ct||[],value:Dr,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",PaperComponent:Re,onOpen:e=>{fe||(e.preventDefault(),(0,C.k)("Please select location first!","warning",3e3),setTimeout((()=>{var e;null===(e=pe.current)||void 0===e||e.focus()}),0))},onChange:(e,r,t)=>{"clear"===t?(gr(0),Ir(null),jr(0),zr(null)):(gr((null===r||void 0===r?void 0:r.tenantid)||0),Ir(r),jr(0),zr(null))},renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{inputRef:Ae,placeholder:"Select Tenant",size:"small",sx:Ye("#0ea5e9"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,w.jsx)(N.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,w.jsx)(Oe,{color:"#0ea5e9",size:22,selected:!0,children:(0,w.jsx)(v.Itr,{size:13})})})})}))})}),(0,w.jsx)(K.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,w.jsx)(B.A,{options:ut||[],getOptionLabel:e=>e?"".concat(e.locationname," (").concat(e.suburb,")"):"",value:Wr,PaperComponent:Re,onOpen:e=>{fe||Ar?Ar||(e.preventDefault(),(0,C.k)("Please select Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=Ae.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,C.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=pe.current)||void 0===e||e.focus()}),0))},onChange:(e,r,t)=>{"clear"===t?(jr(0),zr(null)):(jr(r.locationid||0),zr(r))},renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Location",size:"small",sx:Ye("#10b981"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,w.jsx)(N.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,w.jsx)(Oe,{color:"#10b981",size:22,selected:!0,children:(0,w.jsx)(v.JFD,{size:13})})})})}))})}),(0,w.jsx)(K.Ay,{item:!0,xs:12,sm:12,md:4,children:(0,w.jsxs)(N.A,{direction:"row",spacing:1,alignItems:"center",justifyContent:{xs:"flex-start",md:"flex-end"},flexWrap:"wrap",children:[(0,w.jsx)(Z.A,{title:"Date Filter",placement:"top",children:(0,w.jsxs)(H.A,{onClick:()=>Xe(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:De("#f59e0b"),border:"1.5px solid ".concat(ze("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(We("#f59e0b"))}},children:[(0,w.jsx)(v.Ki0,{size:14}),d()(qe).format("DD/MM/YY")," \u2013 ",d()(Ke).format("DD/MM/YY")]})}),(0,w.jsxs)(H.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:De(Me),border:"1px solid ".concat(ze(Me)),color:Me,fontSize:11,fontWeight:800},children:[(0,w.jsx)(v.GdF,{size:12})," ",Be]})]})})]}),(0,w.jsx)(y.A,{open:Ze,onClose:()=>Xe(!1),onSelect:e=>{He(e.startDate),_e(e.endDate),Ue(e.label),console.log("Selected Date Range:",e)}})]}),(0,w.jsx)(O.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:ge/8,borderTopRightRadius:ge/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:ke,borderBottom:0,background:"#fff"},children:(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,w.jsx)(N.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:ke,borderRadius:4}},children:Fe.map((e=>{var r;const t=e.icon,o=Qe===e.idx,n=null!==(r=null===vt||void 0===vt?void 0:vt[e.countKey])&&void 0!==r?r:0;return(0,w.jsxs)(H.A,{onClick:r=>{return t=e.idx,hr(0),Je(t),0===t&&Ge("created"),1===t&&Ge("pending"),2===t&&Ge("delivered"),3===t&&Ge("cancelled"),void br("");var t},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(o?e.color:ze(e.color)),bgcolor:o?e.color:De(e.color),color:o?"#fff":e.color,fontWeight:700,boxShadow:o?"0 6px 18px ".concat(We(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:o?"0 6px 18px ".concat(We(e.color)):"0 0 0 3px ".concat(We(e.color))}},children:[(0,w.jsx)(Y.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:o?"rgba(255,255,255,0.22)":Ie(e.color),color:o?"#fff":e.color},children:(0,w.jsx)(t,{size:13})}),(0,w.jsx)(q.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,w.jsx)(H.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:o?"rgba(255,255,255,0.22)":"#fff",color:o?"#fff":e.color,border:o?"none":"1px solid ".concat(ze(e.color))},children:n})]},e.status)}))}),(0,w.jsx)(H.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,w.jsx)(k.A,{value:fr,onChange:br,onDebouncedChange:yr,placeholder:"Search orders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:De(Me),"& fieldset":{borderColor:ze(Me),borderWidth:1.5},"&:hover fieldset":{borderColor:Me},"&.Mui-focused fieldset":{borderColor:Me,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(We(Me))}}})})]})}),(0,w.jsx)(O.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:ge/8,borderBottomRightRadius:ge/8,border:"1px solid",borderColor:ke,overflow:"hidden",background:"#fff"},children:(0,w.jsx)(X.A,{ref:c,onScroll:e=>{const{scrollTop:r,scrollHeight:t,clientHeight:o}=e.currentTarget;r+o>=t-50&&Rt&&!Ot&&Mt()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:ze(Me),borderRadius:8,"&:hover":{backgroundColor:Me}},"&::-webkit-scrollbar-track":{backgroundColor:Se}},children:(0,w.jsxs)(Q.A,{stickyHeader:!0,sx:{minWidth:{xs:960,md:1180}},children:[(0,w.jsx)(J.A,{children:(0,w.jsxs)(V.A,{sx:{"& th":{backgroundColor:Se,color:ve,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(ke),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:["created"==Ve&&(0,w.jsx)(G.A,{sx:{position:"sticky !important"},children:(0,w.jsx)($.A,{size:"small",sx:{p:.5,color:ze(Me),"&.Mui-checked, &.MuiCheckbox-indeterminate":{color:Me}},indeterminate:Er.length>0&&Er.length!==(null===Pt||void 0===Pt?void 0:Pt.length),checked:Er.length===(null===Pt||void 0===Pt?void 0:Pt.length),onChange:e=>{var r;if(!fe)return(0,C.k)("Please select a location first!","warning",2e3),void(null===(r=pe.current)||void 0===r||r.focus());if(e.target.checked){const e=null===Pt||void 0===Pt?void 0:Pt.map(((e,r)=>(0,o.A)((0,o.A)({},e),{},{sno:r+1})));Nr(e)}else Nr([])}})}),(0,w.jsx)(G.A,{children:"#"}),(0,w.jsx)(G.A,{children:"Tenant"}),(0,w.jsx)(G.A,{children:"Location"}),(0,w.jsx)(G.A,{children:"Pickup"}),(0,w.jsx)(G.A,{children:"Drop"}),(0,w.jsx)(G.A,{align:"center",children:"QTY"}),(0,w.jsx)(G.A,{align:"right",children:"COD"}),(0,w.jsx)(G.A,{align:"center",children:"KMS"}),(0,w.jsx)(G.A,{align:"right",children:"Charges"}),(0,w.jsx)(G.A,{children:"Notes"}),(0,w.jsx)(G.A,{children:"Status"}),"created"==Ve&&(0,w.jsx)(G.A,{align:"right",children:"Actions"})]})}),(0,w.jsxs)(ee.A,{children:[0===(null===Pt||void 0===Pt?void 0:Pt.length)&&!It&&(0,w.jsx)(V.A,{children:(0,w.jsx)(G.A,{colSpan:13,sx:{py:6},children:(0,w.jsxs)(N.A,{alignItems:"center",spacing:1.5,children:[(0,w.jsx)(Y.A,{sx:{width:64,height:64,bgcolor:Ie("#94a3b8"),color:ye},children:(0,w.jsx)(v.F6S,{size:28})}),(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:["No ",Ve," orders"]}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ve},children:fr?"Try a different keyword.":"Adjust the filters above to load orders."})]})})}),It&&(0,w.jsx)(D.r,{col:8}),null===Pt||void 0===Pt?void 0:Pt.map(((r,t)=>{const n=!!Er.find((e=>e.orderheaderid===r.orderheaderid));return(0,w.jsxs)(V.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s",backgroundColor:n?De(Me):"transparent","& td":{borderBottom:"1px solid ".concat(we),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:n?Ie(Me)+" !important":Se}},children:["created"===Ve&&(0,w.jsx)(G.A,{children:(0,w.jsx)($.A,{size:"small",sx:{p:.5,color:ze(Me),"&.Mui-checked":{color:Me}},onChange:e=>{var t;if(!fe)return(0,C.k)("Please select a location first!","warning",2e3),void(null===(t=pe.current)||void 0===t||t.focus());e.target.checked?Nr((e=>[...e,(0,o.A)((0,o.A)({},r),{},{sno:e.length+1})])):Nr((e=>e.filter((e=>e.orderheaderid!==r.orderheaderid)).map(((e,r)=>(0,o.A)((0,o.A)({},e),{},{sno:r+1})))))},checked:n})}),(0,w.jsx)(G.A,{children:(0,w.jsx)(q.A,{children:100*xr+t+1})}),(0,w.jsx)(G.A,{children:(0,w.jsxs)(Z.A,{title:r.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"subtitle1",noWrap:!0,children:r.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,variant:"body2",children:[r.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:r.applocation})]})}),(0,w.jsxs)(G.A,{align:"left",children:[(0,w.jsx)(q.A,{variant:"subtitle1",noWrap:!0,children:"".concat(r.locationname,"-(").concat(r.locationsuburb,")")}),(0,w.jsx)(Z.A,{title:"TenantId - OrderId",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:r.orderid})}),(0,w.jsx)(Z.A,{title:"Pickup Slot",children:(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:[d()(r.pickupslot).utc().format("DD/MM/YYYY")," ",d()(r.pickupslot).format("hh:mm A")]})})]}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:r.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:r.pickupcontactno}),(0,w.jsx)(Z.A,{title:r.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:"".concat(r.pickupsuburb||r.pickupaddress.slice(0,12)+".....")})})]})}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"subtitle1",sx:{maxWidth:120,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:r.deliverycontactno}),(0,w.jsx)(Z.A,{title:r.deliveryaddress,sx:{whiteSpace:"nowrap"},children:(0,w.jsx)(q.A,{variant:"caption",children:"".concat(r.deliverysuburb||r.deliveryaddress.slice(0,12)+".....")})})]})}),(0,w.jsx)(G.A,{align:"center",children:r.quantity?(0,w.jsx)(q.A,{variant:"subtitle1",color:"error",sx:{whiteSpace:"nowrap"},children:r.quantity}):(0,w.jsx)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:r.quantity})}),(0,w.jsx)(G.A,{align:"right",children:r.collectionamt?(0,w.jsxs)(q.A,{variant:"subtitle1",color:r.collectionamt?"error":null,sx:{whiteSpace:"nowrap"},children:["\u20b9",r.collectionamt.toFixed(2)]}):(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:["\u20b9",r.collectionamt.toFixed(2)]})}),(0,w.jsx)(G.A,{align:"center",children:(0,w.jsx)(q.A,{variant:"subtitle1",color:r.kms?"error":null,children:r.kms})}),(0,w.jsx)(G.A,{align:"right",children:r.deliverycharge?(0,w.jsxs)(q.A,{variant:"subtitle1",color:r.deliverycharge?"error":null,sx:{whiteSpace:"nowrap"},children:["\u20b9",r.deliverycharge.toFixed(2)]}):(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:["\u20b9",r.deliverycharge.toFixed(2)]})}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsx)(q.A,{variant:"body1",fontSize:"12px",sx:{maxWidth:120,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.ordernotes})}),(0,w.jsx)(G.A,{align:"left",children:(()=>{const e=Pe[String(r.orderstatus||"").toLowerCase()]||{label:r.orderstatus||"\u2014",color:Me,icon:v.bfP},t=e.icon;return(0,w.jsxs)(H.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:De(e.color),border:"1px solid ".concat(ze(e.color)),color:e.color,fontSize:11,fontWeight:800,whiteSpace:"nowrap"},children:[(0,w.jsx)(t,{size:12})," ",e.label]})})()}),"created"===r.orderstatus&&(0,w.jsx)(G.A,{align:"center",children:(0,w.jsxs)(N.A,{flexDirection:"row",justifyContent:"end",children:["C"===r.deliverytype&&(0,w.jsx)(Z.A,{title:"Product details",children:(0,w.jsx)(re.A,{color:"primary",onClick:()=>{(null===ur||void 0===ur?void 0:ur.orderid)===r.orderid?pr(null):pr(r)},children:(null===ur||void 0===ur?void 0:ur.orderid)===r.orderid?(0,w.jsx)(f.A,{}):(0,w.jsx)(b.A,{})})}),(0,w.jsx)(Z.A,{title:"To Cancel",children:(0,w.jsx)(re.A,{"aria-describedby":"aria-".concat(r.sno),disabled:n,onClick:()=>{er(!0),dr(r.orderheaderid)},children:(0,w.jsx)(A.A,{style:{color:n?e.palette.secondary.main:e.palette.error.main}})})})]})})]},r.sno)})),0!=(null===Pt||void 0===Pt?void 0:Pt.length)&&(0,w.jsx)(V.A,{children:(0,w.jsx)(G.A,{colSpan:15,rowSpan:3,sx:{borderBottom:"none"},children:(0,w.jsx)("div",{ref:t,style:{height:40,textAlign:"center"},children:Ot||Rt?(0,w.jsx)(de.A,{}):(0,w.jsx)(q.A,{variant:"caption",sx:{color:ye,fontWeight:600},children:"No more orders"})})})})]})]})})}),(0,w.jsxs)(te.A,{fullScreen:!0,open:rr,TransitionComponent:g.s,children:[(0,w.jsx)(P.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:kr,children:(0,w.jsx)(m.A,{color:"inherit",text:"Optimising ... .."})}),(0,w.jsx)(oe.A,{sx:{bgcolor:e.palette.primary.lighter},children:(0,w.jsx)(T.A,{badgeContent:null===Er||void 0===Er?void 0:Er.length,color:"primary",children:(0,w.jsx)(ne.A,{label:(0,w.jsx)(q.A,{variant:"h3",children:"Preview Orders "}),variant:"contained"})})}),(0,w.jsx)(ie.A,{dividers:!0,children:(0,w.jsx)(S.A,{content:!1,children:(0,w.jsx)(X.A,{children:(0,w.jsxs)(Q.A,{stickyHeader:!0,children:[(0,w.jsx)(J.A,{children:(0,w.jsxs)(V.A,{children:[(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"#"}),(0,w.jsxs)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:["Tenant"," "]}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"order Location"}),(0,w.jsxs)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:["Pickup"," "]}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Delivery"}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Notes"}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Charges"}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"KMS"})]})}),(0,w.jsx)(ee.A,{children:Er.map(((e,r)=>(0,w.jsx)(n.Fragment,{children:(0,w.jsxs)(V.A,{sx:{},children:[(0,w.jsx)(G.A,{children:(0,w.jsxs)(q.A,{children:[" ",e.sno]})}),(0,w.jsx)(G.A,{children:(0,w.jsxs)(Z.A,{title:e.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,w.jsxs)(G.A,{align:"left",children:[(0,w.jsx)(Z.A,{title:e.locationaddress,placement:"top",children:(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,w.jsx)(Z.A,{title:"Order Id",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,w.jsxs)(N.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,w.jsxs)(Z.A,{title:"Ordered date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,w.jsxs)(Z.A,{title:"Delivery date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsx)(N.A,{direction:"row",spacing:1,children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcontactno}),(0,w.jsx)(Z.A,{title:e.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsx)(N.A,{direction:"row",spacing:1,children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycontactno}),(0,w.jsx)(Z.A,{title:e.deliveryaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,w.jsx)(G.A,{align:"left",children:e.ordernotes}),(0,w.jsxs)(G.A,{align:"left",children:["\u20b9 ",e.deliverycharge.toFixed(2)]}),(0,w.jsx)(G.A,{align:"left",children:e.kms})]})},r)))})]})})})}),(0,w.jsx)(se.A,{sx:{bgcolor:e.palette.secondary.light},children:(0,w.jsx)(K.Ay,{container:!0,sx:{},children:(0,w.jsx)(K.Ay,{item:!0,xs:12,children:(0,w.jsxs)(N.A,{sx:{mt:2,mr:2},direction:"row",justifyContent:"flex-end",flexWrap:"wrap",gap:2,spacing:5,children:[(0,w.jsx)(le.A,{sx:{width:"130px"},color:"secondary",variant:"contained",onClick:()=>{Kt()},startIcon:(0,w.jsx)(A.A,{}),children:"Close"}),1==Gr.current&&(0,w.jsx)(B.A,{options:[{label:"Bike",value:1},{label:"Auto",value:2}],getOptionLabel:e=>e.label,value:et,onChange:(e,r)=>{rt(r),console.log("Selected value:",null===r||void 0===r?void 0:r.value)},renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({sx:{width:200,border:"1px solid ",borderColor:"primary.main"}},e),{},{placeholder:"Select Transport"})),isOptionEqualToValue:(e,r)=>e.value===r.value}),1==Gr.current&&(0,w.jsx)(B.A,{multiple:!0,fullWidth:!1,options:ft||[],loading:bt,disableCloseOnSelect:!0,limitTags:2,value:tt,onChange:(e,r)=>ot(r),getOptionLabel:e=>"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"Rider #".concat(e.userid),isOptionEqualToValue:(e,r)=>e.userid===r.userid,PaperComponent:e=>(0,w.jsx)(O.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:"0 14px 40px rgba(15, 23, 42, 0.18)",border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ListboxProps:{sx:{py:0,maxHeight:340}},noOptionsText:(0,w.jsxs)(N.A,{alignItems:"center",py:2,spacing:1,children:[(0,w.jsx)(v.vbW,{size:26,color:"#94a3b8"}),(0,w.jsx)(q.A,{variant:"caption",color:"text.secondary",children:"No riders to show for this location"})]}),renderTags:(e,r)=>e.map(((e,t)=>{const i="".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"Rider #".concat(e.userid),s=(i.match(/\b\w/g)||[]).slice(0,2).join("").toUpperCase()||"?",l=r({index:t});return(0,n.createElement)(ne.A,(0,o.A)((0,o.A)({},l),{},{key:e.userid,size:"small",avatar:(0,w.jsx)(Y.A,{sx:{bgcolor:"#fed7aa",color:"#9a3412",fontSize:10,fontWeight:800},children:s}),label:i,sx:{height:26,bgcolor:"#fff7ed",color:"#9a3412",border:"1px solid",borderColor:"#fdba74",fontWeight:600,fontSize:12,"& .MuiChip-label":{px:.75},"& .MuiChip-deleteIcon":{color:"#c2410c",fontSize:16,"&:hover":{color:"#7c2d12"}}}}))})),renderOption:(e,r,t)=>{let{selected:i}=t;const s="".concat(r.firstname||""," ").concat(r.lastname||"").trim(),l=(s.match(/\b\w/g)||[]).slice(0,2).join("").toUpperCase()||"?";return(0,n.createElement)("li",(0,o.A)((0,o.A)({},e),{},{key:r.userid,style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",borderBottom:"1px solid #f1f5f9",backgroundColor:i?"#fff7ed":"transparent"}}),(0,w.jsx)($.A,{size:"small",checked:i,sx:{p:.5,color:"#fb923c","&.Mui-checked":{color:"#ea580c"}}}),(0,w.jsx)(Y.A,{sx:{width:34,height:34,bgcolor:i?"#fb923c":"#f1f5f9",color:i?"#fff":"#475569",fontSize:12,fontWeight:800,transition:"background-color 0.15s, color 0.15s"},children:l}),(0,w.jsxs)(N.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,w.jsx)(q.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:s||"Rider #".concat(r.userid)}),(0,w.jsxs)(q.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:["ID #",r.userid,r.contactno?" \xb7 ".concat(r.contactno):""]})]}),i&&(0,w.jsx)(ne.A,{size:"small",label:"Absent",sx:{height:18,fontSize:9,fontWeight:800,letterSpacing:.3,bgcolor:"#ea580c",color:"#fff","& .MuiChip-label":{px:.75}}}))},renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{label:"Absent Riders",placeholder:tt.length?"":"Pick riders unavailable today",InputLabelProps:{shrink:!0},InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25},children:[(0,w.jsx)(v.ihY,{size:18,color:"#ea580c"}),tt.length>0&&(0,w.jsx)(ne.A,{size:"small",label:tt.length,sx:{height:18,minWidth:22,fontSize:10,fontWeight:800,bgcolor:"#ea580c",color:"#fff","& .MuiChip-label":{px:.5}}}),e.InputProps.startAdornment]})}),sx:{minWidth:300,maxWidth:440,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fffbf5",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#fdba74",borderWidth:1.5},"&:hover fieldset":{borderColor:"#fb923c"},"&.Mui-focused":{boxShadow:"0 0 0 3px rgba(251, 146, 60, 0.18)"},"&.Mui-focused fieldset":{borderColor:"#ea580c",borderWidth:2}},"& .MuiInputLabel-root":{fontWeight:700,fontSize:13,color:"#9a3412","&.Mui-focused":{color:"#9a3412"}}}})),sx:{"& .MuiAutocomplete-tag":{my:.25},"& .MuiAutocomplete-endAdornment":{right:8}}}),(0,w.jsx)(le.A,{color:"primary",disabled:!et&&1==Gr.current,variant:"contained",startIcon:1==Gr.current&&(0,w.jsx)("img",{src:W,alt:"Assign",style:{width:32,height:32,objectFit:"contain",borderRadius:50}}),onClick:()=>{wr(!0),qt()},children:Ee?"Optimising...":0==Gr.current?"Optimise Orders":"AI Optimise Orders"})]})})})})]}),(0,w.jsxs)(te.A,{fullScreen:!0,open:Pr,TransitionComponent:g.s,children:[(0,w.jsx)(oe.A,{children:(0,w.jsx)(N.A,{children:(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,w.jsx)(Z.A,{title:"Back to orders",placement:"top",children:(0,w.jsx)(re.A,{onClick:()=>Fr(!1),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,w.jsx)(M.eQE,{size:22})})}),(0,w.jsx)(q.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]})})}),(0,w.jsx)(ae.A,{}),(0,w.jsx)(ie.A,{children:(0,w.jsxs)(S.A,{content:!1,children:[(jt||bt||Sr)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(j.A,{}),(0,w.jsx)(m.A,{})]}),(0,w.jsx)(P.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:jt||bt||Sr,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(X.A,{children:(0,w.jsxs)(Q.A,{stickyHeader:!0,children:[(0,w.jsx)(J.A,{children:(0,w.jsxs)(V.A,{sx:{backgroundColor:"red"},children:[(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"#"}),1==Zr&&(0,w.jsxs)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Zone"," "]}),(0,w.jsxs)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Tenant"," "]}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"order Location"}),(0,w.jsxs)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Pickup"," "]}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Delivery"}),(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Notes"}),1==Zr&&(0,w.jsx)(G.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Rider"}),(0,w.jsx)(G.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Type"}),(0,w.jsx)(G.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Charges"}),(0,w.jsx)(G.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"KMS"})]})}),(0,w.jsxs)(ee.A,{children:[0==(null===Jr||void 0===Jr?void 0:Jr.length)&&(0,w.jsx)(V.A,{children:(0,w.jsx)(G.A,{colSpan:10,children:(0,w.jsx)(a.A,{})})}),null===Jr||void 0===Jr?void 0:Jr.map(((e,r)=>(0,w.jsxs)(V.A,{sx:{},children:[(0,w.jsx)(G.A,{children:(0,w.jsxs)(q.A,{children:[" ",r+1]})}),(0,w.jsx)(G.A,{children:(0,w.jsxs)(Z.A,{title:e.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,w.jsxs)(G.A,{align:"left",children:[(0,w.jsx)(Z.A,{title:e.locationaddress,placement:"top",children:(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,w.jsx)(Z.A,{title:"Order Id",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,w.jsxs)(N.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,w.jsxs)(Z.A,{title:"Ordered date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,w.jsxs)(Z.A,{title:"Delivery date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsx)(N.A,{direction:"row",spacing:1,children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcontactno}),(0,w.jsx)(Z.A,{title:e.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,w.jsx)(G.A,{align:"left",children:(0,w.jsx)(N.A,{direction:"row",spacing:1,children:(0,w.jsxs)(N.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycontactno}),(0,w.jsx)(Z.A,{title:e.deliveryaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,w.jsx)(G.A,{align:"left",children:e.ordernotes}),(0,w.jsx)(G.A,{align:"center",children:(0,w.jsx)(ne.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary",variant:"light"})}),(0,w.jsx)(G.A,{align:"center",children:(0,w.jsxs)(N.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,w.jsx)(Z.A,{title:"Charges",placement:"top",children:(0,w.jsx)(ne.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error",variant:"light"})}),(0,w.jsx)(Z.A,{title:"Amount",placement:"left",children:(0,w.jsx)(ne.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success",variant:"light"})})]})}),(0,w.jsx)(G.A,{align:"center",children:(0,w.jsxs)(N.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,w.jsx)(Z.A,{title:"KMS",placement:"top",children:(0,w.jsx)(ne.A,{size:"small",label:"".concat(e.kms," km"),color:"error",variant:"light"})}),(0,w.jsx)(Z.A,{title:"Cumulative Kms",placement:"right",children:(0,w.jsx)(ne.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success",variant:"light"})})]})})]},r)))]})]})}),(0,w.jsx)(ae.A,{})]})}),(0,w.jsx)(ae.A,{}),(0,w.jsxs)(se.A,{sx:{flexDirection:"column",alignItems:"stretch",p:2,gap:2},children:[(0,w.jsxs)(K.Ay,{container:!0,spacing:2,children:[(0,w.jsx)(K.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsx)(B.A,{options:mt,fullWidth:!0,renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{label:"Choose Payment"})),onChange:(e,r,t)=>{if("clear"!==t){if(r){ar(r);const e=null===Jr||void 0===Jr?void 0:Jr.map((e=>(0,o.A)((0,o.A)({},e),{},{paymenttype:r.apptypeid||42})));Vr(e)}}else ar(null)}})}),(0,w.jsx)(K.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsx)(B.A,{options:ft,fullWidth:!0,renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{label:"Choose Rider"})),onChange:(e,r,t)=>{if("clear"!==t){if(r){sr(r);const e=null===Jr||void 0===Jr?void 0:Jr.map((e=>(0,o.A)((0,o.A)({},e),{},{userid:r.userid,fuelcharge:r.fuelcharge||0,userfcmtoken:r.userfcmtoken})));Vr(e)}}else sr(null)}})})]}),(0,w.jsxs)(N.A,{direction:"row",spacing:2,justifyContent:"flex-end",sx:{pt:1,my:2},children:[(0,w.jsx)(le.A,{variant:"outlined",color:"secondary",startIcon:(0,w.jsx)(z.A,{}),onClick:()=>Fr(!1),children:"Back"}),(0,w.jsx)(le.A,{variant:"contained",disabled:!ir||!lr,onClick:()=>{null!==Jr&&void 0!==Jr&&Jr.length?Tt.mutate({deliveries:Jr}):(0,C.k)("No deliveries selected","error",3e3)},children:"Assign Orders"})]})]})]}),(0,w.jsxs)(te.A,{open:Or,fullScreen:!0,TransitionComponent:g.s,PaperProps:{sx:{display:"flex",flexDirection:"column",overflow:"hidden"}},children:[(0,w.jsx)(P.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:Sr,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(oe.A,{sx:{py:1.25},children:(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{},children:[(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,w.jsx)(Z.A,{title:"Back to orders",placement:"top",children:(0,w.jsx)(re.A,{onClick:()=>r("/nearle/orders"),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"}},children:(0,w.jsx)(M.eQE,{size:20})})}),(0,w.jsx)(q.A,{variant:"h3",fontWeight:600,children:"Assign Orders"})]}),(0,w.jsxs)(N.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,w.jsx)(B.A,{options:[{tuneid:1,type:"Balanced",value:"balanced"},{tuneid:2,type:"Aggressive Speed",value:"aggressive_speed"},{tuneid:3,type:"Fuel Saver",value:"fuel_saver"},{tuneid:4,type:"Zone Strict",value:"zone_strict"}]||[],getOptionLabel:e=>e.type,sx:{minWidth:250,maxWidth:600,flex:1},renderInput:e=>(0,w.jsx)(U.A,(0,o.A)((0,o.A)({},e),{},{label:"Hyper Tuning"})),onChange:(e,r,t)=>{"clear"===t?qt(null):(console.log("val",r),qt(r.value))}}),(0,w.jsx)(le.A,{variant:"contained",color:"primary",startIcon:(0,w.jsx)(R.UF6,{}),onClick:()=>{Cr(!0),qt("reshuffle")},children:"Re-Assign"}),(0,w.jsx)(he.Ay,{data:Xr,filename:"Orders_Detail_".concat(d()().format("YYYY-MM-DD_HHmmss"),".csv"),label:" CSV",style:{m:1}})]})]})}),(0,w.jsx)(ie.A,{sx:{p:0,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},children:Tr&&(0,w.jsx)(ue.default,{data:Tr,embedded:!0})}),(0,w.jsx)(se.A,{sx:{px:2,py:1.25},children:(0,w.jsxs)(N.A,{direction:"row",gap:2,alignItems:"center",justifyContent:"end",children:[(0,w.jsx)(le.A,{variant:"contained",color:"secondary",startIcon:(0,w.jsx)(z.A,{}),onClick:()=>{Yr(!1)},children:"Back"}),(0,w.jsx)(le.A,{variant:"contained",onClick:async()=>{Cr(!0),Ht.mutate({deliveries:Jr})},children:"Assign Orders"})]})})]}),(0,w.jsx)(te.A,{open:$e,onClose:()=>handleClose(),maxWidth:"xs",children:(0,w.jsx)(ie.A,{sx:{mt:2,my:1},children:(0,w.jsxs)(N.A,{alignItems:"center",spacing:3.5,children:[(0,w.jsx)(Y.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,w.jsx)(l.A,{})}),(0,w.jsx)(N.A,{spacing:2,children:(0,w.jsx)(q.A,{variant:"h4",align:"center",children:"Are you sure you want to cancel this order?"})}),(0,w.jsxs)(N.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,w.jsx)(le.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{Lt.mutate(cr)},autoFocus:!0,children:"Yes, Cancel"}),(0,w.jsx)(le.A,{fullWidth:!0,onClick:()=>{er(!1)},color:"secondary",variant:"outlined",children:"No"})]})]})})}),(0,w.jsx)(te.A,{open:or,onClose:()=>nr(!1),maxWidth:"xs",children:(0,w.jsx)(ie.A,{sx:{mt:2,my:1},children:(0,w.jsxs)(N.A,{alignItems:"center",spacing:3.5,children:[(0,w.jsx)(Y.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,w.jsx)(l.A,{})}),(0,w.jsx)(N.A,{spacing:2,children:(0,w.jsx)(q.A,{variant:"h4",align:"center",children:"Are you sure, you want to cancel multiple orders?"})}),(0,w.jsxs)(N.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,w.jsx)(le.A,{fullWidth:!0,onClick:()=>{nr(!1)},color:"secondary",variant:"outlined",children:"No"}),(0,w.jsx)(le.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{Et.mutate(Er)},autoFocus:!0,children:"Yes, Cancel"})]})]})})})]})}},35678:(e,r,t)=>{t.d(r,{A:()=>v});var o=t(9950),n=t(96583),i=t(40033),s=t(82053),l=t(28170),a=t(93230),c=t(82223),d=t(55916),x=t(4159),h=t.n(x),u=t(56712),p=t(81417),A=t(96600),g=t(53132),m=t(94289),j=t(57326),f=t(50624),b=t(44414);const v=e=>{let{open:r,onClose:t,onSelect:x}=e;const[v,y]=(0,o.useState)(null);return(0,b.jsxs)(n.A,{open:r,onClose:t,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:r,toggle:t,id:"daterange1",onChange:e=>{y({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,A.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,g.A)(new Date,-1)),endDate:(0,A.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,m.A)(new Date),endDate:(0,j.A)(new Date)},{label:"Last Month",startDate:(0,m.A)((0,f.A)(new Date,-1)),endDate:(0,j.A)((0,f.A)(new Date,-1))}]})}),(0,b.jsx)(a.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),t()):t()},children:"OK"})})]})}},47659:(e,r,t)=>{t.d(r,{A:()=>d});var o=t(89379),n=t(48089),i=t(50704),s=t(16491),l=t(82053),a=t(60899),c=t(44414);const d=e=>{let{primary:r,secondary:t,percentage:d,color:x,sx:h}=e;return(0,c.jsx)(n.A,{elevation:0,sx:(0,o.A)({background:x,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},h),children:(0,c.jsxs)(i.A,{children:[(0,c.jsx)(s.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,c.jsx)(l.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,c.jsxs)(a.Ay,{container:!0,spacing:0,children:[(0,c.jsx)(a.Ay,{item:!0,xs:12,children:(0,c.jsx)(l.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:t})}),(0,c.jsx)(a.Ay,{item:!0,xs:12,children:(0,c.jsx)(l.A,{variant:"subtitle2",color:"inherit",children:r})})]})]})})}},56311:(e,r,t)=>{t.d(r,{A:()=>u});var o=t(89379),n=t(9950),i=t(2660),s=t(2046),l=t(83274),a=t(25333),c=t(97125),d=t(7762),x=t(52097),h=t(44414);const u=e=>{let{value:r,onChange:t,onDebouncedChange:u,debounceTime:p=500,placeholder:A="Search (ctrl+k)",sx:g}=e;const m=(0,n.useRef)(null),[j]=(0,x.d7)(r,p);return(0,n.useEffect)((()=>{u&&u(j)}),[j,u]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=m.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},g),inputRef:m,placeholder:A,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>t(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>t(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,r,t)=>{t.d(r,{A:()=>l});t(9950);var o=t(16491),n=t(46639),i=t(62217),s=t(44414);function l(e){let{size:r=70,imgSize:t=40,alt:l="loader"}=e;return(0,s.jsxs)(o.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,s.jsx)(n.A,{size:r}),(0,s.jsx)(o.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:t,height:t},children:(0,s.jsx)("img",{src:i,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,r,t)=>{t.d(r,{A:()=>h});var o=t(89379),n=t(9950),i=t(93230),s=t(41413),l=t(77922),a=t(29925),c=t(26910),d=t(31222),x=t(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:t,setLocoName:h,setPage:u,sx:p,textfeildSx:A,textfieldSx:g,pill:m=!1,accentColor:j="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:v}=e;const[y,k]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),k(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const w=e=>"".concat(j).concat(e),S=w("08"),C=w("26"),D=w("55"),I=w("18"),W=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:S,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:D,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},z=m&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:I,color:j,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,r,o)=>{"clear"===o?(null===t||void 0===t||t(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):r&&(null===t||void 0===t||t(r.applocationid),null===h||void 0===h||h(r.locationname),null===u||void 0===u||u(0))},renderInput:e=>m?(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:z}),sx:(0,o.A)((0,o.A)({},W),g||A||{})})):(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,o.A)({},g||A||{})}))})}))},96646:(e,r,t)=>{t.d(r,{r:()=>a});var o=t(9213),n=t(21671),i=t(82917),s=t(93230),l=t(44414);const a=e=>{let{rowsPerPage:r=5,col:t=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(o.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:t}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}}}]); \ No newline at end of file diff --git a/build/static/js/4947.c561ede9.chunk.js b/build/static/js/4947.c561ede9.chunk.js new file mode 100644 index 0000000..61a30fc --- /dev/null +++ b/build/static/js/4947.c561ede9.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4947],{13968:(e,r,o)=>{o.r(r),o.d(r,{default:()=>Ee});var n=o(89379),t=o(9950),i=o(47965),s=o(44070),l=o(36256),a=o(13838),c=o(4159),d=o.n(c),x=o(36150),h=o(60010),p=o(51778),u=(o(47659),o(14857)),A=o(94118),g=o(37476),m=o(94826),j=o(52351),f=o(67562),b=o(49883),v=o(31222),y=o(35678),k=o(56311),w=o(44414);var S=o(50027),C=o(20466),W=o(96646),D=o(59212);const z=o.p+"static/media/aiImage.89c2ccb91a41d85031e3.png";var I=o(63189),M=o(99324),Y=o(6604),R=o(2235),O=o(41413),P=o(47223),F=o(55158),T=o(59382),L=o(28810),E=o(79046),N=o(33092),H=o(93230),q=o(82053),K=o(16491),_=o(60899),B=o(82917),U=o(77922),Z=o(29925),X=o(83274),Q=o(1320),V=o(93038),G=o(25333),J=o(15769),$=o(69780),ee=o(9213),re=o(21671),oe=o(34075),ne=o(96583),te=o(40033),ie=o(25277),se=o(28170),le=o(79739),ae=o(82223),ce=o(74745),de=o(81425),xe=o(58691),he=o(23787),pe=o(28429),ue=o(90376),Ae=o(54413),ge=o(36220);d().extend(ge);const me=999,je=16,fe="0 14px 40px rgba(15, 23, 42, 0.10)",be="0 8px 24px rgba(15, 23, 42, 0.08)",ve="0 18px 50px rgba(15, 23, 42, 0.18)",ye="#0f172a",ke="#64748b",we="#94a3b8",Se="#e2e8f0",Ce="#f1f5f9",We="#f8fafc",De=(e,r)=>"".concat(e).concat(r),ze=e=>De(e,"08"),Ie=e=>De(e,"18"),Me=e=>De(e,"26"),Ye=e=>De(e,"55"),Re="#662582",Oe=e=>(0,w.jsx)(R.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:ve,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Pe=e=>{let{color:r,selected:o,size:n=24,children:t}=e;return(0,w.jsx)(O.A,{sx:{width:n,height:n,bgcolor:o?r:Ie(r),color:o?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:t})},Fe=e=>({"& .MuiOutlinedInput-root":{borderRadius:me+"px",bgcolor:ze(e),fontWeight:600,"& fieldset":{borderColor:Ye(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Me(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}),Te={created:{label:"Created",color:"#0ea5e9",icon:v.F6S},pending:{label:"Pending",color:"#f59e0b",icon:v.tX0},processing:{label:"Processing",color:"#0ea5e9",icon:v.bfP},modified:{label:"Modified",color:"#06b6d4",icon:v.bfP},confirmed:{label:"Confirmed",color:"#10b981",icon:v.mU9},accepted:{label:"Accepted",color:"#6366f1",icon:v.mU9},delivered:{label:"Delivered",color:"#10b981",icon:v.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:v.uDv}},Le=[{idx:0,status:"created",label:"Created",color:Re,icon:v.F6S,countKey:"created"},{idx:1,status:"pending",label:"Pending",color:"#f59e0b",icon:v.tX0,countKey:"pending"},{idx:2,status:"delivered",label:"Delivered",color:"#10b981",icon:v.mU9,countKey:"delivered"},{idx:3,status:"cancelled",label:"Cancelled",color:"#ef4444",icon:v.uDv,countKey:"cancelled"}],Ee=()=>{const e=(0,u.A)(),r=(0,P.A)(e.breakpoints.down("md")),o=(0,pe.Zp)(),c=(0,t.useRef)(),ge=(0,t.useRef)(),me=(0,t.useRef)(null),ve=(0,t.useRef)(null),[De,Ee]=(0,t.useState)(0),[Ne,He]=(0,t.useState)("All"),[qe,Ke]=(0,t.useState)(!1),[_e,Be]=(0,t.useState)(d()().format("YYYY-MM-DD")),[Ue,Ze]=(0,t.useState)(d()().format("YYYY-MM-DD")),[Xe,Qe]=(0,t.useState)("Today"),[Ve,Ge]=(0,t.useState)(!1),[Je,$e]=(0,t.useState)(0),[er,rr]=(0,t.useState)("created"),[or,nr]=(0,t.useState)(!1),[tr,ir]=(0,t.useState)(!1),[sr,lr]=(0,t.useState)(!1),[ar,cr]=(0,t.useState)(null),[dr,xr]=(0,t.useState)(null),[hr,pr]=(0,t.useState)(""),[ur,Ar]=(0,t.useState)(0),[gr,mr]=(0,t.useState)(null),[jr,fr]=(0,t.useState)(0),[br,vr]=(0,t.useState)(0),[yr,kr]=(0,t.useState)(""),[wr,Sr]=(0,t.useState)(""),[Cr,Wr]=(0,t.useState)(!1),[Dr,zr]=(0,t.useState)(!1),[Ir,Mr]=(0,t.useState)(null),[Yr,Rr]=(0,t.useState)(null),[Or,Pr]=(0,t.useState)(!1),[Fr,Tr]=(0,t.useState)(!1),[Lr,Er]=(0,t.useState)(!1),[Nr,Hr]=(0,t.useState)(null),[qr,Kr]=(0,t.useState)([]),[_r,Br]=(0,t.useState)([]),[Ur,Zr]=(0,t.useState)(null),[Xr,Qr]=(0,t.useState)(null),[Vr]=(0,t.useState)(0),[Gr,Jr]=(0,t.useState)([]),[$r,eo]=(0,t.useState)([]),ro=(0,t.useRef)(0),oo=(0,t.useRef)(null),[no,to]=(0,t.useState)(null),[io,so]=(0,t.useState)([]);(0,t.useEffect)((()=>{fr(0),Mr(null),vr(0),Rr(null)}),[De]),(0,t.useEffect)((()=>{vr(0),Rr(null)}),[jr]),(0,t.useEffect)((()=>{const e=$r.map((e=>({zone_name:e.zone_name,ordernotes:e.ordernotes,rider:e.rider,step:e.step,ordertype:e.ordertype,orderamount:e.orderamount,riderkms:e.riderkms,cumulativekms:e.cumulativekms,baseprice:e.baseprice,minkm:e.minkm,priceperkm:e.priceperkm,kms:e.kms,actualkms:e.actualkms,rider_charge:e.rider_charge,deliveryamt:e.deliveryamt,deliverycharges:e.deliverycharges,profit:e.profit})));Jr(e),console.log("csvExportData",e)}),[$r]),(0,t.useEffect)((()=>{if(null===_r||void 0===_r||!_r.length)return;const e=_r.map((e=>{const r=Number(e.cumulativekms||0),o=Number(e.minkm||0),t=Number(e.baseprice||0),i=Number(e.priceperkm||0);return r<=o?(0,n.A)((0,n.A)({},e),{},{deliveryamt:t}):(0,n.A)((0,n.A)({},e),{},{deliveryamt:(r-o)*i+t})}));eo(e),console.log("finaldeliveryList",e)}),[_r]);const{data:lo,isLoading:ao,isError:co,error:xo,refetch:ho}=(0,x.I)({queryKey:["percentageData",De],queryFn:()=>(0,de.jy)(De),enabled:!0}),{data:po,isLoading:uo,isError:Ao,error:go}=(0,x.I)({queryKey:["tenantlist",De],queryFn:()=>(0,de.Mn)(De),enabled:0!==De}),{data:mo,isLoading:jo,isError:fo,error:bo}=(0,x.I)({queryKey:["gettenantlocations",jr],queryFn:()=>(0,de.DL)(jr),enabled:0!==jr}),{data:vo=[],isLoading:yo}=(0,x.I)({queryKey:["paymentmodes"],queryFn:de.HY}),{data:ko=[],isLoading:wo}=(0,x.I)({queryKey:["ridersList",De],queryFn:de.Sd,enabled:0!==De}),{data:So,isLoading:Co,isError:Wo,error:Do,refetch:zo}=(0,x.I)({queryKey:["ordersCount",De,_e,Ue,er,jr,br],queryFn:de.Hh,refetchOnMount:!0,refetchOnWindowFocus:!0}),{data:Io}=(0,x.I)({queryKey:["getallriders"],queryFn:de.Xw,refetchOnMount:!0,refetchOnWindowFocus:!0}),{data:Mo,isLoading:Yo,isError:Ro,error:Oo,fetchNextPage:Po,hasNextPage:Fo,isFetchingNextPage:To,refetch:Lo}=(0,h.q)({queryKey:["fetchOrders",De,er,wr,_e,Ue,100,jr,br],queryFn:de.nQ,getNextPageParam:e=>{var r;return null!==(r=e.nextPage)&&void 0!==r?r:void 0},refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0,staleTime:0}),Eo=(null===Mo||void 0===Mo?void 0:Mo.pages.flatMap((e=>e.rows)))||[];(0,t.useEffect)((()=>{if(!Fo)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Po()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return c.current&&e.observe(c.current),()=>{c.current&&e.unobserve(c.current)}}),[Fo,Po]);const No=(0,p.n)({mutationFn:0==ro.current?de.FC:de.Yk,onSuccess:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(console.log("data",e),console.log("varialbles",r),(0,C.k)("Orders Optimised Successfully","success",2e3),zo(),Lo(),Ke(!1),Wr(!1),0==ro.current)Br(null===e||void 0===e?void 0:e.details),Zr(null===e||void 0===e?void 0:e.zones),Qr(null===e||void 0===e?void 0:e.meta),Er(!0);else{var n,t,i;Br(null===e||void 0===e?void 0:e.details),Zr(null===e||void 0===e?void 0:e.zones),Qr(null===e||void 0===e?void 0:e.meta),Hr(e);const r=oo.current||{};o("/nearle/dispatch/preview",{state:{dispatchPreviewData:e,aiMode:null!==(n=r.aiMode)&&void 0!==n?n:ro.current,selectedMode:r.selectedMode||no,deliveryData:r.deliveryData||[],autoRiders:r.autoRiders||Io||[],absentRidersPayload:r.absentRidersPayload||[],rider:r.rider||ar,appId:null!==(t=r.appId)&&void 0!==t?t:De,tenantId:null!==(i=r.tenantid)&&void 0!==i?i:jr,startdate:_e}})}},onError:e=>{(0,C.k)(e.message,"error",4e3),Wr(!1),Ke(!1)},onSettled:()=>{Zo(),Ke(!1),Wr(!1),zr(!1)}}),Ho=(0,p.n)({mutationFn:de.H2,onMutate:()=>{zr(!0)},onSuccess:e=>{console.log("create data",e),(0,C.k)("Delivery Created Successfully","success",2e3),o("/nearle/deliveries"),_o.mutate(null===ar||void 0===ar?void 0:ar.userfcmtoken)},onError:e=>{(0,C.k)(e.message,"error",4e3)},onSettled:()=>{zr(!1)}}),qo=(0,p.n)({mutationFn:de.N4,onSuccess:e=>{e.status&&(nr(!1),(0,C.k)("Order Cancelled Successfully","success",2e3),zo(),ho())},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),Ko=(0,p.n)({mutationFn:de.zR,onSuccess:e=>{e.status&&(lr(!1),(0,C.k)("Order Cancelled Successfully","success",2e3),Lo(),zo(),ho(),Kr([]))},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),_o=(0,p.n)({mutationFn:de.k3,onSuccess:()=>{(0,C.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,C.k)(e.message,"error",2e3)}}),Bo=async e=>{zr(!0),Ke(!0);const r=qr.map((e=>(0,n.A)((0,n.A)({},e),{},{deliveryid:0,deliverydate:d()(e.deliverydate).utc().format("YYYY-MM-DD HH:mm:ss"),assigntime:d()().format("YYYY-MM-DD HH:mm:ss"),orderstatus:"pending",orderamount:e.deliverycharge,droplat:e.deliverylat,droplon:e.deliverylong,pickuplat:e.pickuplat,pickuplon:e.pickuplong,ordernotes:e.ordernotes,deliverycharges:e.deliverycharge,pickuplocation:e.pickupsuburb,deliverylocation:e.deliverysuburb})));console.log("deliveryData",r);const o=(io||[]).map((e=>({userid:e.userid,username:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||e.username||"Rider ".concat(e.userid)})));oo.current={deliveryData:r,absentRidersPayload:o,autoRiders:Io,selectedMode:no,aiMode:ro.current,rider:ar,appId:De,tenantid:jr},0==ro.current?No.mutate({deliveries:r}):no&&1==(null===no||void 0===no?void 0:no.value)?No.mutate({deliveries:1==no.value?r:{body:r},hypertuning_params:e||null,selectedMode:no,absent_riders:o}):No.mutate({data:{orders:r,riders:Io,config:{pay_type:"hourly",base_pay:300,strategy:"multi_trip"},absent_riders:o},selectedMode:no})},Uo=(0,p.n)({mutationFn:de.H2,onSuccess:(e,r)=>{console.log("data",e),console.log("varialbles",r),(0,C.k)("Delivery Created Successfully","success",2e3),zr(!1),o("/nearle/deliveries")},onError:e=>{(0,C.k)(e.message,"error",4e3)},onSettled:()=>{zr(!1)}}),Zo=()=>{ir(!1),cr(null),xr(null),to(null),so([])},Xo=co?"Error fetching percentages: ".concat(null===xo||void 0===xo?void 0:xo.message):Wo?"Error fetching orders Count: ".concat(null===Do||void 0===Do?void 0:Do.message):Ro?"Error fetching orders : ".concat(null===Oo||void 0===Oo?void 0:Oo.message):Ao?"Error Fetching on Tenants:".concat(null===go||void 0===go?void 0:go.message," "):fo?"Error Fetching on Tenants Locations:".concat(null===bo||void 0===bo?void 0:bo.message," "):null;return(0,t.useEffect)((()=>{Xo&&(console.log(Xo),(0,C.k)(Xo,"error",3e3))}),[Xo]),(0,w.jsxs)(t.Fragment,{children:[(ao||Co||Yo||uo||jo||Cr)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(j.A,{}),(0,w.jsx)(m.A,{})]}),(0,w.jsx)(F.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Cr||Yo,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(F.A,{sx:{zIndex:1e3},open:Or}),qr.length>0&&(0,w.jsxs)(T.A,{ariaLabel:"Actions",icon:(0,w.jsx)(L.A,{badgeContent:(null===qr||void 0===qr?void 0:qr.length)||"",color:"secondary",children:(0,w.jsx)(E.A,{})}),open:Or,onOpen:()=>Pr(!0),onClose:()=>Pr(!1),sx:{position:"fixed",bottom:52,right:16,"& .MuiFab-primary":{bgcolor:"#7b1fa2",color:"#fff","&:hover":{bgcolor:"#6a1b9a"},width:64,height:64}},children:[(0,w.jsx)(N.A,{icon:(0,w.jsx)("img",{src:z,alt:"Assign",style:{width:38,height:38,objectFit:"contain",borderRadius:50}}),tooltipTitle:" Optimisation",FabProps:{sx:{bgcolor:"primary.main",color:"#fff","&:hover":{bgcolor:"primary.dark"},width:64,height:64}},onClick:()=>{ro.current=1,Pr(!1),ir(!0)}}),(0,w.jsx)(N.A,{icon:(0,w.jsx)(i.A,{style:{fontSize:22}}),tooltipTitle:"Manual Assign",FabProps:{sx:{bgcolor:"success.600",color:"#fff","&:hover":{bgcolor:"success.dark"},width:64,height:64}},onClick:()=>{ro.current=0,Pr(!1),ir(!0)}}),(0,w.jsx)(N.A,{icon:(0,w.jsx)(s.A,{style:{fontSize:22}}),tooltipTitle:"Delete",FabProps:{sx:{bgcolor:"#d32f2f",color:"#fff","&:hover":{bgcolor:"#9a0007"},width:64,height:64}},onClick:()=>{Pr(!1),lr(!0)}})]}),(0,w.jsx)(R.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:je/8,border:"1px solid",borderColor:Se,background:"linear-gradient(135deg, ".concat(ze(Re)," 0%, ").concat(ze("#9255AB")," 100%)"),boxShadow:be},children:(0,w.jsxs)(H.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,w.jsx)(O.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Re,color:"#fff",boxShadow:"0 6px 18px ".concat(Me(Re))},children:(0,w.jsx)(v.F6S,{size:22})}),(0,w.jsxs)(H.A,{children:[(0,w.jsx)(q.A,{variant:"h3",sx:{fontWeight:800,color:ye,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders"}),(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,w.jsx)(K.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,w.jsxs)(q.A,{variant:"caption",sx:{color:ke,fontWeight:600},children:["Live \xb7 ",Ne||"All Zones"," \xb7 ",Xe]})]})]})]}),(0,w.jsx)(D.A,{ref:me,locaName:Ne,setAppId:Ee,setLocoName:He,setPage:Ar,pill:!0,accentColor:Re,icon:(0,w.jsx)(v.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Oe,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,w.jsx)(_.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:v.F6S,value:null===lo||void 0===lo?void 0:lo.created,percentage:null===lo||void 0===lo?void 0:lo.percentage1},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:v.tX0,value:null===lo||void 0===lo?void 0:lo.uncoveredOrders,percentage:null===lo||void 0===lo?void 0:lo.percentage2},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:v.mU9,value:null===lo||void 0===lo?void 0:lo.coveredOrders,percentage:null===lo||void 0===lo?void 0:lo.percentage3},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:v.uDv,value:null===lo||void 0===lo?void 0:lo.cancelled,percentage:null===lo||void 0===lo?void 0:lo.percentage4}].map((e=>{var r;const o=e.icon;return(0,w.jsx)(_.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,w.jsxs)(R.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:je/8,border:"1px solid",borderColor:Se,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:be,borderColor:Ye(e.color)}},children:[(0,w.jsx)(K.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Ie(e.color)," 100%)")}}),(0,w.jsxs)(H.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,w.jsxs)(H.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,w.jsx)(q.A,{sx:{fontWeight:800,color:ye,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:ao?(0,w.jsx)(B.A,{sx:{width:40},animation:"wave"}):null!==(r=e.value)&&void 0!==r?r:0}),null!=e.percentage&&(0,w.jsxs)(q.A,{variant:"caption",sx:{color:ke,fontWeight:700},children:[e.percentage,"%"]})]}),(0,w.jsx)(O.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Ie(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(Ye(e.color)),flexShrink:0},children:(0,w.jsx)(o,{size:20})})]})]})},e.key)}))}),(0,w.jsxs)(R.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:je/8,border:"1px solid",borderColor:Se,background:"#fff",boxShadow:fe},children:[(0,w.jsxs)(_.Ay,{container:!0,spacing:1.25,alignItems:"center",children:[(0,w.jsx)(_.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,w.jsx)(U.A,{options:po||[],value:Ir,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",PaperComponent:Oe,onOpen:e=>{De||(e.preventDefault(),(0,C.k)("Please select location first!","warning",3e3),setTimeout((()=>{var e;null===(e=me.current)||void 0===e||e.focus()}),0))},onChange:(e,r,o)=>{"clear"===o?(fr(0),Mr(null),vr(0),Rr(null)):(fr((null===r||void 0===r?void 0:r.tenantid)||0),Mr(r),vr(0),Rr(null))},renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{inputRef:ve,placeholder:"Select Tenant",size:"small",sx:Fe("#0ea5e9"),InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:(0,w.jsx)(H.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,w.jsx)(Pe,{color:"#0ea5e9",size:22,selected:!0,children:(0,w.jsx)(v.Itr,{size:13})})})})}))})}),(0,w.jsx)(_.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,w.jsx)(U.A,{options:mo||[],getOptionLabel:e=>e?"".concat(e.locationname," (").concat(e.suburb,")"):"",value:Yr,PaperComponent:Oe,onOpen:e=>{De||jr?jr||(e.preventDefault(),(0,C.k)("Please select Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=ve.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,C.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=me.current)||void 0===e||e.focus()}),0))},onChange:(e,r,o)=>{"clear"===o?(vr(0),Rr(null)):(vr(r.locationid||0),Rr(r))},renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{placeholder:"Select Location",size:"small",sx:Fe("#10b981"),InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:(0,w.jsx)(H.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,w.jsx)(Pe,{color:"#10b981",size:22,selected:!0,children:(0,w.jsx)(v.JFD,{size:13})})})})}))})}),(0,w.jsx)(_.Ay,{item:!0,xs:12,sm:12,md:4,children:(0,w.jsxs)(H.A,{direction:"row",spacing:1,alignItems:"center",justifyContent:{xs:"flex-start",md:"flex-end"},flexWrap:"wrap",children:[(0,w.jsx)(X.A,{title:"Date Filter",placement:"top",children:(0,w.jsxs)(K.A,{onClick:()=>Ge(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:ze("#f59e0b"),border:"1.5px solid ".concat(Ye("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(Me("#f59e0b"))}},children:[(0,w.jsx)(v.Ki0,{size:14}),d()(_e).format("DD/MM/YY")," \u2013 ",d()(Ue).format("DD/MM/YY")]})}),(0,w.jsxs)(K.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ze(Re),border:"1px solid ".concat(Ye(Re)),color:Re,fontSize:11,fontWeight:800},children:[(0,w.jsx)(v.GdF,{size:12})," ",Xe]})]})})]}),(0,w.jsx)(y.A,{open:Ve,onClose:()=>Ge(!1),onSelect:e=>{Be(e.startDate),Ze(e.endDate),Qe(e.label),console.log("Selected Date Range:",e)}})]}),(0,w.jsx)(R.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:je/8,borderTopRightRadius:je/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:Se,borderBottom:0,background:"#fff"},children:(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,w.jsx)(H.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:Se,borderRadius:4}},children:Le.map((e=>{var r;const o=e.icon,n=Je===e.idx,t=null!==(r=null===So||void 0===So?void 0:So[e.countKey])&&void 0!==r?r:0;return(0,w.jsxs)(K.A,{onClick:r=>{return o=e.idx,Ar(0),$e(o),0===o&&rr("created"),1===o&&rr("pending"),2===o&&rr("delivered"),3===o&&rr("cancelled"),void kr("");var o},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?e.color:Ye(e.color)),bgcolor:n?e.color:ze(e.color),color:n?"#fff":e.color,fontWeight:700,boxShadow:n?"0 6px 18px ".concat(Me(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:n?"0 6px 18px ".concat(Me(e.color)):"0 0 0 3px ".concat(Me(e.color))}},children:[(0,w.jsx)(O.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:n?"rgba(255,255,255,0.22)":Ie(e.color),color:n?"#fff":e.color},children:(0,w.jsx)(o,{size:13})}),(0,w.jsx)(q.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,w.jsx)(K.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:n?"rgba(255,255,255,0.22)":"#fff",color:n?"#fff":e.color,border:n?"none":"1px solid ".concat(Ye(e.color))},children:t})]},e.status)}))}),(0,w.jsx)(K.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,w.jsx)(k.A,{value:yr,onChange:kr,onDebouncedChange:Sr,placeholder:"Search orders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:ze(Re),"& fieldset":{borderColor:Ye(Re),borderWidth:1.5},"&:hover fieldset":{borderColor:Re},"&.Mui-focused fieldset":{borderColor:Re,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Me(Re))}}})})]})}),(0,w.jsx)(R.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:je/8,borderBottomRightRadius:je/8,border:"1px solid",borderColor:Se,overflow:"hidden",background:"#fff"},children:(0,w.jsx)(Q.A,{ref:ge,onScroll:e=>{const{scrollTop:r,scrollHeight:o,clientHeight:n}=e.currentTarget;r+n>=o-50&&Fo&&!To&&Po()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:Ye(Re),borderRadius:8,"&:hover":{backgroundColor:Re}},"&::-webkit-scrollbar-track":{backgroundColor:We}},children:r?(0,w.jsxs)(he.nV,{sx:{p:1.25},children:[0===(null===Eo||void 0===Eo?void 0:Eo.length)&&!Yo&&(0,w.jsxs)(H.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,w.jsx)(O.A,{sx:{width:64,height:64,bgcolor:Ie("#94a3b8"),color:we},children:(0,w.jsx)(v.F6S,{size:28})}),(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{fontWeight:700,color:ye},children:["No ",er," orders"]}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke,textAlign:"center",px:2},children:yr?"Try a different keyword.":"Adjust the filters above to load orders."})]}),Yo&&(0,w.jsxs)(H.A,{alignItems:"center",sx:{py:6},children:[(0,w.jsx)(xe.A,{}),(0,w.jsx)(q.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading orders\u2026"})]}),null===Eo||void 0===Eo?void 0:Eo.map(((r,o)=>{const t=!!qr.find((e=>e.orderheaderid===r.orderheaderid)),i=Te[String(r.orderstatus||"").toLowerCase()]||{label:r.orderstatus||"\u2014",color:Re,icon:v.bfP},s=i.icon;return(0,w.jsx)(he.pg,{accent:i.color,selected:t,header:(0,w.jsxs)(H.A,{spacing:1.25,children:[(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:["created"===er&&(0,w.jsx)(V.A,{size:"small",sx:{p:.25,color:Ye(Re),"&.Mui-checked":{color:Re}},onChange:e=>{var o;if(!De)return(0,C.k)("Please select a location first!","warning",2e3),void(null===(o=me.current)||void 0===o||o.focus());e.target.checked?Kr((e=>[...e,(0,n.A)((0,n.A)({},r),{},{sno:e.length+1})])):Kr((e=>e.filter((e=>e.orderheaderid!==r.orderheaderid)).map(((e,r)=>(0,n.A)((0,n.A)({},e),{},{sno:r+1})))))},checked:t}),(0,w.jsx)(q.A,{variant:"caption",sx:{fontWeight:700,color:we},children:String(100*ur+o+1).padStart(2,"0")}),(0,w.jsxs)(K.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:ze(i.color),border:"1px solid ".concat(Ye(i.color)),color:i.color,fontSize:10.5,fontWeight:800,whiteSpace:"nowrap"},children:[(0,w.jsx)(s,{size:11})," ",i.label]})]}),"created"===r.orderstatus&&(0,w.jsxs)(H.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:["C"===r.deliverytype&&(0,w.jsx)(G.A,{size:"small",onClick:()=>{(null===gr||void 0===gr?void 0:gr.orderid)===r.orderid?mr(null):mr(r)},sx:{borderRadius:999,bgcolor:ze("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(Ye("#06b6d4")),"&:hover":{bgcolor:Ie("#06b6d4")}},children:(null===gr||void 0===gr?void 0:gr.orderid)===r.orderid?(0,w.jsx)(f.A,{fontSize:"small"}):(0,w.jsx)(b.A,{fontSize:"small"})}),(0,w.jsx)(G.A,{size:"small",disabled:t,onClick:()=>{nr(!0),pr(r.orderheaderid)},sx:{borderRadius:999,bgcolor:ze("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Ye("#ef4444")),"&:hover":{bgcolor:Ie("#ef4444")},"&.Mui-disabled":{color:e.palette.secondary.main}},children:(0,w.jsx)(A.A,{})})]})]}),(0,w.jsxs)(K.A,{sx:{minWidth:0},children:[(0,w.jsx)(q.A,{sx:{fontWeight:800,color:ye,fontSize:15},noWrap:!0,children:r.tenantname}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},noWrap:!0,children:[r.tenantsuburb,r.applocation].filter(Boolean).join(" \xb7 ")||"\u2014"})]})]}),children:(0,w.jsxs)(he.FG,{children:[(0,w.jsxs)(he.pY,{label:"Order / Location",full:!0,children:[(0,w.jsx)(q.A,{sx:{fontSize:13,fontWeight:600,color:ye},noWrap:!0,children:"".concat(r.locationname,"-(").concat(r.locationsuburb,")")}),(0,w.jsxs)(q.A,{variant:"caption",sx:{color:ke},children:[r.orderid," \xb7 ",d()(r.pickupslot).utc().format("DD/MM/YYYY")," ",d()(r.pickupslot).format("hh:mm A")]})]}),(0,w.jsxs)(he.pY,{label:"Pickup",children:[(0,w.jsx)(q.A,{sx:{fontSize:13,fontWeight:600,color:ye},noWrap:!0,children:r.pickupcustomer||"\u2014"}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},noWrap:!0,children:r.pickupcontactno}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},noWrap:!0,children:r.pickupsuburb||r.pickupaddress})]}),(0,w.jsxs)(he.pY,{label:"Drop",children:[(0,w.jsx)(q.A,{sx:{fontSize:13,fontWeight:600,color:ye},noWrap:!0,children:r.deliverycustomer||"\u2014"}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},noWrap:!0,children:r.deliverycontactno}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},noWrap:!0,children:r.deliverysuburb||r.deliveryaddress})]}),(0,w.jsx)(he.pY,{label:"Qty",value:r.quantity||"\u2014"}),(0,w.jsx)(he.pY,{label:"KMS",children:(0,w.jsxs)(K.A,{sx:(l="#06b6d4",{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1,py:.25,borderRadius:999,bgcolor:ze(l),color:l,fontWeight:700,fontSize:11,border:"1px solid ".concat(Ye(l)),whiteSpace:"nowrap"}),children:[r.kms||0," km"]})}),(0,w.jsx)(he.pY,{label:"COD",children:(0,w.jsx)(q.A,{sx:{fontSize:13,fontWeight:800,color:r.collectionamt?"#ef4444":we},children:r.collectionamt?"\u20b9 ".concat(r.collectionamt.toFixed(2)):"\u2014"})}),(0,w.jsx)(he.pY,{label:"Charges",children:(0,w.jsx)(q.A,{sx:{fontSize:13,fontWeight:800,color:r.deliverycharge?"#ef4444":we},children:r.deliverycharge?"\u20b9 ".concat(r.deliverycharge.toFixed(2)):"\u2014"})}),r.ordernotes&&(0,w.jsx)(he.pY,{label:"Notes",full:!0,children:(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},children:r.ordernotes})})]})},r.sno);var l})),0!=(null===Eo||void 0===Eo?void 0:Eo.length)&&(0,w.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:To||Fo?(0,w.jsx)(xe.A,{}):(0,w.jsx)(q.A,{variant:"caption",sx:{color:we,fontWeight:600},children:"No more orders"})})]}):(0,w.jsxs)(J.A,{stickyHeader:!0,sx:{minWidth:{xs:960,md:1180}},children:[(0,w.jsx)($.A,{children:(0,w.jsxs)(ee.A,{sx:{"& th":{backgroundColor:We,color:ke,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Se),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:["created"==er&&(0,w.jsx)(re.A,{sx:{position:"sticky !important"},children:(0,w.jsx)(V.A,{size:"small",sx:{p:.5,color:Ye(Re),"&.Mui-checked, &.MuiCheckbox-indeterminate":{color:Re}},indeterminate:qr.length>0&&qr.length!==(null===Eo||void 0===Eo?void 0:Eo.length),checked:qr.length===(null===Eo||void 0===Eo?void 0:Eo.length),onChange:e=>{var r;if(!De)return(0,C.k)("Please select a location first!","warning",2e3),void(null===(r=me.current)||void 0===r||r.focus());if(e.target.checked){const e=null===Eo||void 0===Eo?void 0:Eo.map(((e,r)=>(0,n.A)((0,n.A)({},e),{},{sno:r+1})));Kr(e)}else Kr([])}})}),(0,w.jsx)(re.A,{children:"#"}),(0,w.jsx)(re.A,{children:"Tenant"}),(0,w.jsx)(re.A,{children:"Location"}),(0,w.jsx)(re.A,{children:"Pickup"}),(0,w.jsx)(re.A,{children:"Drop"}),(0,w.jsx)(re.A,{align:"center",children:"QTY"}),(0,w.jsx)(re.A,{align:"right",children:"COD"}),(0,w.jsx)(re.A,{align:"center",children:"KMS"}),(0,w.jsx)(re.A,{align:"right",children:"Charges"}),(0,w.jsx)(re.A,{children:"Notes"}),(0,w.jsx)(re.A,{children:"Status"}),"created"==er&&(0,w.jsx)(re.A,{align:"right",children:"Actions"})]})}),(0,w.jsxs)(oe.A,{children:[0===(null===Eo||void 0===Eo?void 0:Eo.length)&&!Yo&&(0,w.jsx)(ee.A,{children:(0,w.jsx)(re.A,{colSpan:13,sx:{py:6},children:(0,w.jsxs)(H.A,{alignItems:"center",spacing:1.5,children:[(0,w.jsx)(O.A,{sx:{width:64,height:64,bgcolor:Ie("#94a3b8"),color:we},children:(0,w.jsx)(v.F6S,{size:28})}),(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{fontWeight:700,color:ye},children:["No ",er," orders"]}),(0,w.jsx)(q.A,{variant:"caption",sx:{color:ke},children:yr?"Try a different keyword.":"Adjust the filters above to load orders."})]})})}),Yo&&(0,w.jsx)(W.r,{col:8}),null===Eo||void 0===Eo?void 0:Eo.map(((r,o)=>{const t=!!qr.find((e=>e.orderheaderid===r.orderheaderid));return(0,w.jsxs)(ee.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s",backgroundColor:t?ze(Re):"transparent","& td":{borderBottom:"1px solid ".concat(Ce),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:t?Ie(Re)+" !important":We}},children:["created"===er&&(0,w.jsx)(re.A,{children:(0,w.jsx)(V.A,{size:"small",sx:{p:.5,color:Ye(Re),"&.Mui-checked":{color:Re}},onChange:e=>{var o;if(!De)return(0,C.k)("Please select a location first!","warning",2e3),void(null===(o=me.current)||void 0===o||o.focus());e.target.checked?Kr((e=>[...e,(0,n.A)((0,n.A)({},r),{},{sno:e.length+1})])):Kr((e=>e.filter((e=>e.orderheaderid!==r.orderheaderid)).map(((e,r)=>(0,n.A)((0,n.A)({},e),{},{sno:r+1})))))},checked:t})}),(0,w.jsx)(re.A,{children:(0,w.jsx)(q.A,{children:100*ur+o+1})}),(0,w.jsx)(re.A,{children:(0,w.jsxs)(X.A,{title:r.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"subtitle1",noWrap:!0,children:r.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,variant:"body2",children:[r.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:r.applocation})]})}),(0,w.jsxs)(re.A,{align:"left",children:[(0,w.jsx)(q.A,{variant:"subtitle1",noWrap:!0,children:"".concat(r.locationname,"-(").concat(r.locationsuburb,")")}),(0,w.jsx)(X.A,{title:"TenantId - OrderId",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:r.orderid})}),(0,w.jsx)(X.A,{title:"Pickup Slot",children:(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:[d()(r.pickupslot).utc().format("DD/MM/YYYY")," ",d()(r.pickupslot).format("hh:mm A")]})})]}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:r.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:r.pickupcontactno}),(0,w.jsx)(X.A,{title:r.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:"".concat(r.pickupsuburb||r.pickupaddress.slice(0,12)+".....")})})]})}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"subtitle1",sx:{maxWidth:120,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:r.deliverycontactno}),(0,w.jsx)(X.A,{title:r.deliveryaddress,sx:{whiteSpace:"nowrap"},children:(0,w.jsx)(q.A,{variant:"caption",children:"".concat(r.deliverysuburb||r.deliveryaddress.slice(0,12)+".....")})})]})}),(0,w.jsx)(re.A,{align:"center",children:r.quantity?(0,w.jsx)(q.A,{variant:"subtitle1",color:"error",sx:{whiteSpace:"nowrap"},children:r.quantity}):(0,w.jsx)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:r.quantity})}),(0,w.jsx)(re.A,{align:"right",children:r.collectionamt?(0,w.jsxs)(q.A,{variant:"subtitle1",color:r.collectionamt?"error":null,sx:{whiteSpace:"nowrap"},children:["\u20b9",r.collectionamt.toFixed(2)]}):(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:["\u20b9",r.collectionamt.toFixed(2)]})}),(0,w.jsx)(re.A,{align:"center",children:(0,w.jsx)(q.A,{variant:"subtitle1",color:r.kms?"error":null,children:r.kms})}),(0,w.jsx)(re.A,{align:"right",children:r.deliverycharge?(0,w.jsxs)(q.A,{variant:"subtitle1",color:r.deliverycharge?"error":null,sx:{whiteSpace:"nowrap"},children:["\u20b9",r.deliverycharge.toFixed(2)]}):(0,w.jsxs)(q.A,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:["\u20b9",r.deliverycharge.toFixed(2)]})}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsx)(q.A,{variant:"body1",fontSize:"12px",sx:{maxWidth:120,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.ordernotes})}),(0,w.jsx)(re.A,{align:"left",children:(()=>{const e=Te[String(r.orderstatus||"").toLowerCase()]||{label:r.orderstatus||"\u2014",color:Re,icon:v.bfP},o=e.icon;return(0,w.jsxs)(K.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:ze(e.color),border:"1px solid ".concat(Ye(e.color)),color:e.color,fontSize:11,fontWeight:800,whiteSpace:"nowrap"},children:[(0,w.jsx)(o,{size:12})," ",e.label]})})()}),"created"===r.orderstatus&&(0,w.jsx)(re.A,{align:"center",children:(0,w.jsxs)(H.A,{flexDirection:"row",justifyContent:"end",children:["C"===r.deliverytype&&(0,w.jsx)(X.A,{title:"Product details",children:(0,w.jsx)(G.A,{color:"primary",onClick:()=>{(null===gr||void 0===gr?void 0:gr.orderid)===r.orderid?mr(null):mr(r)},children:(null===gr||void 0===gr?void 0:gr.orderid)===r.orderid?(0,w.jsx)(f.A,{}):(0,w.jsx)(b.A,{})})}),(0,w.jsx)(X.A,{title:"To Cancel",children:(0,w.jsx)(G.A,{"aria-describedby":"aria-".concat(r.sno),disabled:t,onClick:()=>{nr(!0),pr(r.orderheaderid)},children:(0,w.jsx)(A.A,{style:{color:t?e.palette.secondary.main:e.palette.error.main}})})})]})})]},r.sno)})),0!=(null===Eo||void 0===Eo?void 0:Eo.length)&&(0,w.jsx)(ee.A,{children:(0,w.jsx)(re.A,{colSpan:15,rowSpan:3,sx:{borderBottom:"none"},children:(0,w.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:To||Fo?(0,w.jsx)(xe.A,{}):(0,w.jsx)(q.A,{variant:"caption",sx:{color:we,fontWeight:600},children:"No more orders"})})})})]})]})})}),(0,w.jsxs)(ne.A,{fullScreen:!0,open:tr,TransitionComponent:g.s,children:[(0,w.jsx)(F.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:Cr,children:(0,w.jsx)(m.A,{color:"inherit",text:"Optimising ... .."})}),(0,w.jsx)(te.A,{sx:{bgcolor:e.palette.primary.lighter},children:(0,w.jsx)(L.A,{badgeContent:null===qr||void 0===qr?void 0:qr.length,color:"primary",children:(0,w.jsx)(ie.A,{label:(0,w.jsx)(q.A,{variant:"h3",children:"Preview Orders "}),variant:"contained"})})}),(0,w.jsx)(se.A,{dividers:!0,children:(0,w.jsx)(S.A,{content:!1,children:(0,w.jsx)(Q.A,{children:(0,w.jsxs)(J.A,{stickyHeader:!0,children:[(0,w.jsx)($.A,{children:(0,w.jsxs)(ee.A,{children:[(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"#"}),(0,w.jsxs)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:["Tenant"," "]}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"order Location"}),(0,w.jsxs)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:["Pickup"," "]}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Delivery"}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Notes"}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"Charges"}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.lighter},children:"KMS"})]})}),(0,w.jsx)(oe.A,{children:qr.map(((e,r)=>(0,w.jsx)(t.Fragment,{children:(0,w.jsxs)(ee.A,{sx:{},children:[(0,w.jsx)(re.A,{children:(0,w.jsxs)(q.A,{children:[" ",e.sno]})}),(0,w.jsx)(re.A,{children:(0,w.jsxs)(X.A,{title:e.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,w.jsxs)(re.A,{align:"left",children:[(0,w.jsx)(X.A,{title:e.locationaddress,placement:"top",children:(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,w.jsx)(X.A,{title:"Order Id",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,w.jsxs)(H.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,w.jsxs)(X.A,{title:"Ordered date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,w.jsxs)(X.A,{title:"Delivery date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsx)(H.A,{direction:"row",spacing:1,children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcontactno}),(0,w.jsx)(X.A,{title:e.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsx)(H.A,{direction:"row",spacing:1,children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycontactno}),(0,w.jsx)(X.A,{title:e.deliveryaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,w.jsx)(re.A,{align:"left",children:e.ordernotes}),(0,w.jsxs)(re.A,{align:"left",children:["\u20b9 ",e.deliverycharge.toFixed(2)]}),(0,w.jsx)(re.A,{align:"left",children:e.kms})]})},r)))})]})})})}),(0,w.jsx)(le.A,{sx:{bgcolor:e.palette.secondary.light},children:(0,w.jsx)(_.Ay,{container:!0,sx:{},children:(0,w.jsx)(_.Ay,{item:!0,xs:12,children:(0,w.jsxs)(H.A,{sx:{mt:2,mr:2},direction:"row",justifyContent:"flex-end",flexWrap:"wrap",gap:2,spacing:5,children:[(0,w.jsx)(ae.A,{sx:{width:"130px"},color:"secondary",variant:"contained",onClick:()=>{Zo()},startIcon:(0,w.jsx)(A.A,{}),children:"Close"}),1==ro.current&&(0,w.jsx)(U.A,{options:[{label:"Bike",value:1},{label:"Auto",value:2}],getOptionLabel:e=>e.label,value:no,onChange:(e,r)=>{to(r),console.log("Selected value:",null===r||void 0===r?void 0:r.value)},renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({sx:{width:200,border:"1px solid ",borderColor:"primary.main"}},e),{},{placeholder:"Select Transport"})),isOptionEqualToValue:(e,r)=>e.value===r.value}),1==ro.current&&(0,w.jsx)(U.A,{multiple:!0,fullWidth:!1,options:ko||[],loading:wo,disableCloseOnSelect:!0,limitTags:2,value:io,onChange:(e,r)=>so(r),getOptionLabel:e=>"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"Rider #".concat(e.userid),isOptionEqualToValue:(e,r)=>e.userid===r.userid,PaperComponent:e=>(0,w.jsx)(R.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:"0 14px 40px rgba(15, 23, 42, 0.18)",border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ListboxProps:{sx:{py:0,maxHeight:340}},noOptionsText:(0,w.jsxs)(H.A,{alignItems:"center",py:2,spacing:1,children:[(0,w.jsx)(v.vbW,{size:26,color:"#94a3b8"}),(0,w.jsx)(q.A,{variant:"caption",color:"text.secondary",children:"No riders to show for this location"})]}),renderTags:(e,r)=>e.map(((e,o)=>{const i="".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"Rider #".concat(e.userid),s=(i.match(/\b\w/g)||[]).slice(0,2).join("").toUpperCase()||"?",l=r({index:o});return(0,t.createElement)(ie.A,(0,n.A)((0,n.A)({},l),{},{key:e.userid,size:"small",avatar:(0,w.jsx)(O.A,{sx:{bgcolor:"#fed7aa",color:"#9a3412",fontSize:10,fontWeight:800},children:s}),label:i,sx:{height:26,bgcolor:"#fff7ed",color:"#9a3412",border:"1px solid",borderColor:"#fdba74",fontWeight:600,fontSize:12,"& .MuiChip-label":{px:.75},"& .MuiChip-deleteIcon":{color:"#c2410c",fontSize:16,"&:hover":{color:"#7c2d12"}}}}))})),renderOption:(e,r,o)=>{let{selected:i}=o;const s="".concat(r.firstname||""," ").concat(r.lastname||"").trim(),l=(s.match(/\b\w/g)||[]).slice(0,2).join("").toUpperCase()||"?";return(0,t.createElement)("li",(0,n.A)((0,n.A)({},e),{},{key:r.userid,style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",borderBottom:"1px solid #f1f5f9",backgroundColor:i?"#fff7ed":"transparent"}}),(0,w.jsx)(V.A,{size:"small",checked:i,sx:{p:.5,color:"#fb923c","&.Mui-checked":{color:"#ea580c"}}}),(0,w.jsx)(O.A,{sx:{width:34,height:34,bgcolor:i?"#fb923c":"#f1f5f9",color:i?"#fff":"#475569",fontSize:12,fontWeight:800,transition:"background-color 0.15s, color 0.15s"},children:l}),(0,w.jsxs)(H.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,w.jsx)(q.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:s||"Rider #".concat(r.userid)}),(0,w.jsxs)(q.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:["ID #",r.userid,r.contactno?" \xb7 ".concat(r.contactno):""]})]}),i&&(0,w.jsx)(ie.A,{size:"small",label:"Absent",sx:{height:18,fontSize:9,fontWeight:800,letterSpacing:.3,bgcolor:"#ea580c",color:"#fff","& .MuiChip-label":{px:.75}}}))},renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{label:"Absent Riders",placeholder:io.length?"":"Pick riders unavailable today",InputLabelProps:{shrink:!0},InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25},children:[(0,w.jsx)(v.ihY,{size:18,color:"#ea580c"}),io.length>0&&(0,w.jsx)(ie.A,{size:"small",label:io.length,sx:{height:18,minWidth:22,fontSize:10,fontWeight:800,bgcolor:"#ea580c",color:"#fff","& .MuiChip-label":{px:.5}}}),e.InputProps.startAdornment]})}),sx:{minWidth:300,maxWidth:440,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fffbf5",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#fdba74",borderWidth:1.5},"&:hover fieldset":{borderColor:"#fb923c"},"&.Mui-focused":{boxShadow:"0 0 0 3px rgba(251, 146, 60, 0.18)"},"&.Mui-focused fieldset":{borderColor:"#ea580c",borderWidth:2}},"& .MuiInputLabel-root":{fontWeight:700,fontSize:13,color:"#9a3412","&.Mui-focused":{color:"#9a3412"}}}})),sx:{"& .MuiAutocomplete-tag":{my:.25},"& .MuiAutocomplete-endAdornment":{right:8}}}),(0,w.jsx)(ae.A,{color:"primary",disabled:!no&&1==ro.current,variant:"contained",startIcon:1==ro.current&&(0,w.jsx)("img",{src:z,alt:"Assign",style:{width:32,height:32,objectFit:"contain",borderRadius:50}}),onClick:()=>{Wr(!0),Bo()},children:qe?"Optimising...":0==ro.current?"Optimise Orders":"AI Optimise Orders"})]})})})})]}),(0,w.jsxs)(ne.A,{fullScreen:!0,open:Lr,TransitionComponent:g.s,children:[(0,w.jsx)(te.A,{children:(0,w.jsx)(H.A,{children:(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,w.jsx)(X.A,{title:"Back to orders",placement:"top",children:(0,w.jsx)(G.A,{onClick:()=>Er(!1),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,w.jsx)(M.eQE,{size:22})})}),(0,w.jsx)(q.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]})})}),(0,w.jsx)(ce.A,{}),(0,w.jsx)(se.A,{children:(0,w.jsxs)(S.A,{content:!1,children:[(yo||wo||Dr)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(j.A,{}),(0,w.jsx)(m.A,{})]}),(0,w.jsx)(F.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:yo||wo||Dr,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(Q.A,{children:(0,w.jsxs)(J.A,{stickyHeader:!0,children:[(0,w.jsx)($.A,{children:(0,w.jsxs)(ee.A,{sx:{backgroundColor:"red"},children:[(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"#"}),1==Vr&&(0,w.jsxs)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Zone"," "]}),(0,w.jsxs)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Tenant"," "]}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"order Location"}),(0,w.jsxs)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:["Pickup"," "]}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Delivery"}),(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Notes"}),1==Vr&&(0,w.jsx)(re.A,{sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Rider"}),(0,w.jsx)(re.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Type"}),(0,w.jsx)(re.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"Charges"}),(0,w.jsx)(re.A,{align:"center",sx:{position:"sticky !important",backgroundColor:e.palette.secondary.light},children:"KMS"})]})}),(0,w.jsxs)(oe.A,{children:[0==(null===$r||void 0===$r?void 0:$r.length)&&(0,w.jsx)(ee.A,{children:(0,w.jsx)(re.A,{colSpan:10,children:(0,w.jsx)(a.A,{})})}),null===$r||void 0===$r?void 0:$r.map(((e,r)=>(0,w.jsxs)(ee.A,{sx:{},children:[(0,w.jsx)(re.A,{children:(0,w.jsxs)(q.A,{children:[" ",r+1]})}),(0,w.jsx)(re.A,{children:(0,w.jsxs)(X.A,{title:e.tenantaddress,children:[(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,w.jsxs)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,w.jsx)("br",{})]}),(0,w.jsx)(q.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,w.jsxs)(re.A,{align:"left",children:[(0,w.jsx)(X.A,{title:e.locationaddress,placement:"top",children:(0,w.jsx)(q.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,w.jsx)(X.A,{title:"Order Id",children:(0,w.jsx)(q.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,w.jsxs)(H.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,w.jsxs)(X.A,{title:"Ordered date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,w.jsxs)(X.A,{title:"Delivery date",children:[(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"12px"},children:d()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,w.jsx)(q.A,{noWrap:!0,sx:{fontSize:"11px"},children:d()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsx)(H.A,{direction:"row",spacing:1,children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.pickupcontactno}),(0,w.jsx)(X.A,{title:e.pickupaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,w.jsx)(re.A,{align:"left",children:(0,w.jsx)(H.A,{direction:"row",spacing:1,children:(0,w.jsxs)(H.A,{direction:"column",children:[(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycustomer}),(0,w.jsx)(q.A,{variant:"caption",children:e.deliverycontactno}),(0,w.jsx)(X.A,{title:e.deliveryaddress,children:(0,w.jsx)(q.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,w.jsx)(re.A,{align:"left",children:e.ordernotes}),(0,w.jsx)(re.A,{align:"center",children:(0,w.jsx)(ie.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary",variant:"light"})}),(0,w.jsx)(re.A,{align:"center",children:(0,w.jsxs)(H.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,w.jsx)(X.A,{title:"Charges",placement:"top",children:(0,w.jsx)(ie.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error",variant:"light"})}),(0,w.jsx)(X.A,{title:"Amount",placement:"left",children:(0,w.jsx)(ie.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success",variant:"light"})})]})}),(0,w.jsx)(re.A,{align:"center",children:(0,w.jsxs)(H.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,w.jsx)(X.A,{title:"KMS",placement:"top",children:(0,w.jsx)(ie.A,{size:"small",label:"".concat(e.kms," km"),color:"error",variant:"light"})}),(0,w.jsx)(X.A,{title:"Cumulative Kms",placement:"right",children:(0,w.jsx)(ie.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success",variant:"light"})})]})})]},r)))]})]})}),(0,w.jsx)(ce.A,{})]})}),(0,w.jsx)(ce.A,{}),(0,w.jsxs)(le.A,{sx:{flexDirection:"column",alignItems:"stretch",p:2,gap:2},children:[(0,w.jsxs)(_.Ay,{container:!0,spacing:2,children:[(0,w.jsx)(_.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsx)(U.A,{options:vo,fullWidth:!0,renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Payment"})),onChange:(e,r,o)=>{if("clear"!==o){if(r){xr(r);const e=null===$r||void 0===$r?void 0:$r.map((e=>(0,n.A)((0,n.A)({},e),{},{paymenttype:r.apptypeid||42})));eo(e)}}else xr(null)}})}),(0,w.jsx)(_.Ay,{item:!0,xs:12,sm:6,children:(0,w.jsx)(U.A,{options:ko,fullWidth:!0,renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Rider"})),onChange:(e,r,o)=>{if("clear"!==o){if(r){cr(r);const e=null===$r||void 0===$r?void 0:$r.map((e=>(0,n.A)((0,n.A)({},e),{},{userid:r.userid,fuelcharge:r.fuelcharge||0,userfcmtoken:r.userfcmtoken})));eo(e)}}else cr(null)}})})]}),(0,w.jsxs)(H.A,{direction:"row",spacing:2,justifyContent:"flex-end",sx:{pt:1,my:2},children:[(0,w.jsx)(ae.A,{variant:"outlined",color:"secondary",startIcon:(0,w.jsx)(I.A,{}),onClick:()=>Er(!1),children:"Back"}),(0,w.jsx)(ae.A,{variant:"contained",disabled:!ar||!dr,onClick:()=>{null!==$r&&void 0!==$r&&$r.length?Ho.mutate({deliveries:$r}):(0,C.k)("No deliveries selected","error",3e3)},children:"Assign Orders"})]})]})]}),(0,w.jsxs)(ne.A,{open:Fr,fullScreen:!0,TransitionComponent:g.s,PaperProps:{sx:{display:"flex",flexDirection:"column",overflow:"hidden"}},children:[(0,w.jsx)(F.A,{sx:{position:"absolute",color:"#fff",zIndex:e=>e.zIndex.modal+1},open:Dr,children:(0,w.jsx)(m.A,{color:"inherit"})}),(0,w.jsx)(te.A,{sx:{py:1.25},children:(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{},children:[(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,w.jsx)(X.A,{title:"Back to orders",placement:"top",children:(0,w.jsx)(G.A,{onClick:()=>o("/nearle/orders"),sx:{bgcolor:"action.hover","&:hover":{bgcolor:"action.selected"}},children:(0,w.jsx)(M.eQE,{size:20})})}),(0,w.jsx)(q.A,{variant:"h3",fontWeight:600,children:"Assign Orders"})]}),(0,w.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,w.jsx)(U.A,{options:[{tuneid:1,type:"Balanced",value:"balanced"},{tuneid:2,type:"Aggressive Speed",value:"aggressive_speed"},{tuneid:3,type:"Fuel Saver",value:"fuel_saver"},{tuneid:4,type:"Zone Strict",value:"zone_strict"}]||[],getOptionLabel:e=>e.type,sx:{minWidth:250,maxWidth:600,flex:1},renderInput:e=>(0,w.jsx)(Z.A,(0,n.A)((0,n.A)({},e),{},{label:"Hyper Tuning"})),onChange:(e,r,o)=>{"clear"===o?Bo(null):(console.log("val",r),Bo(r.value))}}),(0,w.jsx)(ae.A,{variant:"contained",color:"primary",startIcon:(0,w.jsx)(Y.UF6,{}),onClick:()=>{zr(!0),Bo("reshuffle")},children:"Re-Assign"}),(0,w.jsx)(ue.Ay,{data:Gr,filename:"Orders_Detail_".concat(d()().format("YYYY-MM-DD_HHmmss"),".csv"),label:" CSV",style:{m:1}})]})]})}),(0,w.jsx)(se.A,{sx:{p:0,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},children:Nr&&(0,w.jsx)(Ae.default,{data:Nr,embedded:!0})}),(0,w.jsx)(le.A,{sx:{px:2,py:1.25},children:(0,w.jsxs)(H.A,{direction:"row",gap:2,alignItems:"center",justifyContent:"end",children:[(0,w.jsx)(ae.A,{variant:"contained",color:"secondary",startIcon:(0,w.jsx)(I.A,{}),onClick:()=>{Tr(!1)},children:"Back"}),(0,w.jsx)(ae.A,{variant:"contained",onClick:async()=>{zr(!0),Uo.mutate({deliveries:$r})},children:"Assign Orders"})]})})]}),(0,w.jsx)(ne.A,{open:or,onClose:()=>handleClose(),maxWidth:"xs",children:(0,w.jsx)(se.A,{sx:{mt:2,my:1},children:(0,w.jsxs)(H.A,{alignItems:"center",spacing:3.5,children:[(0,w.jsx)(O.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,w.jsx)(l.A,{})}),(0,w.jsx)(H.A,{spacing:2,children:(0,w.jsx)(q.A,{variant:"h4",align:"center",children:"Are you sure you want to cancel this order?"})}),(0,w.jsxs)(H.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,w.jsx)(ae.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{qo.mutate(hr)},autoFocus:!0,children:"Yes, Cancel"}),(0,w.jsx)(ae.A,{fullWidth:!0,onClick:()=>{nr(!1)},color:"secondary",variant:"outlined",children:"No"})]})]})})}),(0,w.jsx)(ne.A,{open:sr,onClose:()=>lr(!1),maxWidth:"xs",children:(0,w.jsx)(se.A,{sx:{mt:2,my:1},children:(0,w.jsxs)(H.A,{alignItems:"center",spacing:3.5,children:[(0,w.jsx)(O.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,w.jsx)(l.A,{})}),(0,w.jsx)(H.A,{spacing:2,children:(0,w.jsx)(q.A,{variant:"h4",align:"center",children:"Are you sure, you want to cancel multiple orders?"})}),(0,w.jsxs)(H.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,w.jsx)(ae.A,{fullWidth:!0,onClick:()=>{lr(!1)},color:"secondary",variant:"outlined",children:"No"}),(0,w.jsx)(ae.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{Ko.mutate(qr)},autoFocus:!0,children:"Yes, Cancel"})]})]})})})]})}},23787:(e,r,o)=>{o.d(r,{FG:()=>p,nV:()=>x,pY:()=>u,pg:()=>h});var n=o(89379),t=o(80045),i=o(93230),s=o(2235),l=o(16491),a=o(82053),c=o(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:r,scroll:o=!1,onScroll:s,sx:l}=e,a=(0,t.A)(e,d);return(0,c.jsx)(i.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:s,sx:(0,n.A)((0,n.A)({p:1.5},o&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:r}))},h=e=>{let{accent:r="#662582",header:o,footer:t,selected:i=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(s.A,{elevation:0,onClick:a,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?r:"#e2e8f0",background:i?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[o,d,t]})]})},p=e=>{let{children:r,columns:o=2,sx:t}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(o,", minmax(0, 1fr))"),gap:1,mt:1.25},t),children:r})},u=e=>{let{label:r,value:o,children:n,full:t=!1,align:i="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:t?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==o&&void 0!==o?o:"\u2014"})})]})}},35678:(e,r,o)=>{o.d(r,{A:()=>v});var n=o(9950),t=o(96583),i=o(40033),s=o(82053),l=o(28170),a=o(93230),c=o(82223),d=o(55916),x=o(4159),h=o.n(x),p=o(56712),u=o(81417),A=o(96600),g=o(53132),m=o(94289),j=o(57326),f=o(50624),b=o(44414);const v=e=>{let{open:r,onClose:o,onSelect:x}=e;const[v,y]=(0,n.useState)(null);return(0,b.jsxs)(t.A,{open:r,onClose:o,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:r,toggle:o,id:"daterange1",onChange:e=>{y({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,p.A)(new Date,-1),endDate:(0,p.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,p.A)(new Date,1),endDate:(0,p.A)(new Date,1)},{label:"This Week",startDate:(0,u.A)(new Date),endDate:(0,A.A)(new Date)},{label:"Last Week",startDate:(0,u.A)((0,g.A)(new Date,-1)),endDate:(0,A.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,m.A)(new Date),endDate:(0,j.A)(new Date)},{label:"Last Month",startDate:(0,m.A)((0,f.A)(new Date,-1)),endDate:(0,j.A)((0,f.A)(new Date,-1))}]})}),(0,b.jsx)(a.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),o()):o()},children:"OK"})})]})}},47659:(e,r,o)=>{o.d(r,{A:()=>d});var n=o(89379),t=o(48089),i=o(50704),s=o(16491),l=o(82053),a=o(60899),c=o(44414);const d=e=>{let{primary:r,secondary:o,percentage:d,color:x,sx:h}=e;return(0,c.jsx)(t.A,{elevation:0,sx:(0,n.A)({background:x,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},h),children:(0,c.jsxs)(i.A,{children:[(0,c.jsx)(s.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,c.jsx)(l.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,c.jsxs)(a.Ay,{container:!0,spacing:0,children:[(0,c.jsx)(a.Ay,{item:!0,xs:12,children:(0,c.jsx)(l.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:o})}),(0,c.jsx)(a.Ay,{item:!0,xs:12,children:(0,c.jsx)(l.A,{variant:"subtitle2",color:"inherit",children:r})})]})]})})}},56311:(e,r,o)=>{o.d(r,{A:()=>p});var n=o(89379),t=o(9950),i=o(2660),s=o(2046),l=o(83274),a=o(25333),c=o(97125),d=o(7762),x=o(52097),h=o(44414);const p=e=>{let{value:r,onChange:o,onDebouncedChange:p,debounceTime:u=500,placeholder:A="Search (ctrl+k)",sx:g}=e;const m=(0,t.useRef)(null),[j]=(0,x.d7)(r,u);return(0,t.useEffect)((()=>{p&&p(j)}),[j,p]),(0,t.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=m.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,n.A)({},g),inputRef:m,placeholder:A,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,r,o)=>{o.d(r,{A:()=>l});o(9950);var n=o(16491),t=o(46639),i=o(62217),s=o(44414);function l(e){let{size:r=70,imgSize:o=40,alt:l="loader"}=e;return(0,s.jsxs)(n.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,s.jsx)(t.A,{size:r}),(0,s.jsx)(n.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:o,height:o},children:(0,s.jsx)("img",{src:i,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,r,o)=>{o.d(r,{A:()=>h});var n=o(89379),t=o(9950),i=o(93230),s=o(41413),l=o(77922),a=o(29925),c=o(26910),d=o(31222),x=o(44414);const h=(0,t.forwardRef)(((e,r)=>{let{setAppId:o,setLocoName:h,setPage:p,sx:u,textfeildSx:A,textfieldSx:g,pill:m=!1,accentColor:j="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:v}=e;const[y,k]=(0,t.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,t.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),k(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const w=e=>"".concat(j).concat(e),S=w("08"),C=w("26"),W=w("55"),D=w("18"),z=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:S,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},I=m&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:D,color:j,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,n.A)({},u),onChange:(e,r,n)=>{"clear"===n?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):r&&(null===o||void 0===o||o(r.applocationid),null===h||void 0===h||h(r.locationname),null===p||void 0===p||p(0))},renderInput:e=>m?(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:r,placeholder:b,InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:I}),sx:(0,n.A)((0,n.A)({},z),g||A||{})})):(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,n.A)({},g||A||{})}))})}))},96646:(e,r,o)=>{o.d(r,{r:()=>a});var n=o(9213),t=o(21671),i=o(82917),s=o(93230),l=o(44414);const a=e=>{let{rowsPerPage:r=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(t.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(t.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,r)=>(0,l.jsx)(t.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(t.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(t.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(t.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}}}]); \ No newline at end of file diff --git a/build/static/js/54.5a2100fd.chunk.js b/build/static/js/54.5a2100fd.chunk.js new file mode 100644 index 0000000..be239cd --- /dev/null +++ b/build/static/js/54.5a2100fd.chunk.js @@ -0,0 +1 @@ +(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[54],{855:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(7208),r=n(76475),s=n(44414);function o(e){var t,n;let o,l,{children:a,type:c="scale",direction:d="right",offset:h=10,scale:x={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":o=h,l=0;break;default:o=0,l=h}const[p,u]=(0,i.Y)(o,l),[m,f]=(0,i.Y)(o,l);switch(c){case"rotate":return(0,s.jsx)(r.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:a});case"slide":return"up"===d||"down"===d?(0,s.jsx)(r.P.div,{animate:{y:void 0!==m?m:""},onHoverEnd:()=>f(),onHoverStart:()=>f(),children:a}):(0,s.jsx)(r.P.div,{animate:{x:void 0!==p?p:""},onHoverEnd:()=>u(),onHoverStart:()=>u(),children:a});default:return"number"===typeof x&&(x={hover:x,tap:x}),(0,s.jsx)(r.P.div,{whileHover:{scale:null===(t=x)||void 0===t?void 0:t.hover},whileTap:{scale:null===(n=x)||void 0===n?void 0:n.tap},children:a})}}},23787:(e,t,n)=>{"use strict";n.d(t,{FG:()=>p,nV:()=>h,pY:()=>u,pg:()=>x});var i=n(89379),r=n(80045),s=n(93230),o=n(2235),l=n(16491),a=n(82053),c=n(44414);const d=["children","scroll","onScroll","sx"],h=e=>{let{children:t,scroll:n=!1,onScroll:o,sx:l}=e,a=(0,r.A)(e,d);return(0,c.jsx)(s.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:o,sx:(0,i.A)((0,i.A)({p:1.5},n&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},x=e=>{let{accent:t="#662582",header:n,footer:r,selected:s=!1,onClick:a,children:d,sx:h}=e;return(0,c.jsxs)(o.A,{elevation:0,onClick:a,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:s?t:"#e2e8f0",background:s?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},h),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[n,d,r]})]})},p=e=>{let{children:t,columns:n=2,sx:r}=e;return(0,c.jsx)(l.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))"),gap:1,mt:1.25},r),children:t})},u=e=>{let{label:t,value:n,children:i,full:r=!1,align:s="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:r?"1 / -1":"auto",minWidth:0,textAlign:s},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==n&&void 0!==n?n:"\u2014"})})]})}},39009:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>fe});var i=n(89379),r=n(9950),s=n(26910),o=n(50847),l=n.n(o),a=n(55271),c=n(4159),d=n.n(c),h=n(28429),x=n(14857),p=n(47223),u=n(8881),m=n(55158),f=n(16491),g=n(93230),A=n(82053),v=n(25277),j=n(60899),b=n(48089),y=n(77922),S=n(29925),w=n(2046),k=n(82223),Y=n(46639),C=n(83274),z=n(25333),W=n(1320),M=n(2235),N=n(15769),P=n(69780),D=n(9213),I=n(21671),R=n(34075),H=n(96583),T=n(40033),L=n(25979),F=n(2660),E=n(74745),O=n(28170),B=n(96557),J=n(16497),V=n(93038),q=n(79739),G=n(30633),K=n(81831),Z=n(95359),U=n(7762),Q=n(87942),X=n(81419),_=n(3911),$=n(47738),ee=n(27379),te=n(90421),ne=n(94118),ie=n(88349),re=n(60767),se=n(13838),oe=n(54826),le=n(43302),ae=n(31222),ce=n(52351),de=n(94826),he=(n(855),n(23787)),xe=(n(42041),n(44414)),pe=n(36220);d().extend(pe);const ue={fontSize:11.5,fontWeight:700,color:"#475569",py:.75,px:1},me={fontSize:12,py:.6,px:1},fe=()=>{const e=(0,h.Zp)(),t=(0,x.A)(),n=(0,p.A)(t.breakpoints.down("md")),o=(0,r.useRef)(null),c=(0,r.useRef)(null),pe=localStorage.getItem("userid"),[fe,ge]=(0,r.useState)([]),[Ae,ve]=(0,r.useState)([]),[je,be]=(0,r.useState)([]),[ye,Se]=(0,r.useState)(!1),[we,ke]=(0,r.useState)(!1),[Ye,Ce]=(0,r.useState)(0),[ze,We]=(0,r.useState)(0),[Me,Ne]=(0,r.useState)(0),[Pe,De]=(0,r.useState)(null),[Ie,Re]=(0,r.useState)(null),[He,Te]=(0,r.useState)(0),[Le,Fe]=(0,r.useState)(0),[Ee,Oe]=(0,r.useState)(0),[Be,Je]=(0,r.useState)(null),[Ve,qe]=(0,r.useState)([]),[Ge,Ke]=(0,r.useState)([]),[Ze,Ue]=(0,r.useState)(!1),[Qe,Xe]=(0,r.useState)(""),[_e,$e]=(0,r.useState)(d()().format("MM-DD-YYYY")),[et,tt]=(0,r.useState)(""),[nt,it]=(0,r.useState)(null),[rt,st]=(0,r.useState)(null),[ot,lt]=(0,r.useState)(""),[at,ct]=(0,r.useState)(),[dt,ht]=(0,r.useState)(0),[xt,pt]=(0,r.useState)(0),[ut,mt]=(0,r.useState)(0),[ft,gt]=(0,r.useState)(0),[At,vt]=(0,r.useState)(null),[jt,bt]=(0,r.useState)([]),[yt,St]=(0,r.useState)(""),wt=(0,r.useRef)({}),kt=(e,t,n)=>{(0,u.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:n||1500})},Yt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;const i="".concat(t,"-").concat(e);wt.current[i]||(kt(e,t,n),wt.current[i]=!0,setTimeout((()=>delete wt.current[i]),3e3))};(0,r.useEffect)((()=>{We(0),De(null),Ne(0),Re(null),be([]),Je(null),qe([]),bt([]),vt(null),St(""),it(null),st(null),tt("")}),[Ye]),(0,r.useEffect)((()=>{Ne(0),Re(null),qe([]),bt([]),vt(null),St("")}),[ze]);(0,r.useEffect)((()=>{(async()=>{Se(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(pe));ge(e.data.details||[])}catch(e){Yt(e.message,"error",5e3)}finally{Se(!1)}})()}),[]);(0,r.useEffect)((()=>{Ye&&(async()=>{Se(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(Ye,"&status=active"));if(e.data.status){const t=(e.data.details||[]).map((e=>(0,i.A)((0,i.A)({},e),{},{label:"".concat(e.tenantname)})));ve(t)}}catch(e){Yt("Failed to load clients","warning",3e3)}finally{Se(!1)}})()}),[Ye]);(0,r.useEffect)((()=>{if(!ze)return;const e=setTimeout((()=>{(""===Qe||Qe.length>2)&&(async()=>{try{const e=""===Qe?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(ze,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(ze,"&keyword=").concat(Qe),t=await s.A.get(e);t.data.status&&Ke(t.data.details||[])}catch(e){console.log(e),kt("server error","warning")}})()}),250);return()=>clearTimeout(e)}),[Qe,ze]),(0,r.useEffect)((()=>{let e=0,t=0,n=0,i=0;Ve.forEach((r=>{e+=Number(r.distance)||0,t+=Number(r.totalcharge)||0,n+=Number(r.quantity)||0,i+=Number(r.collectionamt)||0})),ht(e),pt(t),mt(n),gt(i)}),[Ve]);const Ct=async e=>{var t,n;if("undefined"===typeof window||null===(t=window.google)||void 0===t||null===(n=t.maps)||void 0===n||!n.DistanceMatrixService)throw new Error("Google Maps not loaded");const i=new window.google.maps.DistanceMatrixService;try{var r,s,o,l,a;if(!e||"object"!==typeof e)throw new Error("Invalid customer data.");if(!Be||"object"!==typeof Be)throw new Error("Origin (pickCust) data missing or invalid.");const t=await(c=Be,d=e,new Promise(((e,t)=>{try{if(!c||!d)return t(new Error("Origin or destination data missing."));i.getDistanceMatrix({origins:[new window.google.maps.LatLng(c.latitude,c.longitude)],destinations:[new window.google.maps.LatLng(d.latitude,d.longitude)],travelMode:"DRIVING",unitSystem:window.google.maps.UnitSystem.METRIC},((n,i)=>{"OK"===i?e(n):t(new Error("Google API error: ".concat(i)))}))}catch(n){t(new Error("Unexpected error inside DistanceMatrixService: ".concat(n.message)))}}))),n=null===t||void 0===t||null===(r=t.rows)||void 0===r||null===(s=r[0])||void 0===s||null===(o=s.elements)||void 0===o||null===(l=o[0])||void 0===l||null===(a=l.distance)||void 0===a?void 0:a.value;if(null==n)throw new Error("Malformed Distance Matrix response: missing distance value.");const h=n/1e3,x=Math.round(h);return{roundedDistance:x,totalcharge:x{let t=!1;if(qe((n=>(t=n.some((t=>t.firstname===e.firstname)),t?n.filter((t=>t.firstname!==e.firstname)):n))),!t){Se(!0);try{const{roundedDistance:t,totalcharge:n}=await Ct(e);qe((r=>r.some((t=>t.firstname===e.firstname))?r:[...r,(0,i.A)((0,i.A)({},e),{},{distance:t,totalcharge:n})]))}catch(n){console.error("Failed to calculate distance:",n)}finally{Se(!1)}}};(0,r.useEffect)((()=>{Ye&&(async()=>{try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(Ye));if(e.data.status){const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));ct(t)}}catch(e){console.log(e)}})()}),[Ye]);const Wt=e=>null===e||void 0===e?void 0:e.toString().trim().toLowerCase().replace(/\s+/g,""),Mt={"pickupdate(yyyy-mmm-dd)":"date","sendername*":"locationname","senderphone*":"locationcontact","senderaddress*":"locationaddress","receivername*":"firstname",receiverphone:"contactno","receiveralternatephone*":"altcontactno",receiverfulladdress:"address",receiverlatitude:"latitude",receiverlongitude:"longitude","itemdescription*":"description",Quantity:"quantity"," Collect Cash":"collectionamt",customerDeliveryTime:"customerdeliverytime",kitchenPickupTime:"kitchenpickuptime"},Nt=(e,t)=>{qe((n=>n.map((n=>n.customerid===e?(0,i.A)((0,i.A)({},n),{},{quantity:Number(t)||0}):n))))},Pt=(e,t)=>{qe((n=>n.map((n=>n.customerid===e?(0,i.A)((0,i.A)({},n),{},{collectionamt:Number(t)||0}):n))))},Dt={location:!!Ye,client:!!ze,business:!!Me,schedule:!!rt,drops:Ve.length>0},It=Dt.location&&Dt.client&&Dt.business&&Dt.schedule&&Dt.drops,Rt=Ve.length>0?"drops":jt.length>0?"preview":"empty";return(0,xe.jsxs)(xe.Fragment,{children:[ye&&(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:we,children:(0,xe.jsx)(de.A,{color:"inherit"})}),(0,xe.jsxs)(f.A,{className:"orders-workspace-bg",sx:{height:{xs:"auto",md:"calc(100vh - 64px)"},minHeight:{xs:"calc(100vh - 64px)",md:0},display:"flex",flexDirection:"column",overflow:{xs:"visible",md:"hidden"},p:{xs:.75,sm:1.25},gap:1},children:[(0,xe.jsxs)(g.A,{direction:"row",alignItems:"center",gap:1,flexWrap:"wrap",sx:{flexShrink:0,px:.5},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:{xs:16,sm:17},color:"#1e293b",lineHeight:1.2},children:"Create Multiple Orders"}),(0,xe.jsx)(v.A,{size:"small",label:"".concat(Ve.length," drop").concat(1===Ve.length?"":"s"),sx:{height:20,fontSize:10.5,fontWeight:700,bgcolor:Ve.length?"rgba(24,144,255,0.10)":"#f1f5f9",color:Ve.length?"#1890ff":"#94a3b8",border:"1px solid ".concat(Ve.length?"rgba(24,144,255,0.25)":"#e2e8f0")}}),(0,xe.jsx)(f.A,{sx:{flex:1}}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#94a3b8",display:{xs:"none",md:"block"}},children:"Bulk-create deliveries from CSV/Excel or saved customers."})]}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.25,sx:{flex:1,minHeight:0,overflow:{xs:"visible",md:"hidden"}},children:[(0,xe.jsxs)(j.Ay,{item:!0,xs:12,md:6,sx:{height:{xs:"auto",md:"100%"},minHeight:0,display:"flex",flexDirection:"column",gap:{xs:1.25,md:2.25},overflowY:{xs:"visible",md:"auto"},pr:{xs:0,md:.75}},children:[(0,xe.jsxs)(b.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsx)(f.A,{className:"section-title-bar",sx:{mb:1.5},children:(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Setup"})}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.75,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",ref:o,className:"header-compact-input",options:fe||[],getOptionLabel:e=>"".concat(e.locationname),onChange:(e,t,n)=>{"clear"===n?Ce(0):t&&Ce(t.applocationid)},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(le.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:Ae||[],value:Pe,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",isOptionEqualToValue:(e,t)=>e.tenantid===t.tenantid,onOpen:e=>{Ye||(e.preventDefault(),Yt("Please select Location first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(We(0),De(null)):t&&(We(t.tenantid),De(t),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e))).data.details||{};Te(t.baseprice||0),Fe(t.priceperkm||0),Oe(t.minkm||0)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e))).data.details||[];1===t.length?(be(t),Je(t[0]),Ne(t[0].locationid),Re(t[0]),it(t[0].slots)):be(t)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid))},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:c,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(oe.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:1===je.length?(0,xe.jsx)(S.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:je[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:t.palette.primary.main},startAdornment:(0,xe.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:Ie,options:je||[],getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname," (").concat(e.suburb||"",")"):"",onOpen:e=>{Ye||ze?ze||(e.preventDefault(),Yt("Please select Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),Yt("Please select Location and Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"!==n&&t?(Ne(t.locationid||0),Re(t),Je(t),it(null===t||void 0===t?void 0:t.slots)):(Ne(0),Re(null),Je(null),it(null))},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Business Location",label:"Business Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,xe.jsxs)(b.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsx)(f.A,{className:"section-title-bar section-title-bar--accent",sx:{mb:1.5},children:(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Schedule & Pickup"})}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.75,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:6,children:(0,xe.jsx)(K.$,{dateAdapter:Z.R,children:(0,xe.jsx)(G.l,{label:"Pickup Date",format:"DD-MM-YYYY",value:_e?d()(_e):null,onChange:e=>{if(!e||!d()(e).isValid())return void $e(d()().format("MM-DD-YYYY"));d()().diff(d()("".concat(d()(e).format("YYYY-MM-DD"))),"d")<=0?($e(d()(e).format("MM-DD-YYYY")),tt(""),st(null)):(kt("Choose an upcoming date","warning"),$e(d()().format("MM-DD-YYYY")))},disablePast:!0,slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:(0,xe.jsx)(X.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px",paddingLeft:"10px"}}}}})})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:6,children:(0,xe.jsx)(y.A,{size:"small",fullWidth:!0,options:nt||[],sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},onChange:(e,t,n)=>{if("clear"===n||!t)return tt(null),void st(null);if(!t.time)return void Yt("This slot has no time configured.","warning",3e3);const i=d()(t.time,"HH:mm").format("hh:mm A");tt(i);const r=d()("".concat(_e," ").concat(i),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");st(r)},getOptionLabel:e=>e?"".concat(e.name," (").concat(d()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{label:"Pickup Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(_.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,children:Be?(0,xe.jsxs)(g.A,{direction:"row",spacing:1.25,alignItems:"center",sx:{border:"1px solid #eef2f6",borderLeft:"3px solid #1890ff",borderRadius:"10px",px:1.25,py:.75,bgcolor:"#fbfcff"},children:[(0,xe.jsx)(f.A,{sx:{width:28,height:28,borderRadius:"8px",background:"linear-gradient(135deg,#1890ff,#096dd9)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:12,boxShadow:"0 4px 10px rgba(24,144,255,0.30)"},children:(0,xe.jsx)(le.sIY,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontSize:12.5,fontWeight:700,color:"#1e293b",lineHeight:1.2},noWrap:!0,children:Be.locationname||"\u2014"}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#64748b",lineHeight:1.3},noWrap:!0,children:Be.address||"\u2014"})]})]}):(0,xe.jsx)(A.A,{sx:{color:"#94a3b8",fontSize:12},children:"Pickup auto-fills once a Business Location is selected."})})]})]}),(0,xe.jsxs)(b.A,{className:"orders-card delivery-prefs-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsxs)(f.A,{className:"delivery-prefs-header",sx:{mb:1},children:[(0,xe.jsx)(A.A,{className:"delivery-prefs-title",children:"Order Notes"}),(0,xe.jsx)(A.A,{className:"delivery-prefs-sub",children:"Applied to every order"})]}),(0,xe.jsx)(f.A,{className:"delivery-prefs-row",children:(0,xe.jsxs)(f.A,{className:"delivery-prefs-field",sx:{width:"100%"},children:[(0,xe.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"bulk-dispatch-notes-input",children:[(0,xe.jsx)($.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,xe.jsx)(S.A,{id:"bulk-dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:ot,onChange:e=>lt(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]})})]}),(0,xe.jsxs)(b.A,{className:"orders-card pricing-summary-card",sx:{flexShrink:0,p:"16px 18px !important"},children:[(0,xe.jsxs)(f.A,{className:"pricing-header",sx:{mb:1.5,pb:1},children:[(0,xe.jsx)(A.A,{className:"pricing-title",sx:{fontSize:"13px !important"},children:"Bulk Summary"}),(0,xe.jsx)(A.A,{className:"pricing-subtitle",sx:{fontSize:"10px !important"},children:"Live totals"})]}),(()=>{const e=e=>{let{icon:t,label:n,value:r,accent:s,active:o}=e;return(0,xe.jsxs)(f.A,{sx:(0,i.A)({bgcolor:"#fff",border:"1px solid #eef2f6",borderRadius:"10px",px:1,py:.75,display:"flex",alignItems:"center",gap:.85,minWidth:0,transition:"border-color 0.2s, box-shadow 0.2s"},o&&{borderColor:"".concat(s,"55"),boxShadow:"0 2px 6px -2px ".concat(s,"33")}),children:[(0,xe.jsx)(f.A,{sx:{width:26,height:26,borderRadius:"8px",bgcolor:"".concat(s,"18"),color:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,flexShrink:0},children:(0,xe.jsx)(t,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontSize:9.5,fontWeight:600,color:"#94a3b8",letterSpacing:.4,textTransform:"uppercase",lineHeight:1},children:n}),(0,xe.jsx)(A.A,{sx:{fontSize:13.5,fontWeight:800,color:o?"#1e293b":"#94a3b8",lineHeight:1.2,mt:.25},noWrap:!0,children:r})]})]})};return(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.25,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.$Fg,label:"Distance",value:dt?"".concat(dt," km"):"\u2014",accent:"#1890ff",active:!!dt})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.H5e,label:"Quantity",value:ut||0,accent:"#16a34a",active:!!ut})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.MxO,label:"Cash Collect",value:"\u20b9".concat(Number(ft).toFixed(2)),accent:"#d97706",active:!!ft})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.dv1,label:"Deliveries",value:Ve.length,accent:"#65387a",active:Ve.length>0})})]})})(),Ve.length>0&&(0,xe.jsxs)("div",{className:"total-charge-badge",style:{marginTop:14,padding:"10px 14px"},children:[(0,xe.jsxs)("div",{className:"total-charge-left",children:[(0,xe.jsx)(oe.wTh,{className:"total-charge-icon"}),(0,xe.jsx)("div",{className:"total-charge-label",children:"Total Charge"})]}),(0,xe.jsxs)("div",{className:"total-charge-val",style:{fontSize:17},children:["\u20b9",Number(xt).toFixed(2)]})]}),(0,xe.jsx)(f.A,{sx:{mt:1.75},children:(0,xe.jsx)(k.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!It||we,startIcon:!we&&(0,xe.jsx)(oe.Cer,{style:{fontSize:11}}),onClick:async()=>{if(!ze)return void kt("Choose Client","warning");if(!Be)return void kt("Pickup location required","warning");if(!rt)return void kt("Select a pickup slot","warning");if(!Ve.length)return void kt("Add at least one drop customer","warning");const t=(()=>{if(rt){const e=d()(rt,["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}if(_e&&et){const e=d()("".concat(d()(_e).format("YYYY-MM-DD")," ").concat(et),["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}return d()().format("YYYY-MM-DD HH:mm:ss")})(),n=Ve.map((e=>{var n,i,r,s;return{applocationid:Be.applocationid,configid:9,partnerid:Be.partnerid,partneruserid:+pe,paymentstatus:1,paymenttype:42,pickupaddress:Be.address||"",pickupcity:Be.city||"",pickupcontactno:Be.contactno||"",pickupcustomer:Be.locationname||"",pickuplandmark:Be.landmark||"",pickuplat:Be.latitude,pickuplocation:Be.suburb||"",pickuplocationid:Be.locationid||0,pickuplong:Be.longitude,tenantid:Be.tenantid,customerid:+(null===e||void 0===e?void 0:e.customerid),deliveryaddress:e.address||"",deliverycharge:+e.totalcharge||0,deliverycity:e.city||"",deliverycontactno:(null===(n=e.contactno)||void 0===n?void 0:n.toString())||"",deliverycustomer:e.firstname||"",deliveryid:+e.customerid,deliverylandmark:e.landmark||"",deliverylat:(null===(i=e.latitude)||void 0===i?void 0:i.toString())||"",deliverylocation:e.suburb||"",deliverylocationid:e.deliverylocationid||0,deliverylong:(null===(r=e.longitude)||void 0===r?void 0:r.toString())||"",deliverytime:t,deliverytype:"B",itemcount:1,quantity:e.quantity,collectionamt:e.collectionamt,kms:(null===(s=e.distance)||void 0===s?void 0:s.toString())||"0",locationid:+Be.locationid,moduleid:+Be.moduleid,orderamount:+e.totalcharge||0,ordercharges:0,orderdate:d()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:ot,orderstatus:"created",ordervalue:+e.totalcharge||0,pickupSlot:rt}}));Se(!0),ke(!0);try{const t=await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/orders/createorders"),n);var i;if(t.data.status)kt("Orders Created Successfully","success",2e3),at&&(async()=>{try{"Success"===(await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:at,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully, kindly process the same",sound:"ring"}})).data.message&&kt("Notification sent Successfully","success",1e3)}catch(e){kt(e.message,"error",1e3)}})(),e("/nearle/orders");else kt((null===t||void 0===t||null===(i=t.data)||void 0===i?void 0:i.message)||"Order creation failed. Please try again.","warning",3e3)}catch(o){let e="Something went wrong. Please try again.";var r;if(o.response)e=(null===(r=o.response.data)||void 0===r?void 0:r.message)||"Server error (".concat(o.response.status,")");else o.request&&(e="Network error. Check your internet connection.");kt(e,"error",3e3)}finally{Se(!1),ke(!1)}},sx:{minHeight:"36px !important"},children:we?(0,xe.jsx)(Y.A,{color:"inherit",size:16,thickness:5}):"Dispatch ".concat(Ve.length||""," ").concat(1===Ve.length?"Order":"Orders").trim()})})]})]}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,md:6,sx:{height:{xs:"auto",md:"100%"},minHeight:0,display:"flex",flexDirection:"column"},children:(0,xe.jsxs)(b.A,{className:"orders-card",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:1.25,maxHeight:{xs:"none",md:685}},children:[(0,xe.jsxs)(g.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{mb:.75,flexShrink:0},children:[(0,xe.jsxs)(f.A,{className:"section-title-bar",sx:{mb:0},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"drops"===Rt?"Drop List":"preview"===Rt?"File Preview":"Preview"}),(0,xe.jsx)(v.A,{size:"small",label:"drops"===Rt?Ve.length:"preview"===Rt?jt.length:0,sx:{height:20,fontSize:10.5,fontWeight:700,ml:1,bgcolor:"rgba(168,85,247,0.10)",color:"#65387a",border:"1px solid rgba(168,85,247,0.25)"}})]}),"drops"===Rt&&(0,xe.jsx)(v.A,{size:"small",label:"\u20b9".concat(Number(xt).toFixed(2)," total"),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(101,56,122,0.10)",color:"#65387a",border:"1px solid rgba(101,56,122,0.25)"}}),"preview"===Rt&&(0,xe.jsx)(v.A,{size:"small",label:"Awaiting Continue",icon:(0,xe.jsx)(ee.A,{style:{fontSize:11}}),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(245,158,11,0.12)",color:"#b45309",border:"1px solid rgba(245,158,11,0.30)","& .MuiChip-icon":{color:"#b45309"}}}),"empty"!==Rt&&(()=>{const e=Ye&&ze&&Me,t=t=>{var n;e?(vt(t),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ue(!0),Xe(""))):Yt("Please select Location, Client, and Business Location first.","warning",3e3)};return(0,xe.jsxs)(g.A,{direction:"row",gap:.75,alignItems:"center",children:[(0,xe.jsx)(k.A,{size:"small",variant:"outlined",onClick:()=>t(0),startIcon:(0,xe.jsx)(ae.CtR,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#1890ff",color:"#1890ff"}},children:"Excel / CSV"}),(0,xe.jsx)(k.A,{size:"small",variant:"outlined",onClick:()=>t(1),startIcon:(0,xe.jsx)(oe.YXz,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#65387a",color:"#65387a"}},children:"Selection"})]})})()]}),yt&&(0,xe.jsxs)(g.A,{direction:"row",gap:.75,alignItems:"center",sx:{mb:.75,color:"#64748b",flexShrink:0},children:[(0,xe.jsx)(te.A,{style:{fontSize:12}}),(0,xe.jsx)(A.A,{sx:{fontSize:11.5},noWrap:!0,children:yt})]}),"preview"===Rt&&jt.length>=1&&(0,xe.jsxs)(f.A,{sx:{mb:1,p:1.25,bgcolor:"rgba(245,158,11,0.06)",border:"1.5px solid rgba(245,158,11,0.25)",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexShrink:0,animation:"blink 1.5s infinite","@keyframes blink":{"0%":{borderColor:"rgba(245,158,11,0.25)"},"50%":{borderColor:"rgba(245,158,11,0.6)"},"100%":{borderColor:"rgba(245,158,11,0.25)"}}},children:[(0,xe.jsxs)(f.A,{sx:{textAlign:"left"},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:12,color:"#b45309",lineHeight:1.2},children:"Process & Calculate Distances"}),(0,xe.jsx)(A.A,{sx:{color:"#b45309",opacity:.8,fontSize:10.5,lineHeight:1.25},children:"Click continue to import spreadsheet rows and calculate drop charges."})]}),(0,xe.jsx)(k.A,{variant:"contained",size:"small",color:"warning",onClick:()=>jt.forEach((e=>zt(e))),sx:{textTransform:"none",borderRadius:"8px",fontWeight:700,fontSize:11,height:28,px:1.5,bgcolor:"#d97706",boxShadow:"none","&:hover":{bgcolor:"#b45309",boxShadow:"none"}},children:"Continue"})]}),(0,xe.jsxs)(f.A,{sx:{flex:1,minHeight:0,overflow:"auto"},children:["drops"===Rt&&n&&(0,xe.jsxs)(he.nV,{sx:{p:0},children:[Ve.map(((e,t)=>{var n;return(0,xe.jsx)(he.pg,{accent:"#65387a",header:(0,xe.jsxs)(g.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:700,color:"#1e293b",lineHeight:1.2},children:[t+1,". ",e.firstname]}),(0,xe.jsx)(A.A,{sx:{fontSize:12,color:"#64748b",mt:.25},children:e.address})]}),(0,xe.jsx)(C.A,{title:"Remove",children:(0,xe.jsx)(z.A,{size:"small",onClick:()=>zt(e),sx:{color:"#ef4444",p:.5,flexShrink:0},children:(0,xe.jsx)(ne.A,{style:{fontSize:14}})})})]}),children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Qty",children:0===At?(0,xe.jsx)(A.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},children:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.quantity||"",onChange:t=>Nt(e.customerid,t.target.value),inputProps:{min:0},fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"8px",height:34}}})}),(0,xe.jsx)(he.pY,{label:"Cash",children:0===At?(0,xe.jsx)(A.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},children:"\u20b9".concat(Number(e.collectionamt||0).toFixed(2))}):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.collectionamt?e.collectionamt:"",placeholder:"0",onChange:t=>{const n=Number(t.target.value);Pt(e.customerid,n>0?n:0)},inputProps:{min:0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:"\u20b9"})},fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"8px",height:34}}})}),(0,xe.jsx)(he.pY,{label:"Km",value:e.distance}),(0,xe.jsx)(he.pY,{label:"Charge",align:"right",children:(0,xe.jsxs)(A.A,{sx:{fontSize:13,fontWeight:700,color:"#1e293b"},children:["\u20b9",Number((null===e||void 0===e?void 0:e.totalcharge)||0).toFixed(2)]})})]})},e.customerid||e.firstname||t)})),(0,xe.jsx)(he.pg,{accent:"#65387a",sx:{bgcolor:"#fafbfc"},children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Total Qty",value:ut}),(0,xe.jsx)(he.pY,{label:"Total Cash",value:"\u20b9".concat(Number(ft).toFixed(2))}),(0,xe.jsx)(he.pY,{label:"Total Km",value:dt}),(0,xe.jsx)(he.pY,{label:"Total Charge",align:"right",children:(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:800,color:"#65387a"},children:["\u20b9",Number(xt).toFixed(2)]})})]})})]}),"drops"===Rt&&!n&&(0,xe.jsx)(W.A,{component:M.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,xe.jsxs)(N.A,{size:"small",stickyHeader:!0,children:[(0,xe.jsx)(P.A,{sx:{bgcolor:"#f8fafc"},children:(0,xe.jsxs)(D.A,{children:[(0,xe.jsx)(I.A,{sx:ue,children:"#"}),(0,xe.jsx)(I.A,{sx:ue,children:"Customer"}),(0,xe.jsx)(I.A,{sx:ue,children:"Address"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Qty"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Cash"}),(0,xe.jsx)(I.A,{sx:ue,children:"Km"}),(0,xe.jsx)(I.A,{sx:ue,align:"right",children:"Charge"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:" "})]})}),(0,xe.jsxs)(R.A,{children:[Ve.map(((e,t)=>(0,xe.jsxs)(D.A,{hover:!0,children:[(0,xe.jsx)(I.A,{sx:me,children:t+1}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{color:"#64748b",maxWidth:220}),children:(0,xe.jsx)(C.A,{title:e.address||"",children:(0,xe.jsx)("span",{style:{display:"inline-block",maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address})})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:0===At?e.quantity:(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.quantity||"",onChange:t=>Nt(e.customerid,t.target.value),inputProps:{min:0},sx:{width:64,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:0===At?"\u20b9".concat(Number(e.collectionamt||0).toFixed(2)):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.collectionamt?e.collectionamt:"",placeholder:"0",onChange:t=>{const n=Number(t.target.value);Pt(e.customerid,n>0?n:0)},inputProps:{min:0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:"\u20b9"})},sx:{width:90,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,xe.jsx)(I.A,{sx:me,children:e.distance}),(0,xe.jsxs)(I.A,{align:"right",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:700,color:"#1e293b"}),children:["\u20b9",Number((null===e||void 0===e?void 0:e.totalcharge)||0).toFixed(2)]}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:(0,xe.jsx)(C.A,{title:"Remove",children:(0,xe.jsx)(z.A,{size:"small",onClick:()=>zt(e),sx:{color:"#ef4444",p:.5},children:(0,xe.jsx)(ne.A,{style:{fontSize:13}})})})})]},e.customerid||e.firstname||t))),(0,xe.jsxs)(D.A,{sx:{bgcolor:"#fafbfc"},children:[(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:"Total"}),(0,xe.jsx)(I.A,{colSpan:2,sx:me}),(0,xe.jsx)(I.A,{align:"center",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:ut}),(0,xe.jsxs)(I.A,{align:"center",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:["\u20b9",Number(ft).toFixed(2)]}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:dt}),(0,xe.jsxs)(I.A,{align:"right",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800,color:"#65387a"}),children:["\u20b9",Number(xt).toFixed(2)]}),(0,xe.jsx)(I.A,{sx:me})]})]})]})}),"preview"===Rt&&n&&(0,xe.jsx)(he.nV,{sx:{p:0},children:jt.map(((e,t)=>{var n;return(0,xe.jsx)(he.pg,{accent:"#d97706",header:(0,xe.jsxs)(f.A,{sx:{minWidth:0},children:[(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:700,color:"#1e293b",lineHeight:1.2},children:[t+1,". ",e.firstname||"\u2014"]}),(0,xe.jsx)(A.A,{sx:{fontSize:12,color:"#64748b",mt:.25},children:e.address||"\u2014"})]}),children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Contact",value:e.contactno||"\u2014"}),(0,xe.jsx)(he.pY,{label:"Qty",value:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}),(0,xe.jsx)(he.pY,{label:"Cash",value:null!=e.collectionamt?"\u20b9".concat(Number(e.collectionamt).toFixed(2)):"\u2014"})]})},t)}))}),"preview"===Rt&&!n&&(0,xe.jsx)(W.A,{component:M.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,xe.jsxs)(N.A,{size:"small",stickyHeader:!0,children:[(0,xe.jsx)(P.A,{sx:{bgcolor:"#f8fafc"},children:(0,xe.jsxs)(D.A,{children:[(0,xe.jsx)(I.A,{sx:ue,children:"#"}),(0,xe.jsx)(I.A,{sx:ue,children:"Name"}),(0,xe.jsx)(I.A,{sx:ue,children:"Contact"}),(0,xe.jsx)(I.A,{sx:ue,children:"Address"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Qty"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Cash"})]})}),(0,xe.jsx)(R.A,{children:jt.map(((e,t)=>{var n;return(0,xe.jsxs)(D.A,{hover:!0,children:[(0,xe.jsx)(I.A,{sx:me,children:t+1}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname||"\u2014"}),(0,xe.jsx)(I.A,{sx:me,children:e.contactno||"\u2014"}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{color:"#64748b",maxWidth:240}),children:(0,xe.jsx)(C.A,{title:e.address||"",children:(0,xe.jsx)("span",{style:{display:"inline-block",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address||"\u2014"})})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:null!=e.collectionamt?"\u20b9".concat(Number(e.collectionamt).toFixed(2)):"\u2014"})]},t)}))})]})}),"empty"===Rt&&(()=>{const e=Ye&&ze&&Me,t=t=>{var n;e?(vt(t),qe([]),bt([]),St(""),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ue(!0),Xe(""))):Yt("Please select Location, Client, and Business Location first.","warning",3e3)},n=n=>{let{value:i,icon:r,title:s,sub:o,accent:l}=n;return(0,xe.jsxs)(f.A,{role:"button",tabIndex:0,onClick:()=>t(i),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(i))},sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",textAlign:"left",gap:1.25,px:1.5,py:1.25,borderRadius:"10px",border:"1.5px solid #eef2f6",bgcolor:"#fff",opacity:e?1:.6,cursor:e?"pointer":"not-allowed",transition:"all 0.18s ease","&:hover":e?{borderColor:l,boxShadow:"0 4px 12px -4px ".concat(l,"40"),transform:"translateY(-1px)"}:void 0},children:[(0,xe.jsx)(f.A,{sx:{width:32,height:32,borderRadius:"8px",background:"".concat(l,"15"),color:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:15,flexShrink:0},children:(0,xe.jsx)(r,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:13,color:"#1e293b",lineHeight:1.15},children:s}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#94a3b8",lineHeight:1.25},noWrap:!0,children:o})]})]})};return(0,xe.jsxs)(g.A,{alignItems:"center",justifyContent:"center",spacing:1.5,sx:{height:"100%",minHeight:240,bgcolor:"rgba(24,144,255,0.03)",border:"1px dashed rgba(24,144,255,0.25)",borderRadius:"12px",p:3,textAlign:"center"},children:[(0,xe.jsx)(f.A,{sx:{width:56,height:56,borderRadius:"14px",bgcolor:"rgba(24,144,255,0.08)",color:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:28},children:(0,xe.jsx)(ie.A,{})}),(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:14},children:"Choose a Drop Source to begin"}),(0,xe.jsx)(A.A,{sx:{color:"#64748b",fontSize:12,maxWidth:360,mb:1},children:"Select a source from below or the left panel to import or pick your delivery customers."}),(0,xe.jsxs)(g.A,{direction:{xs:"column",sm:"row"},gap:1.5,sx:{width:"100%",maxWidth:480,mt:1},children:[n({value:0,icon:ae.CtR,title:"Excel / CSV",sub:"Bulk upload a sheet",accent:"#1890ff"}),n({value:1,icon:oe.YXz,title:"Selection",sub:"Pick saved customers",accent:"#65387a"})]})]})})()]})]})})]})]}),(0,xe.jsx)("input",{accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",id:"upload-file",type:"file",hidden:!0,onChange:e=>{const t=e.target.files[0];if(!t)return;const n=t.name.replace(/\.[^/.]+$/,"");St((e=>e?"".concat(e,", ").concat(n):n)),(e=>{try{var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return void kt("No file selected.","warning");const i=n.name.toLowerCase(),r=i.endsWith(".csv"),s=i.endsWith(".xls")||i.endsWith(".xlsx");if(!r&&!s)return void kt("Invalid file type. Please upload a CSV or Excel file.","warning");const o=(e,t)=>{const n={};for(const s in Mt)n[Wt(s)]=Mt[s];const i=e.map((e=>{const t={};for(const r in e){const s=Wt(r),o=n[s]||s;let l=e[r];"firstname"===o&&(l="string"===typeof(i=l)?i.replace(/^[\d.\s]+/,"").trim():i),t[o]=l}var i;return t})),r=Object.keys(Mt).filter((e=>e.trim().endsWith("*"))).filter((e=>!t.includes(Wt(e))));if(r.length>0)return kt("Missing required columns: ".concat(r.join(", ")),"warning",3e3),void bt([]);bt(i),kt("File uploaded successfully","success",2e3),kt("Press Continue to add as drop customers","info",2500)};if(r&&l().parse(n,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,complete:e=>{var t;if(null===(t=e.data)||void 0===t||!t.length)return kt("CSV file is empty or has no valid rows.","warning"),void bt([]);const n=e.meta.fields.map(Wt);o(e.data,n)},error:e=>kt("CSV parsing failed: ".concat(e.message),"warning")}),s){const e=new FileReader;e.onload=e=>{try{const t=e.target.result,n=a.LF(t,{type:"binary"}),i=n.SheetNames[0],r=n.Sheets[i],s=a.Wp.sheet_to_json(r,{defval:""});if(null===s||void 0===s||!s.length)return kt("Excel file is empty or invalid.","warning"),void bt([]);const l=Object.keys(s[0]).map(Wt);o(s,l)}catch(t){kt("Error reading Excel: ".concat(t.message),"warning")}},e.readAsBinaryString(n)}}catch(n){kt("Unexpected error: ".concat(n.message),"warning")}})(e)}}),(0,xe.jsxs)(H.A,{open:Ze,onClose:()=>Ue(!1),fullWidth:!0,fullScreen:n,sx:{"& .MuiDialog-paper":{borderRadius:{xs:0,sm:"16px"},overflow:"hidden"}},children:[(0,xe.jsx)(T.A,{sx:{bgcolor:t.palette.primary.main,color:"white",py:2.5},children:(0,xe.jsxs)(g.A,{spacing:1.5,children:[(0,xe.jsx)(A.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Drop Customers (".concat(Ve.length||0,")")}),(0,xe.jsx)(L.A,{sx:{width:"100%"},children:(0,xe.jsx)(F.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address\u2026",value:Qe,onChange:e=>Xe(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,xe.jsx)(w.A,{position:"start",children:(0,xe.jsx)(re.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,xe.jsx)(z.A,{sx:{visibility:Qe?"visible":"hidden",p:.5},onClick:()=>Xe(""),children:(0,xe.jsx)(U.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,xe.jsx)(E.A,{}),(0,xe.jsx)(O.A,{sx:{p:2.5,bgcolor:"#fafbfc",minHeight:400,maxHeight:{xs:"none",sm:600}},children:0===(null===Ge||void 0===Ge?void 0:Ge.length)?(0,xe.jsx)(g.A,{alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,xe.jsx)(se.A,{description:"No saved customers found for this client"})}):(0,xe.jsx)(g.A,{spacing:0,children:null===Ge||void 0===Ge?void 0:Ge.map(((e,t)=>{const n=Ve.some((t=>t.customerid===e.customerid));return(0,xe.jsx)(B.A,{children:(0,xe.jsx)(J.A,{sx:{m:0,py:1,px:1.25,borderRadius:"10px","&:hover":{bgcolor:"rgba(24,144,255,0.04)"}},control:(0,xe.jsx)(V.A,{checked:n,onChange:t=>(async(e,t)=>{Se(!0);try{if(e.target.checked){const{roundedDistance:e,totalcharge:n}=await Ct(t);qe((r=>[...r,(0,i.A)((0,i.A)({},t),{},{distance:e,totalcharge:n})]))}else qe((e=>e.filter((e=>e.customerid!==t.customerid))))}catch(n){console.error("Failed to calculate distance:",n)}finally{Se(!1)}})(t,e)}),label:(0,xe.jsxs)(f.A,{sx:{width:"100%"},children:[(0,xe.jsxs)(A.A,{sx:{fontWeight:600,color:"#1e293b",fontSize:13.5},children:[e.firstname," (",e.contactno,")"]}),(0,xe.jsx)(A.A,{sx:{color:"#64748b",fontSize:12,mt:.25},children:e.address})]})})},e.customerid||t)}))})}),(0,xe.jsx)(E.A,{}),(0,xe.jsx)(q.A,{sx:{p:2,bgcolor:"#fafbfc"},children:(0,xe.jsx)(k.A,{variant:"outlined",color:0===Ve.length?"error":"primary",onClick:()=>Ue(!1),sx:{borderRadius:"10px",textTransform:"none",fontWeight:600,px:3},children:0===Ve.length?"Close":"Continue"})})]})]})}},42041:()=>{},62217:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},83686:()=>{},94826:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var i=n(59254),r=n(46639),s=n(62217),o=n(44414);const l=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),a=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,o.jsxs)(l,{children:[(0,o.jsx)(r.A,{color:"primary",size:80,thickness:6}),(0,o.jsx)(a,{children:(0,o.jsx)("img",{src:s,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/54.aae1b62e.chunk.js b/build/static/js/54.aae1b62e.chunk.js deleted file mode 100644 index 5e27938..0000000 --- a/build/static/js/54.aae1b62e.chunk.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[54],{855:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(7208),r=n(76475),s=n(44414);function o(e){var t,n;let o,a,{children:l,type:c="scale",direction:d="right",offset:h=10,scale:p={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":o=h,a=0;break;default:o=0,a=h}const[u,x]=(0,i.Y)(o,a),[m,f]=(0,i.Y)(o,a);switch(c){case"rotate":return(0,s.jsx)(r.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:l});case"slide":return"up"===d||"down"===d?(0,s.jsx)(r.P.div,{animate:{y:void 0!==m?m:""},onHoverEnd:()=>f(),onHoverStart:()=>f(),children:l}):(0,s.jsx)(r.P.div,{animate:{x:void 0!==u?u:""},onHoverEnd:()=>x(),onHoverStart:()=>x(),children:l});default:return"number"===typeof p&&(p={hover:p,tap:p}),(0,s.jsx)(r.P.div,{whileHover:{scale:null===(t=p)||void 0===t?void 0:t.hover},whileTap:{scale:null===(n=p)||void 0===n?void 0:n.tap},children:l})}}},39009:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>xe});var i=n(89379),r=n(9950),s=n(26910),o=n(50847),a=n.n(o),l=n(55271),c=n(4159),d=n.n(c),h=n(28429),p=n(14857),u=n(8881),x=n(55158),m=n(16491),f=n(93230),g=n(82053),A=n(25277),v=n(60899),j=n(48089),b=n(77922),y=n(29925),S=n(2046),w=n(82223),k=n(46639),Y=n(1320),C=n(2235),z=n(15769),W=n(69780),M=n(9213),D=n(21671),P=n(34075),I=n(83274),N=n(25333),R=n(96583),H=n(40033),L=n(25979),T=n(2660),E=n(74745),O=n(28170),F=n(96557),B=n(16497),J=n(93038),V=n(79739),q=n(30633),G=n(81831),K=n(95359),Z=n(7762),U=n(87942),Q=n(81419),X=n(3911),_=n(47738),$=n(27379),ee=n(90421),te=n(94118),ne=n(88349),ie=n(60767),re=n(13838),se=n(54826),oe=n(43302),ae=n(31222),le=n(52351),ce=n(94826),de=(n(855),n(42041),n(44414)),he=n(36220);d().extend(he);const pe={fontSize:11.5,fontWeight:700,color:"#475569",py:.75,px:1},ue={fontSize:12,py:.6,px:1},xe=()=>{const e=(0,h.Zp)(),t=(0,p.A)(),n=(0,r.useRef)(null),o=(0,r.useRef)(null),c=localStorage.getItem("userid"),[he,xe]=(0,r.useState)([]),[me,fe]=(0,r.useState)([]),[ge,Ae]=(0,r.useState)([]),[ve,je]=(0,r.useState)(!1),[be,ye]=(0,r.useState)(!1),[Se,we]=(0,r.useState)(0),[ke,Ye]=(0,r.useState)(0),[Ce,ze]=(0,r.useState)(0),[We,Me]=(0,r.useState)(null),[De,Pe]=(0,r.useState)(null),[Ie,Ne]=(0,r.useState)(0),[Re,He]=(0,r.useState)(0),[Le,Te]=(0,r.useState)(0),[Ee,Oe]=(0,r.useState)(null),[Fe,Be]=(0,r.useState)([]),[Je,Ve]=(0,r.useState)([]),[qe,Ge]=(0,r.useState)(!1),[Ke,Ze]=(0,r.useState)(""),[Ue,Qe]=(0,r.useState)(d()().format("MM-DD-YYYY")),[Xe,_e]=(0,r.useState)(""),[$e,et]=(0,r.useState)(null),[tt,nt]=(0,r.useState)(null),[it,rt]=(0,r.useState)(""),[st,ot]=(0,r.useState)(),[at,lt]=(0,r.useState)(0),[ct,dt]=(0,r.useState)(0),[ht,pt]=(0,r.useState)(0),[ut,xt]=(0,r.useState)(0),[mt,ft]=(0,r.useState)(null),[gt,At]=(0,r.useState)([]),[vt,jt]=(0,r.useState)(""),bt=(0,r.useRef)({}),yt=(e,t,n)=>{(0,u.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:n||1500})},St=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;const i="".concat(t,"-").concat(e);bt.current[i]||(yt(e,t,n),bt.current[i]=!0,setTimeout((()=>delete bt.current[i]),3e3))};(0,r.useEffect)((()=>{Ye(0),Me(null),ze(0),Pe(null),Ae([]),Oe(null),Be([]),At([]),ft(null),jt(""),et(null),nt(null),_e("")}),[Se]),(0,r.useEffect)((()=>{ze(0),Pe(null),Be([]),At([]),ft(null),jt("")}),[ke]);(0,r.useEffect)((()=>{(async()=>{je(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(c));xe(e.data.details||[])}catch(e){St(e.message,"error",5e3)}finally{je(!1)}})()}),[]);(0,r.useEffect)((()=>{Se&&(async()=>{je(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(Se,"&status=active"));if(e.data.status){const t=(e.data.details||[]).map((e=>(0,i.A)((0,i.A)({},e),{},{label:"".concat(e.tenantname)})));fe(t)}}catch(e){St("Failed to load clients","warning",3e3)}finally{je(!1)}})()}),[Se]);(0,r.useEffect)((()=>{if(!ke)return;const e=setTimeout((()=>{(""===Ke||Ke.length>2)&&(async()=>{try{const e=""===Ke?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(ke,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(ke,"&keyword=").concat(Ke),t=await s.A.get(e);t.data.status&&Ve(t.data.details||[])}catch(e){console.log(e),yt("server error","warning")}})()}),250);return()=>clearTimeout(e)}),[Ke,ke]),(0,r.useEffect)((()=>{let e=0,t=0,n=0,i=0;Fe.forEach((r=>{e+=Number(r.distance)||0,t+=Number(r.totalcharge)||0,n+=Number(r.quantity)||0,i+=Number(r.collectionamt)||0})),lt(e),dt(t),pt(n),xt(i)}),[Fe]);const wt=async e=>{var t,n;if("undefined"===typeof window||null===(t=window.google)||void 0===t||null===(n=t.maps)||void 0===n||!n.DistanceMatrixService)throw new Error("Google Maps not loaded");const i=new window.google.maps.DistanceMatrixService;try{var r,s,o,a,l;if(!e||"object"!==typeof e)throw new Error("Invalid customer data.");if(!Ee||"object"!==typeof Ee)throw new Error("Origin (pickCust) data missing or invalid.");const t=await(c=Ee,d=e,new Promise(((e,t)=>{try{if(!c||!d)return t(new Error("Origin or destination data missing."));i.getDistanceMatrix({origins:[new window.google.maps.LatLng(c.latitude,c.longitude)],destinations:[new window.google.maps.LatLng(d.latitude,d.longitude)],travelMode:"DRIVING",unitSystem:window.google.maps.UnitSystem.METRIC},((n,i)=>{"OK"===i?e(n):t(new Error("Google API error: ".concat(i)))}))}catch(n){t(new Error("Unexpected error inside DistanceMatrixService: ".concat(n.message)))}}))),n=null===t||void 0===t||null===(r=t.rows)||void 0===r||null===(s=r[0])||void 0===s||null===(o=s.elements)||void 0===o||null===(a=o[0])||void 0===a||null===(l=a.distance)||void 0===l?void 0:l.value;if(null==n)throw new Error("Malformed Distance Matrix response: missing distance value.");const h=n/1e3,p=Math.round(h);return{roundedDistance:p,totalcharge:p{let t=!1;if(Be((n=>(t=n.some((t=>t.firstname===e.firstname)),t?n.filter((t=>t.firstname!==e.firstname)):n))),!t){je(!0);try{const{roundedDistance:t,totalcharge:n}=await wt(e);Be((r=>r.some((t=>t.firstname===e.firstname))?r:[...r,(0,i.A)((0,i.A)({},e),{},{distance:t,totalcharge:n})]))}catch(n){console.error("Failed to calculate distance:",n)}finally{je(!1)}}};(0,r.useEffect)((()=>{Se&&(async()=>{try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(Se));if(e.data.status){const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));ot(t)}}catch(e){console.log(e)}})()}),[Se]);const Yt=e=>null===e||void 0===e?void 0:e.toString().trim().toLowerCase().replace(/\s+/g,""),Ct={"pickupdate(yyyy-mmm-dd)":"date","sendername*":"locationname","senderphone*":"locationcontact","senderaddress*":"locationaddress","receivername*":"firstname",receiverphone:"contactno","receiveralternatephone*":"altcontactno",receiverfulladdress:"address",receiverlatitude:"latitude",receiverlongitude:"longitude","itemdescription*":"description",Quantity:"quantity"," Collect Cash":"collectionamt",customerDeliveryTime:"customerdeliverytime",kitchenPickupTime:"kitchenpickuptime"},zt={location:!!Se,client:!!ke,business:!!Ce,schedule:!!tt,drops:Fe.length>0},Wt=zt.location&&zt.client&&zt.business&&zt.schedule&&zt.drops,Mt=Fe.length>0?"drops":gt.length>0?"preview":"empty";return(0,de.jsxs)(de.Fragment,{children:[ve&&(0,de.jsx)(le.A,{}),(0,de.jsx)(x.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:be,children:(0,de.jsx)(ce.A,{color:"inherit"})}),(0,de.jsxs)(m.A,{className:"orders-workspace-bg",sx:{height:"calc(100vh - 64px)",display:"flex",flexDirection:"column",overflow:"hidden",p:{xs:1,sm:1.25},gap:1},children:[(0,de.jsxs)(f.A,{direction:"row",alignItems:"center",gap:1,flexWrap:"wrap",sx:{flexShrink:0,px:.5},children:[(0,de.jsx)(g.A,{sx:{fontWeight:700,fontSize:{xs:16,sm:17},color:"#1e293b",lineHeight:1.2},children:"Create Multiple Orders"}),(0,de.jsx)(A.A,{size:"small",label:"".concat(Fe.length," drop").concat(1===Fe.length?"":"s"),sx:{height:20,fontSize:10.5,fontWeight:700,bgcolor:Fe.length?"rgba(24,144,255,0.10)":"#f1f5f9",color:Fe.length?"#1890ff":"#94a3b8",border:"1px solid ".concat(Fe.length?"rgba(24,144,255,0.25)":"#e2e8f0")}}),(0,de.jsx)(m.A,{sx:{flex:1}}),(0,de.jsx)(g.A,{sx:{fontSize:11,color:"#94a3b8",display:{xs:"none",md:"block"}},children:"Bulk-create deliveries from CSV/Excel or saved customers."})]}),(0,de.jsxs)(v.Ay,{container:!0,spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden"},children:[(0,de.jsxs)(v.Ay,{item:!0,xs:12,md:6,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",gap:2.25,overflowY:"auto",pr:.75},children:[(0,de.jsxs)(j.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,de.jsx)(m.A,{className:"section-title-bar",sx:{mb:1.5},children:(0,de.jsx)(g.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Setup"})}),(0,de.jsxs)(v.Ay,{container:!0,spacing:1.75,children:[(0,de.jsx)(v.Ay,{item:!0,xs:12,sm:4,children:(0,de.jsx)(b.A,{fullWidth:!0,size:"small",ref:n,className:"header-compact-input",options:he||[],getOptionLabel:e=>"".concat(e.locationname),onChange:(e,t,n)=>{"clear"===n?we(0):t&&we(t.applocationid)},renderInput:e=>(0,de.jsx)(y.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(oe.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,de.jsx)(v.Ay,{item:!0,xs:12,sm:4,children:(0,de.jsx)(b.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:me||[],value:We,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",isOptionEqualToValue:(e,t)=>e.tenantid===t.tenantid,onOpen:e=>{Se||(e.preventDefault(),St("Please select Location first!","warning",3e3),setTimeout((()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(Ye(0),Me(null)):t&&(Ye(t.tenantid),Me(t),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e))).data.details||{};Ne(t.baseprice||0),He(t.priceperkm||0),Te(t.minkm||0)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e))).data.details||[];1===t.length?(Ae(t),Oe(t[0]),ze(t[0].locationid),Pe(t[0]),et(t[0].slots)):Ae(t)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid))},renderInput:e=>(0,de.jsx)(y.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:o,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(se.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,de.jsx)(v.Ay,{item:!0,xs:12,sm:4,children:1===ge.length?(0,de.jsx)(y.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:ge[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:t.palette.primary.main},startAdornment:(0,de.jsx)(U.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,de.jsx)(b.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:De,options:ge||[],getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname," (").concat(e.suburb||"",")"):"",onOpen:e=>{Se||ke?ke||(e.preventDefault(),St("Please select Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),St("Please select Location and Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"!==n&&t?(ze(t.locationid||0),Pe(t),Oe(t),et(null===t||void 0===t?void 0:t.slots)):(ze(0),Pe(null),Oe(null),et(null))},renderInput:e=>(0,de.jsx)(y.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Business Location",label:"Business Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(U.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,de.jsxs)(j.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,de.jsx)(m.A,{className:"section-title-bar section-title-bar--accent",sx:{mb:1.5},children:(0,de.jsx)(g.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Schedule & Pickup"})}),(0,de.jsxs)(v.Ay,{container:!0,spacing:1.75,children:[(0,de.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,de.jsx)(G.$,{dateAdapter:K.R,children:(0,de.jsx)(q.l,{label:"Pickup Date",format:"DD-MM-YYYY",value:Ue?d()(Ue):null,onChange:e=>{if(!e||!d()(e).isValid())return void Qe(d()().format("MM-DD-YYYY"));d()().diff(d()("".concat(d()(e).format("YYYY-MM-DD"))),"d")<=0?(Qe(d()(e).format("MM-DD-YYYY")),_e(""),nt(null)):(yt("Choose an upcoming date","warning"),Qe(d()().format("MM-DD-YYYY")))},disablePast:!0,slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,de.jsx)(S.A,{position:"start",children:(0,de.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px",paddingLeft:"10px"}}}}})})}),(0,de.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,de.jsx)(b.A,{size:"small",fullWidth:!0,options:$e||[],sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},onChange:(e,t,n)=>{if("clear"===n||!t)return _e(null),void nt(null);if(!t.time)return void St("This slot has no time configured.","warning",3e3);const i=d()(t.time,"HH:mm").format("hh:mm A");_e(i);const r=d()("".concat(Ue," ").concat(i),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");nt(r)},getOptionLabel:e=>e?"".concat(e.name," (").concat(d()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,de.jsx)(y.A,(0,i.A)((0,i.A)({},e),{},{label:"Pickup Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(X.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,de.jsx)(v.Ay,{item:!0,xs:12,children:Ee?(0,de.jsxs)(f.A,{direction:"row",spacing:1.25,alignItems:"center",sx:{border:"1px solid #eef2f6",borderLeft:"3px solid #1890ff",borderRadius:"10px",px:1.25,py:.75,bgcolor:"#fbfcff"},children:[(0,de.jsx)(m.A,{sx:{width:28,height:28,borderRadius:"8px",background:"linear-gradient(135deg,#1890ff,#096dd9)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:12,boxShadow:"0 4px 10px rgba(24,144,255,0.30)"},children:(0,de.jsx)(oe.sIY,{})}),(0,de.jsxs)(m.A,{sx:{minWidth:0,flex:1},children:[(0,de.jsx)(g.A,{sx:{fontSize:12.5,fontWeight:700,color:"#1e293b",lineHeight:1.2},noWrap:!0,children:Ee.locationname||"\u2014"}),(0,de.jsx)(g.A,{sx:{fontSize:11,color:"#64748b",lineHeight:1.3},noWrap:!0,children:Ee.address||"\u2014"})]})]}):(0,de.jsx)(g.A,{sx:{color:"#94a3b8",fontSize:12},children:"Pickup auto-fills once a Business Location is selected."})})]})]}),(0,de.jsxs)(j.A,{className:"orders-card delivery-prefs-card",sx:{p:2,flexShrink:0},children:[(0,de.jsxs)(m.A,{className:"delivery-prefs-header",sx:{mb:1},children:[(0,de.jsx)(g.A,{className:"delivery-prefs-title",children:"Order Notes"}),(0,de.jsx)(g.A,{className:"delivery-prefs-sub",children:"Applied to every order"})]}),(0,de.jsx)(m.A,{className:"delivery-prefs-row",children:(0,de.jsxs)(m.A,{className:"delivery-prefs-field",sx:{width:"100%"},children:[(0,de.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"bulk-dispatch-notes-input",children:[(0,de.jsx)(_.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,de.jsx)(y.A,{id:"bulk-dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:it,onChange:e=>rt(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]})})]}),(0,de.jsxs)(j.A,{className:"orders-card pricing-summary-card",sx:{flexShrink:0,p:"16px 18px !important"},children:[(0,de.jsxs)(m.A,{className:"pricing-header",sx:{mb:1.5,pb:1},children:[(0,de.jsx)(g.A,{className:"pricing-title",sx:{fontSize:"13px !important"},children:"Bulk Summary"}),(0,de.jsx)(g.A,{className:"pricing-subtitle",sx:{fontSize:"10px !important"},children:"Live totals"})]}),(()=>{const e=e=>{let{icon:t,label:n,value:r,accent:s,active:o}=e;return(0,de.jsxs)(m.A,{sx:(0,i.A)({bgcolor:"#fff",border:"1px solid #eef2f6",borderRadius:"10px",px:1,py:.75,display:"flex",alignItems:"center",gap:.85,minWidth:0,transition:"border-color 0.2s, box-shadow 0.2s"},o&&{borderColor:"".concat(s,"55"),boxShadow:"0 2px 6px -2px ".concat(s,"33")}),children:[(0,de.jsx)(m.A,{sx:{width:26,height:26,borderRadius:"8px",bgcolor:"".concat(s,"18"),color:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,flexShrink:0},children:(0,de.jsx)(t,{})}),(0,de.jsxs)(m.A,{sx:{minWidth:0,flex:1},children:[(0,de.jsx)(g.A,{sx:{fontSize:9.5,fontWeight:600,color:"#94a3b8",letterSpacing:.4,textTransform:"uppercase",lineHeight:1},children:n}),(0,de.jsx)(g.A,{sx:{fontSize:13.5,fontWeight:800,color:o?"#1e293b":"#94a3b8",lineHeight:1.2,mt:.25},noWrap:!0,children:r})]})]})};return(0,de.jsxs)(v.Ay,{container:!0,spacing:1.25,children:[(0,de.jsx)(v.Ay,{item:!0,xs:6,children:e({icon:se.$Fg,label:"Distance",value:at?"".concat(at," km"):"\u2014",accent:"#1890ff",active:!!at})}),(0,de.jsx)(v.Ay,{item:!0,xs:6,children:e({icon:se.H5e,label:"Quantity",value:ht||0,accent:"#16a34a",active:!!ht})}),(0,de.jsx)(v.Ay,{item:!0,xs:6,children:e({icon:se.MxO,label:"Cash Collect",value:"\u20b9".concat(Number(ut).toFixed(2)),accent:"#d97706",active:!!ut})}),(0,de.jsx)(v.Ay,{item:!0,xs:6,children:e({icon:se.dv1,label:"Deliveries",value:Fe.length,accent:"#65387a",active:Fe.length>0})})]})})(),Fe.length>0&&(0,de.jsxs)("div",{className:"total-charge-badge",style:{marginTop:14,padding:"10px 14px"},children:[(0,de.jsxs)("div",{className:"total-charge-left",children:[(0,de.jsx)(se.wTh,{className:"total-charge-icon"}),(0,de.jsx)("div",{className:"total-charge-label",children:"Total Charge"})]}),(0,de.jsxs)("div",{className:"total-charge-val",style:{fontSize:17},children:["\u20b9",Number(ct).toFixed(2)]})]}),(0,de.jsx)(m.A,{sx:{mt:1.75},children:(0,de.jsx)(w.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!Wt||be,startIcon:!be&&(0,de.jsx)(se.Cer,{style:{fontSize:11}}),onClick:async()=>{if(!ke)return void yt("Choose Client","warning");if(!Ee)return void yt("Pickup location required","warning");if(!tt)return void yt("Select a pickup slot","warning");if(!Fe.length)return void yt("Add at least one drop customer","warning");const t=(()=>{if(tt){const e=d()(tt,["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}if(Ue&&Xe){const e=d()("".concat(d()(Ue).format("YYYY-MM-DD")," ").concat(Xe),["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}return d()().format("YYYY-MM-DD HH:mm:ss")})(),n=Fe.map((e=>{var n,i,r,s;return{applocationid:Ee.applocationid,configid:9,partnerid:Ee.partnerid,partneruserid:+c,paymentstatus:1,paymenttype:42,pickupaddress:Ee.address||"",pickupcity:Ee.city||"",pickupcontactno:Ee.contactno||"",pickupcustomer:Ee.locationname||"",pickuplandmark:Ee.landmark||"",pickuplat:Ee.latitude,pickuplocation:Ee.suburb||"",pickuplocationid:Ee.locationid||0,pickuplong:Ee.longitude,tenantid:Ee.tenantid,customerid:+(null===e||void 0===e?void 0:e.customerid),deliveryaddress:e.address||"",deliverycharge:+e.totalcharge||0,deliverycity:e.city||"",deliverycontactno:(null===(n=e.contactno)||void 0===n?void 0:n.toString())||"",deliverycustomer:e.firstname||"",deliveryid:+e.customerid,deliverylandmark:e.landmark||"",deliverylat:(null===(i=e.latitude)||void 0===i?void 0:i.toString())||"",deliverylocation:e.suburb||"",deliverylocationid:e.deliverylocationid||0,deliverylong:(null===(r=e.longitude)||void 0===r?void 0:r.toString())||"",deliverytime:t,deliverytype:"B",itemcount:1,quantity:e.quantity,collectionamt:e.collectionamt,kms:(null===(s=e.distance)||void 0===s?void 0:s.toString())||"0",locationid:+Ee.locationid,moduleid:+Ee.moduleid,orderamount:+e.totalcharge||0,ordercharges:0,orderdate:d()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:it,orderstatus:"created",ordervalue:+e.totalcharge||0,pickupSlot:tt}}));je(!0),ye(!0);try{const t=await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/orders/createorders"),n);var i;if(t.data.status)yt("Orders Created Successfully","success",2e3),st&&(async()=>{try{"Success"===(await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:st,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully, kindly process the same",sound:"ring"}})).data.message&&yt("Notification sent Successfully","success",1e3)}catch(e){yt(e.message,"error",1e3)}})(),e("/nearle/orders");else yt((null===t||void 0===t||null===(i=t.data)||void 0===i?void 0:i.message)||"Order creation failed. Please try again.","warning",3e3)}catch(o){let e="Something went wrong. Please try again.";var r;if(o.response)e=(null===(r=o.response.data)||void 0===r?void 0:r.message)||"Server error (".concat(o.response.status,")");else o.request&&(e="Network error. Check your internet connection.");yt(e,"error",3e3)}finally{je(!1),ye(!1)}},sx:{minHeight:"36px !important"},children:be?(0,de.jsx)(k.A,{color:"inherit",size:16,thickness:5}):"Dispatch ".concat(Fe.length||""," ").concat(1===Fe.length?"Order":"Orders").trim()})})]})]}),(0,de.jsx)(v.Ay,{item:!0,xs:12,md:6,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:(0,de.jsxs)(j.A,{className:"orders-card",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:1.25,maxHeight:685},children:[(0,de.jsxs)(f.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{mb:.75,flexShrink:0},children:[(0,de.jsxs)(m.A,{className:"section-title-bar",sx:{mb:0},children:[(0,de.jsx)(g.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"drops"===Mt?"Drop List":"preview"===Mt?"File Preview":"Preview"}),(0,de.jsx)(A.A,{size:"small",label:"drops"===Mt?Fe.length:"preview"===Mt?gt.length:0,sx:{height:20,fontSize:10.5,fontWeight:700,ml:1,bgcolor:"rgba(168,85,247,0.10)",color:"#65387a",border:"1px solid rgba(168,85,247,0.25)"}})]}),"drops"===Mt&&(0,de.jsx)(A.A,{size:"small",label:"\u20b9".concat(Number(ct).toFixed(2)," total"),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(101,56,122,0.10)",color:"#65387a",border:"1px solid rgba(101,56,122,0.25)"}}),"preview"===Mt&&(0,de.jsx)(A.A,{size:"small",label:"Awaiting Continue",icon:(0,de.jsx)($.A,{style:{fontSize:11}}),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(245,158,11,0.12)",color:"#b45309",border:"1px solid rgba(245,158,11,0.30)","& .MuiChip-icon":{color:"#b45309"}}}),"empty"!==Mt&&(()=>{const e=Se&&ke&&Ce,t=t=>{var n;e?(ft(t),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ge(!0),Ze(""))):St("Please select Location, Client, and Business Location first.","warning",3e3)};return(0,de.jsxs)(f.A,{direction:"row",gap:.75,alignItems:"center",children:[(0,de.jsx)(w.A,{size:"small",variant:"outlined",onClick:()=>t(0),startIcon:(0,de.jsx)(ae.CtR,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#1890ff",color:"#1890ff"}},children:"Excel / CSV"}),(0,de.jsx)(w.A,{size:"small",variant:"outlined",onClick:()=>t(1),startIcon:(0,de.jsx)(se.YXz,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#65387a",color:"#65387a"}},children:"Selection"})]})})()]}),vt&&(0,de.jsxs)(f.A,{direction:"row",gap:.75,alignItems:"center",sx:{mb:.75,color:"#64748b",flexShrink:0},children:[(0,de.jsx)(ee.A,{style:{fontSize:12}}),(0,de.jsx)(g.A,{sx:{fontSize:11.5},noWrap:!0,children:vt})]}),"preview"===Mt&>.length>=1&&(0,de.jsxs)(m.A,{sx:{mb:1,p:1.25,bgcolor:"rgba(245,158,11,0.06)",border:"1.5px solid rgba(245,158,11,0.25)",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexShrink:0,animation:"blink 1.5s infinite","@keyframes blink":{"0%":{borderColor:"rgba(245,158,11,0.25)"},"50%":{borderColor:"rgba(245,158,11,0.6)"},"100%":{borderColor:"rgba(245,158,11,0.25)"}}},children:[(0,de.jsxs)(m.A,{sx:{textAlign:"left"},children:[(0,de.jsx)(g.A,{sx:{fontWeight:700,fontSize:12,color:"#b45309",lineHeight:1.2},children:"Process & Calculate Distances"}),(0,de.jsx)(g.A,{sx:{color:"#b45309",opacity:.8,fontSize:10.5,lineHeight:1.25},children:"Click continue to import spreadsheet rows and calculate drop charges."})]}),(0,de.jsx)(w.A,{variant:"contained",size:"small",color:"warning",onClick:()=>gt.forEach((e=>kt(e))),sx:{textTransform:"none",borderRadius:"8px",fontWeight:700,fontSize:11,height:28,px:1.5,bgcolor:"#d97706",boxShadow:"none","&:hover":{bgcolor:"#b45309",boxShadow:"none"}},children:"Continue"})]}),(0,de.jsxs)(m.A,{sx:{flex:1,minHeight:0,overflow:"auto"},children:["drops"===Mt&&(0,de.jsx)(Y.A,{component:C.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,de.jsxs)(z.A,{size:"small",stickyHeader:!0,children:[(0,de.jsx)(W.A,{sx:{bgcolor:"#f8fafc"},children:(0,de.jsxs)(M.A,{children:[(0,de.jsx)(D.A,{sx:pe,children:"#"}),(0,de.jsx)(D.A,{sx:pe,children:"Customer"}),(0,de.jsx)(D.A,{sx:pe,children:"Address"}),(0,de.jsx)(D.A,{sx:pe,align:"center",children:"Qty"}),(0,de.jsx)(D.A,{sx:pe,align:"center",children:"Cash"}),(0,de.jsx)(D.A,{sx:pe,children:"Km"}),(0,de.jsx)(D.A,{sx:pe,align:"right",children:"Charge"}),(0,de.jsx)(D.A,{sx:pe,align:"center",children:" "})]})}),(0,de.jsxs)(P.A,{children:[Fe.map(((e,t)=>(0,de.jsxs)(M.A,{hover:!0,children:[(0,de.jsx)(D.A,{sx:ue,children:t+1}),(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname}),(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{color:"#64748b",maxWidth:220}),children:(0,de.jsx)(I.A,{title:e.address||"",children:(0,de.jsx)("span",{style:{display:"inline-block",maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address})})}),(0,de.jsx)(D.A,{align:"center",sx:ue,children:0===mt?e.quantity:(0,de.jsx)(y.A,{size:"small",type:"number",value:e.quantity||"",onChange:t=>{return n=e.customerid,r=t.target.value,void Be((e=>e.map((e=>e.customerid===n?(0,i.A)((0,i.A)({},e),{},{quantity:Number(r)||0}):e))));var n,r},inputProps:{min:0},sx:{width:64,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,de.jsx)(D.A,{align:"center",sx:ue,children:0===mt?"\u20b9".concat(Number(e.collectionamt||0).toFixed(2)):(0,de.jsx)(y.A,{size:"small",type:"number",value:e.collectionamt?e.collectionamt:"",placeholder:"0",onChange:t=>{const n=Number(t.target.value);var r,s;r=e.customerid,s=n>0?n:0,Be((e=>e.map((e=>e.customerid===r?(0,i.A)((0,i.A)({},e),{},{collectionamt:Number(s)||0}):e))))},inputProps:{min:0},InputProps:{startAdornment:(0,de.jsx)(S.A,{position:"start",children:"\u20b9"})},sx:{width:90,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,de.jsx)(D.A,{sx:ue,children:e.distance}),(0,de.jsxs)(D.A,{align:"right",sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:700,color:"#1e293b"}),children:["\u20b9",Number((null===e||void 0===e?void 0:e.totalcharge)||0).toFixed(2)]}),(0,de.jsx)(D.A,{align:"center",sx:ue,children:(0,de.jsx)(I.A,{title:"Remove",children:(0,de.jsx)(N.A,{size:"small",onClick:()=>kt(e),sx:{color:"#ef4444",p:.5},children:(0,de.jsx)(te.A,{style:{fontSize:13}})})})})]},e.customerid||e.firstname||t))),(0,de.jsxs)(M.A,{sx:{bgcolor:"#fafbfc"},children:[(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:800}),children:"Total"}),(0,de.jsx)(D.A,{colSpan:2,sx:ue}),(0,de.jsx)(D.A,{align:"center",sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:800}),children:ht}),(0,de.jsxs)(D.A,{align:"center",sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:800}),children:["\u20b9",Number(ut).toFixed(2)]}),(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:800}),children:at}),(0,de.jsxs)(D.A,{align:"right",sx:(0,i.A)((0,i.A)({},ue),{},{fontWeight:800,color:"#65387a"}),children:["\u20b9",Number(ct).toFixed(2)]}),(0,de.jsx)(D.A,{sx:ue})]})]})]})}),"preview"===Mt&&(0,de.jsx)(Y.A,{component:C.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,de.jsxs)(z.A,{size:"small",stickyHeader:!0,children:[(0,de.jsx)(W.A,{sx:{bgcolor:"#f8fafc"},children:(0,de.jsxs)(M.A,{children:[(0,de.jsx)(D.A,{sx:pe,children:"#"}),(0,de.jsx)(D.A,{sx:pe,children:"Name"}),(0,de.jsx)(D.A,{sx:pe,children:"Contact"}),(0,de.jsx)(D.A,{sx:pe,children:"Address"}),(0,de.jsx)(D.A,{sx:pe,align:"center",children:"Qty"}),(0,de.jsx)(D.A,{sx:pe,align:"center",children:"Cash"})]})}),(0,de.jsx)(P.A,{children:gt.map(((e,t)=>{var n;return(0,de.jsxs)(M.A,{hover:!0,children:[(0,de.jsx)(D.A,{sx:ue,children:t+1}),(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname||"\u2014"}),(0,de.jsx)(D.A,{sx:ue,children:e.contactno||"\u2014"}),(0,de.jsx)(D.A,{sx:(0,i.A)((0,i.A)({},ue),{},{color:"#64748b",maxWidth:240}),children:(0,de.jsx)(I.A,{title:e.address||"",children:(0,de.jsx)("span",{style:{display:"inline-block",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address||"\u2014"})})}),(0,de.jsx)(D.A,{align:"center",sx:ue,children:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}),(0,de.jsx)(D.A,{align:"center",sx:ue,children:null!=e.collectionamt?"\u20b9".concat(Number(e.collectionamt).toFixed(2)):"\u2014"})]},t)}))})]})}),"empty"===Mt&&(()=>{const e=Se&&ke&&Ce,t=t=>{var n;e?(ft(t),Be([]),At([]),jt(""),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ge(!0),Ze(""))):St("Please select Location, Client, and Business Location first.","warning",3e3)},n=n=>{let{value:i,icon:r,title:s,sub:o,accent:a}=n;return(0,de.jsxs)(m.A,{role:"button",tabIndex:0,onClick:()=>t(i),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(i))},sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",textAlign:"left",gap:1.25,px:1.5,py:1.25,borderRadius:"10px",border:"1.5px solid #eef2f6",bgcolor:"#fff",opacity:e?1:.6,cursor:e?"pointer":"not-allowed",transition:"all 0.18s ease","&:hover":e?{borderColor:a,boxShadow:"0 4px 12px -4px ".concat(a,"40"),transform:"translateY(-1px)"}:void 0},children:[(0,de.jsx)(m.A,{sx:{width:32,height:32,borderRadius:"8px",background:"".concat(a,"15"),color:a,display:"flex",alignItems:"center",justifyContent:"center",fontSize:15,flexShrink:0},children:(0,de.jsx)(r,{})}),(0,de.jsxs)(m.A,{sx:{minWidth:0,flex:1},children:[(0,de.jsx)(g.A,{sx:{fontWeight:700,fontSize:13,color:"#1e293b",lineHeight:1.15},children:s}),(0,de.jsx)(g.A,{sx:{fontSize:11,color:"#94a3b8",lineHeight:1.25},noWrap:!0,children:o})]})]})};return(0,de.jsxs)(f.A,{alignItems:"center",justifyContent:"center",spacing:1.5,sx:{height:"100%",minHeight:240,bgcolor:"rgba(24,144,255,0.03)",border:"1px dashed rgba(24,144,255,0.25)",borderRadius:"12px",p:3,textAlign:"center"},children:[(0,de.jsx)(m.A,{sx:{width:56,height:56,borderRadius:"14px",bgcolor:"rgba(24,144,255,0.08)",color:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:28},children:(0,de.jsx)(ne.A,{})}),(0,de.jsx)(g.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:14},children:"Choose a Drop Source to begin"}),(0,de.jsx)(g.A,{sx:{color:"#64748b",fontSize:12,maxWidth:360,mb:1},children:"Select a source from below or the left panel to import or pick your delivery customers."}),(0,de.jsxs)(f.A,{direction:{xs:"column",sm:"row"},gap:1.5,sx:{width:"100%",maxWidth:480,mt:1},children:[n({value:0,icon:ae.CtR,title:"Excel / CSV",sub:"Bulk upload a sheet",accent:"#1890ff"}),n({value:1,icon:se.YXz,title:"Selection",sub:"Pick saved customers",accent:"#65387a"})]})]})})()]})]})})]})]}),(0,de.jsx)("input",{accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",id:"upload-file",type:"file",hidden:!0,onChange:e=>{const t=e.target.files[0];if(!t)return;const n=t.name.replace(/\.[^/.]+$/,"");jt((e=>e?"".concat(e,", ").concat(n):n)),(e=>{try{var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return void yt("No file selected.","warning");const i=n.name.toLowerCase(),r=i.endsWith(".csv"),s=i.endsWith(".xls")||i.endsWith(".xlsx");if(!r&&!s)return void yt("Invalid file type. Please upload a CSV or Excel file.","warning");const o=(e,t)=>{const n={};for(const s in Ct)n[Yt(s)]=Ct[s];const i=e.map((e=>{const t={};for(const r in e){const s=Yt(r),o=n[s]||s;let a=e[r];"firstname"===o&&(a="string"===typeof(i=a)?i.replace(/^[\d.\s]+/,"").trim():i),t[o]=a}var i;return t})),r=Object.keys(Ct).filter((e=>e.trim().endsWith("*"))).filter((e=>!t.includes(Yt(e))));if(r.length>0)return yt("Missing required columns: ".concat(r.join(", ")),"warning",3e3),void At([]);At(i),yt("File uploaded successfully","success",2e3),yt("Press Continue to add as drop customers","info",2500)};if(r&&a().parse(n,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,complete:e=>{var t;if(null===(t=e.data)||void 0===t||!t.length)return yt("CSV file is empty or has no valid rows.","warning"),void At([]);const n=e.meta.fields.map(Yt);o(e.data,n)},error:e=>yt("CSV parsing failed: ".concat(e.message),"warning")}),s){const e=new FileReader;e.onload=e=>{try{const t=e.target.result,n=l.LF(t,{type:"binary"}),i=n.SheetNames[0],r=n.Sheets[i],s=l.Wp.sheet_to_json(r,{defval:""});if(null===s||void 0===s||!s.length)return yt("Excel file is empty or invalid.","warning"),void At([]);const a=Object.keys(s[0]).map(Yt);o(s,a)}catch(t){yt("Error reading Excel: ".concat(t.message),"warning")}},e.readAsBinaryString(n)}}catch(n){yt("Unexpected error: ".concat(n.message),"warning")}})(e)}}),(0,de.jsxs)(R.A,{open:qe,onClose:()=>Ge(!1),fullWidth:!0,sx:{"& .MuiDialog-paper":{borderRadius:"16px",overflow:"hidden"}},children:[(0,de.jsx)(H.A,{sx:{bgcolor:t.palette.primary.main,color:"white",py:2.5},children:(0,de.jsxs)(f.A,{spacing:1.5,children:[(0,de.jsx)(g.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Drop Customers (".concat(Fe.length||0,")")}),(0,de.jsx)(L.A,{sx:{width:"100%"},children:(0,de.jsx)(T.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address\u2026",value:Ke,onChange:e=>Ze(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,de.jsx)(S.A,{position:"start",children:(0,de.jsx)(ie.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,de.jsx)(N.A,{sx:{visibility:Ke?"visible":"hidden",p:.5},onClick:()=>Ze(""),children:(0,de.jsx)(Z.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,de.jsx)(E.A,{}),(0,de.jsx)(O.A,{sx:{p:2.5,bgcolor:"#fafbfc",minHeight:400,maxHeight:600},children:0===(null===Je||void 0===Je?void 0:Je.length)?(0,de.jsx)(f.A,{alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,de.jsx)(re.A,{description:"No saved customers found for this client"})}):(0,de.jsx)(f.A,{spacing:0,children:null===Je||void 0===Je?void 0:Je.map(((e,t)=>{const n=Fe.some((t=>t.customerid===e.customerid));return(0,de.jsx)(F.A,{children:(0,de.jsx)(B.A,{sx:{m:0,py:1,px:1.25,borderRadius:"10px","&:hover":{bgcolor:"rgba(24,144,255,0.04)"}},control:(0,de.jsx)(J.A,{checked:n,onChange:t=>(async(e,t)=>{je(!0);try{if(e.target.checked){const{roundedDistance:e,totalcharge:n}=await wt(t);Be((r=>[...r,(0,i.A)((0,i.A)({},t),{},{distance:e,totalcharge:n})]))}else Be((e=>e.filter((e=>e.customerid!==t.customerid))))}catch(n){console.error("Failed to calculate distance:",n)}finally{je(!1)}})(t,e)}),label:(0,de.jsxs)(m.A,{sx:{width:"100%"},children:[(0,de.jsxs)(g.A,{sx:{fontWeight:600,color:"#1e293b",fontSize:13.5},children:[e.firstname," (",e.contactno,")"]}),(0,de.jsx)(g.A,{sx:{color:"#64748b",fontSize:12,mt:.25},children:e.address})]})})},e.customerid||t)}))})}),(0,de.jsx)(E.A,{}),(0,de.jsx)(V.A,{sx:{p:2,bgcolor:"#fafbfc"},children:(0,de.jsx)(w.A,{variant:"outlined",color:0===Fe.length?"error":"primary",onClick:()=>Ge(!1),sx:{borderRadius:"10px",textTransform:"none",fontWeight:600,px:3},children:0===Fe.length?"Close":"Continue"})})]})]})}},42041:()=>{},62217:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},83686:()=>{},94826:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var i=n(59254),r=n(46639),s=n(62217),o=n(44414);const a=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),l=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,o.jsxs)(a,{children:[(0,o.jsx)(r.A,{color:"primary",size:80,thickness:6}),(0,o.jsx)(l,{children:(0,o.jsx)("img",{src:s,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/6165.733094c1.chunk.js b/build/static/js/6165.733094c1.chunk.js new file mode 100644 index 0000000..2b06b10 --- /dev/null +++ b/build/static/js/6165.733094c1.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6165],{23787:(e,o,r)=>{r.d(o,{FG:()=>p,nV:()=>x,pY:()=>u,pg:()=>h});var n=r(89379),i=r(80045),t=r(93230),s=r(2235),l=r(16491),c=r(82053),a=r(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:s,sx:l}=e,c=(0,i.A)(e,d);return(0,a.jsx)(t.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:s,sx:(0,n.A)((0,n.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},c),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:i,selected:t=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(s.A,{elevation:0,onClick:c,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?o:"#e2e8f0",background:t?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,a.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[r,d,i]})]})},p=e=>{let{children:o,columns:r=2,sx:i}=e;return(0,a.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},i),children:o})},u=e=>{let{label:o,value:r,children:n,full:i=!1,align:t="left"}=e;return(0,a.jsxs)(l.A,{sx:{gridColumn:i?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,a.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},26165:(e,o,r)=>{r.r(o),r.d(o,{default:()=>$});var n=r(9950),i=r(28429),t=r(36150),s=r(4159),l=r.n(s),c=r(41413),a=r(47223),d=r(2235),x=r(93230),h=r(82053),p=r(16491),u=r(60899),g=r(83274),f=r(25333),m=r(1320),b=r(15769),j=r(69780),A=r(9213),v=r(21671),w=r(34075),y=r(74745),S=r(6258),C=r(14857),k=r(31222),W=r(81425),z=r(52351),I=r(56311),R=r(96646),Y=r(23787),M=r(44414),T=r(36220);l().extend(T);const D=16,P="0 8px 24px rgba(15, 23, 42, 0.08)",L="#0f172a",F="#64748b",B="#94a3b8",H="#e2e8f0",N="#f1f5f9",E="#f8fafc",K=(e,o)=>"".concat(e).concat(o),G=e=>K(e,"08"),O=e=>K(e,"18"),U=e=>K(e,"26"),X=e=>K(e,"55"),q="#662582",_="#9255AB",V=e=>{let{color:o,selected:r,size:n=24,children:i}=e;return(0,M.jsx)(c.A,{sx:{width:n,height:n,bgcolor:r?o:O(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:i})},J={0:{key:"all",label:"All",color:q,icon:k.Uhn,countKey:"totalcount"},1:{key:"open",label:"Open",color:"#ef4444",icon:k.tX0,countKey:"pendingcount"},2:{key:"overdue",label:"Overdue",color:"#f59e0b",icon:k.tMO,countKey:"overduecount"},3:{key:"paid",label:"Paid",color:"#10b981",icon:k.mU9,countKey:"paidcount"}},Z=[0,1,2,3];function Q(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}const $=()=>{var e,o,r,s;const T=(0,i.Zp)(),K=(0,C.A)(),$=(0,a.A)(K.breakpoints.down("md")),[ee,oe]=(0,n.useState)(0),[re,ne]=(0,n.useState)(10),[ie,te]=(0,n.useState)(0),[se,le]=(0,n.useState)(!1),[ce,ae]=(0,n.useState)(""),[de,xe]=(0,n.useState)(""),he=n.useCallback((e=>{xe(e),oe(0)}),[]),{data:pe,isLoading:ue,isError:ge,error:fe}=(0,t.I)({queryKey:["invoiceInsight"],queryFn:W.Y8,refetchInterval:3e5}),{data:me,isLoading:be,isError:je,error:Ae}=(0,t.I)({queryKey:[ie],queryFn:W.XC,refetchInterval:3e5}),ve=ue||be,we=ge||je,ye=(null===fe||void 0===fe?void 0:fe.message)||(null===Ae||void 0===Ae?void 0:Ae.message),Se=(0,n.useMemo)((()=>{if(!me)return[];if(!de)return me;const e=de.toLowerCase().trim();return me.filter((o=>[o.tenantname,o.contactperson,String(o.invoiceno)].filter(Boolean).some((o=>String(o).toLowerCase().includes(e)))))}),[me,de]),Ce=(0,n.useMemo)((()=>{const e=Math.max(0,Math.ceil(Se.length/re)-1);return Math.min(ee,e)}),[Se.length,ee,re]);n.useEffect((()=>{ee!==Ce&&oe(Ce)}),[ee,Ce]);const ke=(0,n.useMemo)((()=>Se.slice(Ce*re,Ce*re+re)),[Se,Ce,re]),We=(0,n.useMemo)((()=>Se.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[Se]),ze=(0,n.useMemo)((()=>ke.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[ke]);if(we)return ye;const Ie=[{idx:0,label:"All Invoices",color:q,icon:k.Uhn,value:null!==(e=null===pe||void 0===pe?void 0:pe.totalcount)&&void 0!==e?e:0},{idx:1,label:"Open",color:"#ef4444",icon:k.tX0,value:null!==(o=null===pe||void 0===pe?void 0:pe.pendingcount)&&void 0!==o?o:0},{idx:2,label:"Overdue",color:"#f59e0b",icon:k.tMO,value:null!==(r=null===pe||void 0===pe?void 0:pe.overduecount)&&void 0!==r?r:0},{idx:3,label:"Paid",color:"#10b981",icon:k.mU9,value:null!==(s=null===pe||void 0===pe?void 0:pe.paidcount)&&void 0!==s?s:0}],Re=J[ie];return(0,M.jsxs)(M.Fragment,{children:[(se||ve)&&(0,M.jsx)(z.A,{}),(0,M.jsx)(d.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:D/8,border:"1px solid",borderColor:H,background:"linear-gradient(135deg, ".concat(G(q)," 0%, ").concat(G(_)," 100%)"),boxShadow:P},children:(0,M.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,M.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:q,color:"#fff",boxShadow:"0 6px 18px ".concat(U(q))},children:(0,M.jsx)(k.GdF,{size:22})}),(0,M.jsxs)(x.A,{children:[(0,M.jsx)(h.A,{variant:"h3",sx:{fontWeight:800,color:L,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Invoices"}),(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,M.jsx)(p.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,M.jsxs)(h.A,{variant:"caption",sx:{color:F,fontWeight:600},children:["Live \xb7 Viewing ",Re.label.toLowerCase()," invoices"]})]})]})]}),(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:1,px:1.5,py:.875,borderRadius:999,bgcolor:G(q),border:"1.5px solid ".concat(X(q)),color:q,fontWeight:800,fontSize:12},children:[(0,M.jsx)(k.YHz,{size:14}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,color:F,letterSpacing:.4,textTransform:"uppercase"},children:"Grand Total"}),(0,M.jsx)(h.A,{sx:{fontWeight:800,color:q,fontSize:13},children:Q(We)})]})]})}),(0,M.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ie.map((e=>{const o=e.icon,r=ie===e.idx;return(0,M.jsx)(u.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,M.jsxs)(d.A,{elevation:0,onClick:()=>{te(e.idx),oe(0)},sx:{position:"relative",overflow:"hidden",cursor:"pointer",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:D/8,border:"1px solid",borderColor:r?X(e.color):H,background:r?G(e.color):"#fff",boxShadow:r?"0 0 0 3px ".concat(U(e.color)):"none",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:P,borderColor:X(e.color)}},children:[(0,M.jsx)(p.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(O(e.color)," 100%)")}}),(0,M.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,M.jsxs)(x.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,M.jsx)(h.A,{sx:{fontWeight:800,color:L,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:e.value})]}),(0,M.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:O(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(X(e.color)),flexShrink:0},children:(0,M.jsx)(o,{size:20})})]})]})},e.idx)}))}),(0,M.jsx)(d.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:D/8,borderTopRightRadius:D/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:H,borderBottom:0,background:"#fff"},children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,M.jsx)(x.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:H,borderRadius:4}},children:Z.map((e=>{var o;const r=J[e],n=r.icon,i=ie===e,t=null!==(o=null===pe||void 0===pe?void 0:pe[r.countKey])&&void 0!==o?o:0;return(0,M.jsxs)(p.A,{onClick:()=>{te(e),oe(0)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(i?r.color:X(r.color)),bgcolor:i?r.color:G(r.color),color:i?"#fff":r.color,fontWeight:700,boxShadow:i?"0 6px 18px ".concat(U(r.color)):"none",transition:"all 0.18s","&:hover":{borderColor:r.color,boxShadow:i?"0 6px 18px ".concat(U(r.color)):"0 0 0 3px ".concat(U(r.color))}},children:[(0,M.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:i?"rgba(255,255,255,0.22)":O(r.color),color:i?"#fff":r.color},children:(0,M.jsx)(n,{size:13})}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,M.jsx)(p.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:i?"rgba(255,255,255,0.22)":"#fff",color:i?"#fff":r.color,border:i?"none":"1px solid ".concat(X(r.color))},children:t})]},e)}))}),(0,M.jsx)(p.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,M.jsx)(I.A,{value:ce,onChange:ae,onDebouncedChange:he,placeholder:"Search invoices (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:G(q),"& fieldset":{borderColor:X(q),borderWidth:1.5},"&:hover fieldset":{borderColor:q},"&.Mui-focused fieldset":{borderColor:q,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(U(q))}}})})]})}),(0,M.jsxs)(d.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:D/8,borderBottomRightRadius:D/8,border:"1px solid",borderColor:H,overflow:"hidden",background:"#fff"},children:[$?(0,M.jsx)(M.Fragment,{children:be?(0,M.jsx)(p.A,{sx:{p:1.5},children:(0,M.jsx)(R.r,{col:4})}):0===ke.length?(0,M.jsxs)(x.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,M.jsx)(c.A,{sx:{width:64,height:64,bgcolor:O("#94a3b8"),color:B},children:(0,M.jsx)(k.GdF,{size:28})}),(0,M.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:L},children:"No invoices to show"}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,textAlign:"center"},children:ce?"Try a different keyword.":"No ".concat(Re.label.toLowerCase()," invoices for this filter.")})]}):(0,M.jsx)(Y.nV,{children:ke.map(((e,o)=>{var r;const n=2===ie||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==ie;return(0,M.jsx)(Y.pg,{accent:q,header:(0,M.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,M.jsx)(V,{color:q,size:36,children:(0,M.jsx)(k.Itr,{size:18})}),(0,M.jsxs)(x.A,{spacing:.25,sx:{minWidth:0},children:[(0,M.jsx)(h.A,{variant:"subtitle2",sx:{fontWeight:700,color:L},noWrap:!0,children:e.tenantname||"\u2014"}),e.contactperson&&(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},noWrap:!0,children:e.contactperson})]})]}),(0,M.jsx)(g.A,{title:"Preview invoice",placement:"left",children:(0,M.jsx)(f.A,{size:"small",onClick:()=>{le(!0),setTimeout((()=>{le(!1),T("/nearle/invoice/preview",{state:e})}),500)},sx:{flexShrink:0,bgcolor:O(q),color:q,border:"1px solid ".concat(X(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:(0,M.jsx)(k.U3x,{size:16})})})]}),children:(0,M.jsxs)(Y.FG,{children:[(0,M.jsx)(Y.pY,{label:"Invoice ID",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,M.jsx)(k.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,M.jsx)(Y.pY,{label:"Amount",align:"right",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G(q),border:"1px solid ".concat(X(q)),color:q,fontSize:11,fontWeight:800,justifyContent:"center"},children:[(0,M.jsx)(k.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,M.jsx)(Y.pY,{label:"Invoice Date",children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:L},noWrap:!0,children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,M.jsx)(Y.pY,{label:"Due Date",children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:n&&3!==ie?"#ef4444":B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==ie?"#ef4444":L},noWrap:!0,children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,M.jsx)(Y.pY,{label:"Items",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:G("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,M.jsx)(k.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})})]})},e.invoiceno||o)}))})}):(0,M.jsx)(m.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:X(q),borderRadius:8,"&:hover":{backgroundColor:q}},"&::-webkit-scrollbar-track":{backgroundColor:E}},children:(0,M.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1060}},children:[(0,M.jsx)(j.A,{children:(0,M.jsxs)(A.A,{sx:{"& th":{backgroundColor:E,color:F,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(H),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,M.jsx)(v.A,{children:"#"}),(0,M.jsx)(v.A,{children:"Client"}),(0,M.jsx)(v.A,{children:"Invoice ID"}),(0,M.jsx)(v.A,{children:"Invoice Date"}),(0,M.jsx)(v.A,{children:"Due Date"}),(0,M.jsx)(v.A,{align:"center",children:"Items"}),(0,M.jsx)(v.A,{align:"right",children:"Amount"}),(0,M.jsx)(v.A,{align:"center",children:"Action"})]})}),(0,M.jsxs)(w.A,{children:[be&&(0,M.jsx)(R.r,{col:4}),be||0!==ke.length?ke.map(((e,o)=>{var r;const n=2===ie||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==ie;return(0,M.jsxs)(A.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(N),py:{xs:1,md:1.5},px:{xs:1,md:2},verticalAlign:"top"},"&:hover":{backgroundColor:E}},children:[(0,M.jsx)(v.A,{children:(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:B},children:String(Ce*re+o+1).padStart(2,"0")})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,M.jsx)(V,{color:q,size:36,children:(0,M.jsx)(k.Itr,{size:18})}),(0,M.jsxs)(x.A,{spacing:.25,sx:{minWidth:0},children:[(0,M.jsx)(h.A,{variant:"subtitle2",sx:{fontWeight:700,color:L,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"}),e.contactperson&&(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},children:e.contactperson})]})]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,M.jsx)(k.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{spacing:.25,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:L,whiteSpace:"nowrap"},children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,pl:2},children:e.transactiondate?l()(e.transactiondate).utc().format("hh:mm A"):""})]})}),(0,M.jsx)(v.A,{children:(0,M.jsxs)(x.A,{spacing:.25,children:[(0,M.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,M.jsx)(k.auT,{size:12,color:n&&3!==ie?"#ef4444":B}),(0,M.jsx)(h.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==ie?"#ef4444":L,whiteSpace:"nowrap"},children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F,pl:2},children:e.duedate?l()(e.duedate).utc().format("hh:mm A"):""})]})}),(0,M.jsx)(v.A,{align:"center",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:G("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,M.jsx)(k.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})}),(0,M.jsx)(v.A,{align:"right",children:(0,M.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:G(q),border:"1px solid ".concat(X(q)),color:q,fontSize:11,fontWeight:800,minWidth:110,justifyContent:"center"},children:[(0,M.jsx)(k.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,M.jsx)(v.A,{align:"center",children:(0,M.jsx)(g.A,{title:"Preview invoice",placement:"left",children:(0,M.jsx)(f.A,{size:"small",onClick:()=>{le(!0),setTimeout((()=>{le(!1),T("/nearle/invoice/preview",{state:e})}),500)},sx:{bgcolor:O(q),color:q,border:"1px solid ".concat(X(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:(0,M.jsx)(k.U3x,{size:16})})})})]},e.invoiceno||o)})):(0,M.jsx)(A.A,{children:(0,M.jsx)(v.A,{colSpan:8,sx:{py:6},children:(0,M.jsxs)(x.A,{alignItems:"center",spacing:1.5,children:[(0,M.jsx)(c.A,{sx:{width:64,height:64,bgcolor:O("#94a3b8"),color:B},children:(0,M.jsx)(k.GdF,{size:28})}),(0,M.jsx)(h.A,{variant:"subtitle1",sx:{fontWeight:700,color:L},children:"No invoices to show"}),(0,M.jsx)(h.A,{variant:"caption",sx:{color:F},children:ce?"Try a different keyword.":"No ".concat(Re.label.toLowerCase()," invoices for this filter.")})]})})})]})]})}),(0,M.jsx)(y.A,{}),(0,M.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",sx:{px:2,py:1,background:"linear-gradient(135deg, ".concat(G(q)," 0%, ").concat(G(_)," 100%)")},children:[(0,M.jsxs)(h.A,{variant:"caption",sx:{fontWeight:800,color:F,letterSpacing:.6,textTransform:"uppercase"},children:["Page total \xb7 ",Q(ze)]}),(0,M.jsx)(S.A,{rowsPerPageOptions:[5,10,25,100],component:"div",count:Se.length,rowsPerPage:re,page:Ce,onPageChange:(e,o)=>oe(o),onRowsPerPageChange:e=>{var o;ne(+(null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.value)),oe(0)},sx:{"& .MuiTablePagination-toolbar":{minHeight:40,px:0},"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{fontWeight:700,color:F}}})]})]}),(0,M.jsx)(i.sv,{})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>p});var n=r(89379),i=r(9950),t=r(2660),s=r(2046),l=r(83274),c=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const p=e=>{let{value:o,onChange:r,onDebouncedChange:p,debounceTime:u=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const m=(0,i.useRef)(null),[b]=(0,x.d7)(o,u);return(0,i.useEffect)((()=>{p&&p(b)}),[b,p]),(0,i.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=m.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(t.A,{sx:(0,n.A)({},f),inputRef:m,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},96646:(e,o,r)=>{r.d(o,{r:()=>c});var n=r(9213),i=r(21671),t=r(82917),s=r(93230),l=r(44414);const c=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,l.jsx)(i.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(t.A,{variant:"text",width:100}),(0,l.jsx)(t.A,{variant:"text",width:80})]})},o))),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:150})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(i.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(t.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(t.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/6165.f270c746.chunk.js b/build/static/js/6165.f270c746.chunk.js deleted file mode 100644 index 0779dd5..0000000 --- a/build/static/js/6165.f270c746.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6165],{26165:(e,o,r)=>{r.r(o),r.d(o,{default:()=>V});var n=r(9950),t=r(28429),i=r(36150),s=r(4159),c=r.n(s),l=r(41413),a=r(2235),d=r(93230),x=r(82053),h=r(16491),u=r(60899),g=r(1320),p=r(15769),m=r(69780),f=r(9213),b=r(21671),j=r(34075),A=r(83274),v=r(25333),w=r(74745),y=r(6258),k=r(31222),C=r(81425),S=r(52351),I=r(56311),W=r(96646),R=r(44414),z=r(36220);c().extend(z);const M=16,T="0 8px 24px rgba(15, 23, 42, 0.08)",P="#0f172a",L="#64748b",D="#94a3b8",Y="#e2e8f0",B="#f1f5f9",E="#f8fafc",F=(e,o)=>"".concat(e).concat(o),K=e=>F(e,"08"),H=e=>F(e,"18"),N=e=>F(e,"26"),O=e=>F(e,"55"),U="#662582",q="#9255AB",G=e=>{let{color:o,selected:r,size:n=24,children:t}=e;return(0,R.jsx)(l.A,{sx:{width:n,height:n,bgcolor:r?o:H(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:t})},X={0:{key:"all",label:"All",color:U,icon:k.Uhn,countKey:"totalcount"},1:{key:"open",label:"Open",color:"#ef4444",icon:k.tX0,countKey:"pendingcount"},2:{key:"overdue",label:"Overdue",color:"#f59e0b",icon:k.tMO,countKey:"overduecount"},3:{key:"paid",label:"Paid",color:"#10b981",icon:k.mU9,countKey:"paidcount"}},_=[0,1,2,3];function J(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}const V=()=>{var e,o,r,s;const z=(0,t.Zp)(),[F,V]=(0,n.useState)(0),[Z,Q]=(0,n.useState)(10),[$,ee]=(0,n.useState)(0),[oe,re]=(0,n.useState)(!1),[ne,te]=(0,n.useState)(""),[ie,se]=(0,n.useState)(""),ce=n.useCallback((e=>{se(e),V(0)}),[]),{data:le,isLoading:ae,isError:de,error:xe}=(0,i.I)({queryKey:["invoiceInsight"],queryFn:C.Y8,refetchInterval:3e5}),{data:he,isLoading:ue,isError:ge,error:pe}=(0,i.I)({queryKey:[$],queryFn:C.XC,refetchInterval:3e5}),me=ae||ue,fe=de||ge,be=(null===xe||void 0===xe?void 0:xe.message)||(null===pe||void 0===pe?void 0:pe.message),je=(0,n.useMemo)((()=>{if(!he)return[];if(!ie)return he;const e=ie.toLowerCase().trim();return he.filter((o=>[o.tenantname,o.contactperson,String(o.invoiceno)].filter(Boolean).some((o=>String(o).toLowerCase().includes(e)))))}),[he,ie]),Ae=(0,n.useMemo)((()=>{const e=Math.max(0,Math.ceil(je.length/Z)-1);return Math.min(F,e)}),[je.length,F,Z]);n.useEffect((()=>{F!==Ae&&V(Ae)}),[F,Ae]);const ve=(0,n.useMemo)((()=>je.slice(Ae*Z,Ae*Z+Z)),[je,Ae,Z]),we=(0,n.useMemo)((()=>je.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[je]),ye=(0,n.useMemo)((()=>ve.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[ve]);if(fe)return be;const ke=[{idx:0,label:"All Invoices",color:U,icon:k.Uhn,value:null!==(e=null===le||void 0===le?void 0:le.totalcount)&&void 0!==e?e:0},{idx:1,label:"Open",color:"#ef4444",icon:k.tX0,value:null!==(o=null===le||void 0===le?void 0:le.pendingcount)&&void 0!==o?o:0},{idx:2,label:"Overdue",color:"#f59e0b",icon:k.tMO,value:null!==(r=null===le||void 0===le?void 0:le.overduecount)&&void 0!==r?r:0},{idx:3,label:"Paid",color:"#10b981",icon:k.mU9,value:null!==(s=null===le||void 0===le?void 0:le.paidcount)&&void 0!==s?s:0}],Ce=X[$];return(0,R.jsxs)(R.Fragment,{children:[(oe||me)&&(0,R.jsx)(S.A,{}),(0,R.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:M/8,border:"1px solid",borderColor:Y,background:"linear-gradient(135deg, ".concat(K(U)," 0%, ").concat(K(q)," 100%)"),boxShadow:T},children:(0,R.jsxs)(d.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,R.jsx)(l.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:U,color:"#fff",boxShadow:"0 6px 18px ".concat(N(U))},children:(0,R.jsx)(k.GdF,{size:22})}),(0,R.jsxs)(d.A,{children:[(0,R.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:P,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Invoices"}),(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,R.jsx)(h.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,R.jsxs)(x.A,{variant:"caption",sx:{color:L,fontWeight:600},children:["Live \xb7 Viewing ",Ce.label.toLowerCase()," invoices"]})]})]})]}),(0,R.jsxs)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:1,px:1.5,py:.875,borderRadius:999,bgcolor:K(U),border:"1.5px solid ".concat(O(U)),color:U,fontWeight:800,fontSize:12},children:[(0,R.jsx)(k.YHz,{size:14}),(0,R.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:L,letterSpacing:.4,textTransform:"uppercase"},children:"Grand Total"}),(0,R.jsx)(x.A,{sx:{fontWeight:800,color:U,fontSize:13},children:J(we)})]})]})}),(0,R.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:ke.map((e=>{const o=e.icon,r=$===e.idx;return(0,R.jsx)(u.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,R.jsxs)(a.A,{elevation:0,onClick:()=>{ee(e.idx),V(0)},sx:{position:"relative",overflow:"hidden",cursor:"pointer",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:M/8,border:"1px solid",borderColor:r?O(e.color):Y,background:r?K(e.color):"#fff",boxShadow:r?"0 0 0 3px ".concat(N(e.color)):"none",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:T,borderColor:O(e.color)}},children:[(0,R.jsx)(h.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(H(e.color)," 100%)")}}),(0,R.jsxs)(d.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,R.jsxs)(d.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,R.jsx)(x.A,{variant:"caption",sx:{color:L,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,R.jsx)(x.A,{sx:{fontWeight:800,color:P,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:e.value})]}),(0,R.jsx)(l.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:H(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(O(e.color)),flexShrink:0},children:(0,R.jsx)(o,{size:20})})]})]})},e.idx)}))}),(0,R.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:M/8,borderTopRightRadius:M/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:Y,borderBottom:0,background:"#fff"},children:(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,R.jsx)(d.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:Y,borderRadius:4}},children:_.map((e=>{var o;const r=X[e],n=r.icon,t=$===e,i=null!==(o=null===le||void 0===le?void 0:le[r.countKey])&&void 0!==o?o:0;return(0,R.jsxs)(h.A,{onClick:()=>{ee(e),V(0)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(t?r.color:O(r.color)),bgcolor:t?r.color:K(r.color),color:t?"#fff":r.color,fontWeight:700,boxShadow:t?"0 6px 18px ".concat(N(r.color)):"none",transition:"all 0.18s","&:hover":{borderColor:r.color,boxShadow:t?"0 6px 18px ".concat(N(r.color)):"0 0 0 3px ".concat(N(r.color))}},children:[(0,R.jsx)(l.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:t?"rgba(255,255,255,0.22)":H(r.color),color:t?"#fff":r.color},children:(0,R.jsx)(n,{size:13})}),(0,R.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,R.jsx)(h.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:t?"rgba(255,255,255,0.22)":"#fff",color:t?"#fff":r.color,border:t?"none":"1px solid ".concat(O(r.color))},children:i})]},e)}))}),(0,R.jsx)(h.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,R.jsx)(I.A,{value:ne,onChange:te,onDebouncedChange:ce,placeholder:"Search invoices (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:K(U),"& fieldset":{borderColor:O(U),borderWidth:1.5},"&:hover fieldset":{borderColor:U},"&.Mui-focused fieldset":{borderColor:U,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(N(U))}}})})]})}),(0,R.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:M/8,borderBottomRightRadius:M/8,border:"1px solid",borderColor:Y,overflow:"hidden",background:"#fff"},children:[(0,R.jsx)(g.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:O(U),borderRadius:8,"&:hover":{backgroundColor:U}},"&::-webkit-scrollbar-track":{backgroundColor:E}},children:(0,R.jsxs)(p.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1060}},children:[(0,R.jsx)(m.A,{children:(0,R.jsxs)(f.A,{sx:{"& th":{backgroundColor:E,color:L,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Y),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,R.jsx)(b.A,{children:"#"}),(0,R.jsx)(b.A,{children:"Client"}),(0,R.jsx)(b.A,{children:"Invoice ID"}),(0,R.jsx)(b.A,{children:"Invoice Date"}),(0,R.jsx)(b.A,{children:"Due Date"}),(0,R.jsx)(b.A,{align:"center",children:"Items"}),(0,R.jsx)(b.A,{align:"right",children:"Amount"}),(0,R.jsx)(b.A,{align:"center",children:"Action"})]})}),(0,R.jsxs)(j.A,{children:[ue&&(0,R.jsx)(W.r,{col:4}),ue||0!==ve.length?ve.map(((e,o)=>{var r;const n=2===$||e.duedate&&c()(e.duedate).isBefore(c()(),"day")&&3!==$;return(0,R.jsxs)(f.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(B),py:{xs:1,md:1.5},px:{xs:1,md:2},verticalAlign:"top"},"&:hover":{backgroundColor:E}},children:[(0,R.jsx)(b.A,{children:(0,R.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:D},children:String(Ae*Z+o+1).padStart(2,"0")})}),(0,R.jsx)(b.A,{children:(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,R.jsx)(G,{color:U,size:36,children:(0,R.jsx)(k.Itr,{size:18})}),(0,R.jsxs)(d.A,{spacing:.25,sx:{minWidth:0},children:[(0,R.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:P,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"}),e.contactperson&&(0,R.jsx)(x.A,{variant:"caption",sx:{color:L},children:e.contactperson})]})]})}),(0,R.jsx)(b.A,{children:(0,R.jsxs)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:K("#0ea5e9"),border:"1px solid ".concat(O("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,R.jsx)(k.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,R.jsx)(b.A,{children:(0,R.jsxs)(d.A,{spacing:.25,children:[(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,R.jsx)(k.auT,{size:12,color:D}),(0,R.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:P,whiteSpace:"nowrap"},children:e.transactiondate?c()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]}),(0,R.jsx)(x.A,{variant:"caption",sx:{color:L,pl:2},children:e.transactiondate?c()(e.transactiondate).utc().format("hh:mm A"):""})]})}),(0,R.jsx)(b.A,{children:(0,R.jsxs)(d.A,{spacing:.25,children:[(0,R.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,R.jsx)(k.auT,{size:12,color:n&&3!==$?"#ef4444":D}),(0,R.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==$?"#ef4444":P,whiteSpace:"nowrap"},children:e.duedate?c()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]}),(0,R.jsx)(x.A,{variant:"caption",sx:{color:L,pl:2},children:e.duedate?c()(e.duedate).utc().format("hh:mm A"):""})]})}),(0,R.jsx)(b.A,{align:"center",children:(0,R.jsxs)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:K("#14b8a6"),border:"1px solid ".concat(O("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,R.jsx)(k.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})}),(0,R.jsx)(b.A,{align:"right",children:(0,R.jsxs)(h.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:K(U),border:"1px solid ".concat(O(U)),color:U,fontSize:11,fontWeight:800,minWidth:110,justifyContent:"center"},children:[(0,R.jsx)(k.YHz,{size:11}),J(e.totalamount).replace("\u20b9","").trim()]})}),(0,R.jsx)(b.A,{align:"center",children:(0,R.jsx)(A.A,{title:"Preview invoice",placement:"left",children:(0,R.jsx)(v.A,{size:"small",onClick:()=>{re(!0),setTimeout((()=>{re(!1),z("/nearle/invoice/preview",{state:e})}),500)},sx:{bgcolor:H(U),color:U,border:"1px solid ".concat(O(U)),"&:hover":{bgcolor:U,color:"#fff"}},children:(0,R.jsx)(k.U3x,{size:16})})})})]},e.invoiceno||o)})):(0,R.jsx)(f.A,{children:(0,R.jsx)(b.A,{colSpan:8,sx:{py:6},children:(0,R.jsxs)(d.A,{alignItems:"center",spacing:1.5,children:[(0,R.jsx)(l.A,{sx:{width:64,height:64,bgcolor:H("#94a3b8"),color:D},children:(0,R.jsx)(k.GdF,{size:28})}),(0,R.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:P},children:"No invoices to show"}),(0,R.jsx)(x.A,{variant:"caption",sx:{color:L},children:ne?"Try a different keyword.":"No ".concat(Ce.label.toLowerCase()," invoices for this filter.")})]})})})]})]})}),(0,R.jsx)(w.A,{}),(0,R.jsxs)(d.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",sx:{px:2,py:1,background:"linear-gradient(135deg, ".concat(K(U)," 0%, ").concat(K(q)," 100%)")},children:[(0,R.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:L,letterSpacing:.6,textTransform:"uppercase"},children:["Page total \xb7 ",J(ye)]}),(0,R.jsx)(y.A,{rowsPerPageOptions:[5,10,25,100],component:"div",count:je.length,rowsPerPage:Z,page:Ae,onPageChange:(e,o)=>V(o),onRowsPerPageChange:e=>{var o;Q(+(null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.value)),V(0)},sx:{"& .MuiTablePagination-toolbar":{minHeight:40,px:0},"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{fontWeight:700,color:L}}})]})]}),(0,R.jsx)(t.sv,{})]})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var n=r(89379),t=r(9950),i=r(2660),s=r(2046),c=r(83274),l=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:g=500,placeholder:p="Search (ctrl+k)",sx:m}=e;const f=(0,t.useRef)(null),[b]=(0,x.d7)(o,g);return(0,t.useEffect)((()=>{u&&u(b)}),[b,u]),(0,t.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=f.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===f.current&&f.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,n.A)({},m),inputRef:f,placeholder:p,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(c.A,{title:"Clear",children:(0,h.jsx)(l.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},96646:(e,o,r)=>{r.d(o,{r:()=>l});var n=r(9213),t=r(21671),i=r(82917),s=r(93230),c=r(44414);const l=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,c.jsx)(c.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,c.jsxs)(n.A,{children:[(0,c.jsx)(t.A,{children:(0,c.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,c.jsx)(t.A,{children:(0,c.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,c.jsx)(t.A,{children:(0,c.jsxs)(s.A,{spacing:.5,children:[(0,c.jsx)(i.A,{variant:"text",width:100}),(0,c.jsx)(i.A,{variant:"text",width:80})]})},o))),(0,c.jsx)(t.A,{children:(0,c.jsx)(i.A,{variant:"text",width:150})}),(0,c.jsx)(t.A,{children:(0,c.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,c.jsx)(t.A,{align:"center",children:(0,c.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,c.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,c.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); \ No newline at end of file diff --git a/build/static/js/6248.bf8f395b.chunk.js b/build/static/js/6248.bf8f395b.chunk.js deleted file mode 100644 index 39ca4c9..0000000 --- a/build/static/js/6248.bf8f395b.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6248],{66248:(e,s,i)=>{i.r(s),i.d(s,{default:()=>ae});var n=i(89379),t=i(9950),r=i(46702),a=i(28429),o=i(26910),l=i(63189),c=i(19474),d=i(58833),h=i(53067),x=i(62824),A=i(52329),j=i(36256),m=i(32653),g=i(96583),p=i(28170),u=i(93230),f=i(41413),v=i(60899),y=i(25277),b=i(65429),w=i(92743),Y=i(36080),S=i(82053),C=i(29925),D=i(82223),z=i(40033),k=i(48159),M=i(84142),I=i(46639),F=i(1320),H=i(15769),T=i(69780),O=i(9213),E=i(21671),_=i(34075),R=i(93038),N=i(83274),U=i(25333),L=i(79739),P=i(25713),W=i(82917),q=i(25979),B=i(33738),K=i(74745),$=i(37476),G=i(72179),Z=i(50027),J=i(52351),Q=i(4159),V=i.n(Q),X=i(14857),ee=i(46585),se=i(94118),ie=i(97973),ne=i(8881),te=i(44414),re=i(36220);V().extend(re);const ae=()=>{const[e,s]=(0,t.useState)([]),[i,Q]=(0,t.useState)(!0),re=(0,a.zy)(),[ae,oe]=(0,t.useState)(""),[le,ce]=(0,t.useState)(""),[de,he]=(0,t.useState)(""),[xe,Ae]=(0,t.useState)(""),[je,me]=(0,t.useState)(!1),[ge,pe]=(0,t.useState)(""),[ue,fe]=(0,t.useState)(""),[ve,ye]=(0,t.useState)(!1),[be,we]=(0,t.useState)(""),[Ye]=(0,t.useState)(""),[Se,Ce]=(0,t.useState)(""),[De,ze]=(0,t.useState)(""),[ke,Me]=(0,t.useState)(""),[Ie,Fe]=(0,t.useState)(""),[He,Te]=(0,t.useState)([]),[Oe,Ee]=(0,t.useState)(""),[_e,Re]=(0,t.useState)(""),[Ne,Ue]=(0,t.useState)([]),[Le,Pe]=(0,t.useState)([]),[We,qe]=(0,t.useState)(""),[Be,Ke]=(0,t.useState)(""),[$e]=(0,t.useState)(""),[Ge]=(0,t.useState)(""),[Ze,Je]=(0,t.useState)(""),[Qe,Ve]=(0,t.useState)([]),[Xe,es]=(0,t.useState)({shifts:0,assigned:0,remaining:0,shiftid:0,price:0}),[ss,is]=(0,t.useState)(0),{state:ns}=(0,a.zy)(),[ts,rs]=(0,t.useState)(""),as=(0,a.Zp)(),[os,ls]=(0,t.useState)(["",""]),[cs,ds]=(0,t.useState)(""),[hs,xs]=(0,t.useState)(!1);(0,t.useEffect)((()=>{console.log("categoryarr"),console.log(e,le,Ie,$e,Ge)}),[Qe]),(0,t.useEffect)((()=>{ns&&(qe(ns.orderheaderid),Ke(ns.tenantid)),console.log(ns),console.log(Date.now())}),[]),(0,t.useEffect)((()=>{ns&&(qe(ns.orderheaderid),Ke(ns.tenantid)),console.log(ns),console.log(Date.now())}),[ns.orderheaderid,ns.tenantid]);const As=(0,X.A)(),js=async()=>{Q(!0),await o.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getordersbystatus?tenantid=").concat(Be)).then((e=>{console.log(e);let s=e.data.Details.find((e=>e.orderheaderid==We));console.log("result"),console.log(s),Te(s.orderaddons),Fe(s.venuetype),Ee(s.remarks),ds(s.startdate),pe(s.tenantname),ce(""),fe(s.tenantaddress),Ae(s.eventname),he(V()(s.orderdate).format("MM/DD/YYYY")||""),oe(s.orderid),we(s.orderstatus),Ce(s.taxamount),ze(s.orderamount),Me(s.ordervalue),Re(V()(s.cancelled).format("MM/DD/YYYY")||""),Je(s.pending),Q(!1)})).catch((e=>{console.log(e),Q(!1)}))},ms=async()=>{Q(!0),await o.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderdetails?orderheaderid=").concat(We)).then((e=>{console.log("res"),console.log(e),s(e.data.Details||[]),console.log("categoryarr"),Ve(e.data.Details),console.log(e.data.Details),Q(!1)})).catch((e=>{console.log(e),Q(!1)}))},gs=e=>{let s;console.log(e);let i=[e.userfcmtoken],n=[{notificationid:0,notificationdate:V()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Un-Asigned",message:"".concat(e.firstname," has been Un-assigned to the order ").concat(ae),configid:2,tenantid:Be,orderheaderid:We,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:ae,success:0,orderstatus:"assigned",processing:V()().format("YYYY-MM-DD HH:mm:ss"),notifytype:2,notifyreason:"Staff Un-Assigned"}];s={Title:"Staff Un-Asigned",message:"A Staff has been Un-assigned to the order ".concat(ae),tenantid:Be,orderheaderid:We,orderid:ae,configid:2};let t={notifications:n,fcmmodel:{priority:"high",registration_ids:i,data:s,notification:{body:"An order has been Un-assigned ".concat(ae),title:"Legendary",sound:"ring",content_available:!0,click_action:"FLUTTER_NOTIFICATION_CLICK"}}};console.log("grpnotifyobj unassign"),console.log(t),us(t)};(0,t.useEffect)((()=>{console.log(We),We&&Be?(js(),ms(),fs(),console.log(re.state||"")):Q(!1),console.log(We,Be)}),[We,Be,ts]);const ps=()=>{ye(!1),Pe([]),ls(["",""])};(0,t.useEffect)((()=>{console.log(Xe)}));const us=async e=>{console.log(e),await o.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/sendall"),e,{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),e.data.status&&((0,ne.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),js())})).catch((e=>{console.log(e)}))},fs=async()=>{await o.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderstatuscount?orderheaderid=").concat(We)).then((e=>{e.data.status?(console.log(e),rs(e.data.pendingcount),js()):(rs(e.data.pendingcount),js())})).catch((e=>{console.log(e)}))};function vs(e){let{open:s,handleClose:i}=e;const[n,r]=(0,t.useState)("");return(0,te.jsx)(g.A,{open:s,onClose:()=>i(!1),maxWidth:"xs",children:(0,te.jsx)(p.A,{sx:{mt:2,my:1},children:(0,te.jsxs)(u.A,{alignItems:"center",spacing:3.5,children:[(0,te.jsx)(f.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,te.jsx)(j.A,{})}),(0,te.jsx)(v.Ay,{children:(0,te.jsx)(y.A,{label:ae.slice(4),variant:"combined",color:"warning",size:"small"})}),(0,te.jsxs)(u.A,{spacing:2,children:[hs&&(0,te.jsxs)(b.A,{color:"warning",variant:"border",icon:(0,te.jsx)(ee.A,{}),children:[(0,te.jsx)(w.A,{children:"Order is within 24Hrs time frame. The order will be invoiced with standard pricing as agreed."}),(0,te.jsx)(Y.A,{href:"https://thelegendarystaff.com/",target:"_blank",children:"Terms & Condition link"})]}),(0,te.jsx)(S.A,{variant:"h4",align:"center",children:"Please type in the order number to confirm."}),(0,te.jsx)(C.A,{type:"text",onChange:e=>{console.log(e.target.value),r(e.target.value)},error:n!==ae.slice(4),value:n})]}),(0,te.jsxs)(u.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,te.jsx)(D.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{n===ae.slice(4)&&((async()=>{await o.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/cancel"),{orderheaderid:parseInt(We),orderstatus:"cancelled",cancelled:V()().format("YYYY-MM-DD HH:mm:ss"),unserviceable:hs?0:1}).then((e=>{console.log(e),e.data.status&&We&&Be&&(js(),ms())})).catch((e=>{console.log(e)}))})(),i(!0))},autoFocus:!0,children:"Yes, Cancel"}),(0,te.jsx)(D.A,{fullWidth:!0,onClick:()=>i(!1),color:"secondary",variant:"outlined",children:"No"})]})]})})})}return(0,te.jsxs)(te.Fragment,{children:[i&&(0,te.jsx)(J.A,{}),(0,te.jsx)(vs,{open:je,handleClose:()=>{me(!1)}}),(0,te.jsxs)(g.A,{maxWidth:!1,fullWidth:!0,open:ve,onClose:ps,scroll:"paper",TransitionComponent:$.s,children:[(0,te.jsxs)(z.A,{children:[(0,te.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,te.jsxs)(u.A,{direction:{sm:"row",xs:"column"},spacing:2,alignItems:"center",children:[(0,te.jsx)(S.A,{variant:"h3",children:"Assign Roles"}),(0,te.jsx)(y.A,{label:ge,variant:"light",color:"primary"})]}),(0,te.jsx)(y.A,{label:ae,variant:"combined",color:"warning",size:"large"})]}),(0,te.jsxs)(v.Ay,{container:!0,sx:{p:1},spacing:2,children:[(0,te.jsx)(v.Ay,{item:!0,sm:6,xs:12,children:(0,te.jsx)(k.A,{value:ss,onChange:()=>is((e=>0===e?1:0)),variant:"scrollable",scrollButtons:"auto",children:(0,te.jsx)(M.A,{label:Ye})})}),(0,te.jsx)(v.Ay,{item:!0,sm:6,xs:12,children:(0,te.jsxs)(u.A,{direction:"row",justifyContent:{xs:"flex-start",sm:"flex-end"},sx:{height:"100%"},spacing:2,children:[(0,te.jsx)(y.A,{sx:{width:"130px"},label:"Required:".concat(Xe.shifts),variant:"combined",color:"primary",size:"normal"}),(0,te.jsx)(y.A,{sx:{width:"130px"},label:"Assigned: ".concat(Xe.assigned),variant:"combined",color:"success",size:"normal"}),(0,te.jsx)(y.A,{sx:{width:"130px"},label:"Remaining: ".concat(Xe.remaining),variant:"combined",color:"error",size:"normal"})]})})]})]}),(0,te.jsx)(p.A,{dividers:!0,children:0===Ne.length?(0,te.jsx)(te.Fragment,{children:i?(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(u.A,{alignItems:"center",children:(0,te.jsx)(I.A,{})})}):(0,te.jsx)(S.A,{children:"No Staffs Available"})}):(0,te.jsx)(F.A,{children:(0,te.jsxs)(H.A,{children:[(0,te.jsx)(T.A,{children:(0,te.jsxs)(O.A,{children:[(0,te.jsx)(E.A,{children:"#"}),(0,te.jsx)(E.A,{children:"Staff"}),(0,te.jsx)(E.A,{children:"Category"}),(0,te.jsx)(E.A,{children:"Price"}),(0,te.jsx)(E.A,{children:"Experience"}),(0,te.jsx)(E.A,{children:"Level"}),(0,te.jsx)(E.A,{children:"City"}),(0,te.jsx)(E.A,{children:"Action"}),(0,te.jsx)(E.A,{})]})}),(0,te.jsx)(_.A,{children:Ne.map(((e,s)=>(0,te.jsx)(t.Fragment,{children:(0,te.jsxs)(O.A,{sx:{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5":"",":hover":{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5 !important":""}},children:[(0,te.jsx)(E.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,te.jsx)(E.A,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,te.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,te.jsx)(f.A,{alt:"",size:"sm",src:"",sx:{width:"25px",height:"25px"}}),(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"caption",children:e.firstname}),(0,te.jsx)(S.A,{variant:"caption",color:"textSecondary",children:e.contactno})]})]})}),(0,te.jsx)(E.A,{align:"left",children:(0,te.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,te.jsx)(S.A,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,te.jsx)(y.A,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,te.jsx)(E.A,{children:e.rolecost}),(0,te.jsxs)(E.A,{align:"left",children:[e.experience," Years"]}),(0,te.jsx)(E.A,{align:"left",children:(0,te.jsx)(y.A,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,te.jsx)(E.A,{align:"left",children:e.city}),(0,te.jsx)(E.A,{align:"left",children:e.orderdetailid!==orderdetailid?(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(R.A,{disabled:0!==e.orderdetailid,checked:!!Le.find((s=>s.userid==e.userid)),onClick:s=>{if(console.log(Xe),Xe.remaining>=0){if(s.target.checked&&0!=Xe.remaining){let s=Le;s.push({userid:e.userid,orderdetailid:orderdetailid,productid:productid,shiftid:Xe.shiftid,userrate:Xe.price,productrate:e.rolecost,firstname:e.firstname}),Pe([...s]);let i=Xe;i.assigned++,i.remaining=i.shifts-i.assigned,es((0,n.A)({},i))}else if(Xe.assigned!=Xe.shifts||0===Xe.remaining&&!s.target.checked){let s=Le,i=s.findIndex((s=>s.userid===e.userid));s.splice(i,1),Pe([...s]);let t=Xe;t.assigned--,t.remaining=t.shifts-t.assigned,es((0,n.A)({},t))}console.log(Le)}}})}):(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(y.A,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,te.jsx)(N.A,{title:"Unassign",children:(0,te.jsx)(U.A,{color:"error",onClick:()=>{console.log(e),(async e=>{let s={orderheaderid:We,orderprocessid:e.orderprocessid,orderdetailid:e.orderdetailid,orderstatus:"pending",pending:V()().format("YYYY-MM-DD HH:mm:ss"),status:1};console.log(s),await o.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/updateprocessstatus"),s).then((s=>{console.log(s),"Successful"===s.data.message&&((0,ne.M8)("Role unassigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Xe.assigned>Xe.shifts&&gs(e),js(),ms(),me(!1),fs(),ps(),setTimeout((()=>{fs()}),2e3))})).catch((e=>{console.log(e)}))})(e)},children:(0,te.jsx)(se.A,{})})}),(0,te.jsx)(N.A,{title:"Send Notification",children:(0,te.jsx)(U.A,{color:"info",onClick:()=>{console.log(e),(async e=>{let s=e.userfcmtoken,i={notificationid:0,notificationdate:V()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(ae),configid:2,tenantid:Be,orderheaderid:We,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:ae,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK"};console.log(i,s),await o.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/send"),{priority:"high",registration_ids:[s],data:i,notification:{body:"A Staff has been assigned to ".concat(ae),title:"Legendary",sound:"ring",content_available:!0}},{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),(0,ne.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})})).catch((e=>{console.log(e)}))})(e)},children:(0,te.jsx)(m.A,{})})})]})}),(0,te.jsx)(E.A,{children:e.orderid&&(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(y.A,{label:e.orderid,color:"warning",size:"small",variant:"light"})})})]})},s)))})]})})}),(0,te.jsx)(L.A,{children:(0,te.jsxs)(u.A,{sx:{mt:2},direction:"row",justifyContent:"flex-end",spacing:5,children:[Ne.length>0&&(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(D.A,{sx:{width:"130px"},variant:"contained",onClick:async()=>{let e=[],s=[];Le.map((i=>{e.push({orderprocessid:0,processdate:V()().format("YYYY-MM-DD HH:mm:ss"),tenantid:Be,orderheaderid:We,orderdetailid:i.orderdetailid,productid:i.productid,userid:i.userid,orderstatus:"pending",pending:"".concat(V()(Ze).format("YYYY-MM-DD")," ").concat(V()(Ze).format("HH:mm:ss")),starttime:"".concat(V()($e).format("YYYY-MM-DD")," ").concat(V()($e).format("HH:mm:ss")),endtime:"".concat(V()(Ge).format("YYYY-MM-DD")," ").concat(V()(Ge).format("HH:mm:ss")),appuserid:parseInt(localStorage.getItem("appuserid")),shiftid:i.shiftid,userrate:i.userrate,productrate:i.productrate}),Le.map((e=>{s.push({notificationid:0,notificationdate:V()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(ae),configid:2,tenantid:Be,orderheaderid:We,orderprocessid:0,shiftid:e.shiftid,userid:e.userid,orderid:ae,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK",firstname:e.firstname})}))})),console.log("arr"),console.log(e),await o.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorderprocess"),e).then((e=>{console.log(e),"Successfully created"===e.data.message&&((0,ne.M8)("Roles assigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ye(!1),ms(),fs())})).catch((e=>{console.log(e)})),console.log(e)},children:"OK"}),(0,te.jsx)(D.A,{sx:{width:"130px"},color:"warning",variant:"contained",onClick:()=>{Pe([]);let e=Xe;e.remaining=e.shifts,e.assigned=0,es(e)},children:"clear"})]}),(0,te.jsx)(D.A,{sx:{width:"130px"},color:"error",variant:"contained",onClick:()=>{ps()},children:"Close"})]})})]}),(0,te.jsxs)(v.Ay,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,te.jsx)(P.A,{sx:{position:"sticky",top:"60px",bgcolor:As.palette.background.default,zIndex:1,width:"100%"},children:(0,te.jsx)(v.Ay,{item:!0,xs:12,children:(0,te.jsxs)(u.A,{direction:{md:"row",xs:"column"},justifyContent:"space-between",alignItems:"flex-end",sx:{width:"100%",p:1},children:[(0,te.jsxs)(u.A,{direction:"row",spacing:2,alignItems:"center",justifyContent:"flex-start",sx:{width:{xs:"100%",md:"0"}},children:[(0,te.jsx)(U.A,{onClick:()=>history.back(),children:(0,te.jsx)(l.A,{})}),(0,te.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,te.jsx)(S.A,{variant:"h3",children:"Details"}),(0,te.jsxs)(u.A,{direction:"row",spacing:1,children:[(0,te.jsx)(y.A,{label:""===ae?(0,te.jsx)(W.A,{sx:{width:"80px",bgcolor:"#fff9c4"},animation:"wave"}):ae,variant:"combined",color:"warning",size:"small"}),(0,te.jsx)(y.A,{label:""===de?(0,te.jsx)(W.A,{sx:{width:"80px",bgcolor:"#b3e5fc"},animation:"wave"}):de,variant:"combined",color:"primary",size:"small"}),"pending"===be&&(0,te.jsx)(y.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===be&&(0,te.jsx)(y.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===be&&(0,te.jsx)(y.A,{label:"Completed",color:"primary",size:"small"}),"processing"===be&&(0,te.jsx)(y.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===be&&(0,te.jsx)(y.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===be&&(0,te.jsx)(y.A,{label:"Confirmed",color:"success",size:"small"}),"active"===be&&(0,te.jsx)(y.A,{label:"Active",color:"info",size:"small"}),"closed"===be&&(0,te.jsx)(y.A,{label:"Closed",color:"info",size:"small"}),"modified"===be&&(0,te.jsx)(y.A,{label:"Modified",color:"secondary",size:"small",variant:"contained"})]})]})]}),(0,te.jsxs)(u.A,{direction:"row",spacing:2,sx:{mt:{md:0,xs:2}},children:[("pending"===be||"assigned"===be||"confirmed"===be||"modified"===be)&&(0,te.jsx)(N.A,{title:"Edit",children:(0,te.jsx)(D.A,{variant:"outlined",color:"info",sx:{borderRadius:"40px"},startIcon:(0,te.jsx)(r.A,{color:"info"}),onClick:e=>{e.stopPropagation(),V()(V()().format("MM-DD-YYYY")).isBefore(V()(V()(cs).format("MM-DD-YYYY")))?as("/editorder",{state:{orderheaderid:We,tenantid:Be}}):(0,ne.M8)("Order cannot be edited.\n Order date is not valid at this time",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:4e3,style:{whiteSpace:"pre-line"}})},children:"Edit Order"})}),"cancelled"!==be&&""!==be&&"completed"!==be&&"closed"!==be&&(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(D.A,{variant:"outlined",color:"error",onClick:()=>{console.log(V()(cs).diff(V()(),"m")/60),V()(cs).diff(V()(),"m")/60>24?(xs(!1),me(!0)):(xs(!0),me(!0))},sx:{borderRadius:"40px",mt:{xs:2,sm:0}},startIcon:(0,te.jsx)(G.A,{}),children:"Cancel Order"})}),"cancelled"===be&&(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(y.A,{label:"Order Cancelled on ".concat(_e),variant:"combined",color:"error"})})]})]})})}),(0,te.jsx)(v.Ay,{item:!0,xs:12,sx:{mt:-2},children:(0,te.jsx)(Z.A,{content:!1,width:"100%",children:(0,te.jsxs)(v.Ay,{container:!0,spacing:2.5,sx:{p:2.5},children:[(0,te.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,te.jsx)(Z.A,{sx:{height:"100%"},children:(0,te.jsxs)(u.A,{spacing:1,children:[(0,te.jsx)(S.A,{variant:"h5",children:"Client"}),(0,te.jsx)(S.A,{color:"secondary",children:""===ge?(0,te.jsx)(W.A,{sx:{width:"40%"},animation:"wave"}):ge}),(0,te.jsx)(q.A,{sx:{width:"100%"},children:(0,te.jsx)(S.A,{color:"secondary",children:""===ue?(0,te.jsx)(W.A,{sx:{width:"90%"},animation:"wave"}):ue})})]})})}),(0,te.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,te.jsx)(Z.A,{sx:{height:"100%"},children:(0,te.jsxs)(u.A,{spacing:1,children:[(0,te.jsx)(S.A,{variant:"h5",children:"Event"}),(0,te.jsx)(q.A,{sx:{width:"100%"},children:(0,te.jsx)(S.A,{color:"secondary",children:""===xe?(0,te.jsx)(W.A,{sx:{width:"40%"},animation:"wave"}):xe})})]})})}),Qe.map(((e,s)=>(0,te.jsx)(t.Fragment,{children:(0,te.jsx)(v.Ay,{item:!0,xs:12,children:(0,te.jsxs)(Z.A,{sx:{opacity:0==e.shiftstatus?"":"0.7"},children:[(0,te.jsxs)(u.A,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{md:"center",xs:"flex-start"},spacing:2,sx:{p:2},children:[(0,te.jsxs)(u.A,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{md:"center",xs:"flex-start"},children:[(0,te.jsxs)(S.A,{variant:"h5",children:["Shift ",s+1]}),(0,te.jsxs)(S.A,{color:"secondary",children:[(0,te.jsx)(c.A,{})," ","",e.locationaddress]}),1===e.shiftstatus&&(0,te.jsx)(y.A,{label:"Cancelled",color:"secondary"})]}),(0,te.jsx)(u.A,{direction:"row",spacing:1,children:e.ordercontacts.map((e=>(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(N.A,{title:e.contactname,children:(0,te.jsx)(f.A,{sx:{bgcolor:"#2196f3",width:30,height:30},alt:"A",children:e.contactname.charAt(0).toUpperCase()})})})))})]}),(0,te.jsx)(F.A,{children:(0,te.jsxs)(H.A,{children:[(0,te.jsx)(T.A,{children:(0,te.jsxs)(O.A,{children:[(0,te.jsx)(E.A,{children:"#"}),(0,te.jsx)(E.A,{children:"Role"}),(0,te.jsx)(E.A,{children:"Start Date"}),(0,te.jsx)(E.A,{children:"End Date"}),(0,te.jsx)(E.A,{children:"Unpaid break"}),(0,te.jsx)(E.A,{children:"Count"}),(0,te.jsx)(E.A,{children:"Assigned"}),(0,te.jsx)(E.A,{children:"Attire"}),(0,te.jsx)(E.A,{children:"Price"}),(0,te.jsx)(E.A,{children:"Amount"}),(0,te.jsx)(E.A,{children:"Action"})]})}),(0,te.jsxs)(_.A,{children:[0===e.orderdetails.length&&(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)(O.A,{children:[(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsxs)(E.A,{children:[(0,te.jsx)(W.A,{animation:"wave"}),(0,te.jsx)(W.A,{animation:"wave"})]}),(0,te.jsxs)(E.A,{children:[(0,te.jsx)(W.A,{animation:"wave"}),(0,te.jsx)(W.A,{animation:"wave"})]}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})}),(0,te.jsx)(E.A,{children:(0,te.jsx)(W.A,{animation:"wave"})})]})}),e.orderdetails.map(((e,n)=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsxs)(O.A,{sx:{"&:last-child td, &:last-child th":{border:0},opacity:0==e.status?"":"0.7"},children:[(0,te.jsx)(E.A,{children:n+1}),(0,te.jsx)(E.A,{children:e.productname}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"body1",children:V()(e.starttime).format("MM/DD/YYYY")}),(0,te.jsx)(S.A,{variant:"body2",children:V()(e.starttime).format("hh:mm A")})]})}),(0,te.jsxs)(E.A,{children:[" ",(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"body1",children:V()(e.endtime).format("MM/DD/YYYY")}),(0,te.jsx)(S.A,{variant:"body2",children:V()(e.endtime).format("hh:mm A")})]})]}),(0,te.jsx)(E.A,{children:e.unpaidbreak||0}),(0,te.jsx)(E.A,{align:"center",children:(0,te.jsx)(y.A,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,te.jsx)(E.A,{align:"center",children:(0,te.jsx)(y.A,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,te.jsx)(E.A,{width:"100px"}),(0,te.jsxs)(E.A,{children:["$",e.price]}),(0,te.jsxs)(E.A,{children:["$",e.landingamount]}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{direction:"row",children:[(0,te.jsx)(N.A,{title:"Expand",children:(0,te.jsx)(U.A,{"aria-label":"expand row",style:{color:As.palette.primary.main},onClick:()=>{Ue([]),ls(os[0]===s&&os[1]===n?["",""]:[s,n]),(async e=>{Q(!0);try{await o.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getassignedinfo?orderdetailid=").concat(e)).then((e=>{console.log(e),e.data.status&&Ue(e.data.Details),Q(!1)})).catch((e=>{console.log(e),Q(!1)}))}catch(s){console.log(s),Q(!1)}})(e.orderdetailid)},children:os[0]===s&&os[1]===n?(0,te.jsx)(x.A,{}):(0,te.jsx)(A.A,{})})}),"cancelled"===be&&(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(U.A,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,te.jsx)(d.A,{})})}),1===e.status&&(0,te.jsx)(N.A,{title:"Cancelled",children:(0,te.jsx)(U.A,{sx:{minWidth:"10px !important"},children:(0,te.jsx)(G.A,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,te.jsx)(N.A,{title:"Assigned count is greater than ordered count",children:(0,te.jsx)(U.A,{color:"warning",children:(0,te.jsx)(ie.A,{})})})]})})]},n+1),(0,te.jsx)(O.A,{sx:{p:2},children:(0,te.jsx)(E.A,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:11,sx:{width:"100%"},children:(0,te.jsx)(B.A,{in:os[0]===s&&os[1]===n,timeout:"auto",unmountOnExit:!0,children:(0,te.jsx)(Z.A,{sx:{width:"100%"},children:0===Ne.length?(0,te.jsx)(te.Fragment,{children:i?(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(u.A,{alignItems:"center",children:(0,te.jsx)(I.A,{})})}):(0,te.jsx)(te.Fragment,{children:(0,te.jsx)(u.A,{sx:{p:1},children:(0,te.jsx)(S.A,{children:"No Staffs has been Assigned"})})})}):(0,te.jsx)(F.A,{children:(0,te.jsxs)(H.A,{children:[(0,te.jsx)(T.A,{children:(0,te.jsxs)(O.A,{children:[(0,te.jsx)(E.A,{children:"#"}),(0,te.jsx)(E.A,{children:"Staff"}),(0,te.jsx)(E.A,{children:"Start Time"}),(0,te.jsx)(E.A,{children:"End Time"}),(0,te.jsx)(E.A,{children:"Pay Rate"}),(0,te.jsx)(E.A,{align:"center",children:"Clockin"}),(0,te.jsx)(E.A,{align:"center",children:"Clockout"}),(0,te.jsx)(E.A,{children:"Hours Worked"}),(0,te.jsx)(E.A,{children:"Status"})]})}),(0,te.jsx)(_.A,{children:Ne.map(((e,s)=>(0,te.jsx)(t.Fragment,{children:(0,te.jsxs)(O.A,{sx:{},children:[(0,te.jsx)(E.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,te.jsx)(E.A,{align:"left",children:(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"caption",children:e.staffname}),(0,te.jsx)(v.Ay,{children:(0,te.jsx)(y.A,{label:e.productname,color:"info",variant:"light",size:"small"})})]})}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"body2",children:V()(e.Starttime).format("MM/DD/YYYY")}),(0,te.jsx)(S.A,{variant:"caption",children:V()(e.Starttime).format("hh:mm A")})]})}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{direction:"column",children:[(0,te.jsx)(S.A,{variant:"body2",children:V()(e.Endtime).format("MM/DD/YYYY")}),(0,te.jsx)(S.A,{variant:"caption",children:V()(e.Endtime).format("hh:mm A")})]})}),(0,te.jsx)(E.A,{children:e.rolecost}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,te.jsx)(y.A,{label:e.clockin?V()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,te.jsx)(y.A,{label:e.clockin?V()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,te.jsx)(E.A,{children:(0,te.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,te.jsx)(y.A,{label:e.clockout?V()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,te.jsx)(y.A,{label:e.clockout?V()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,te.jsx)(E.A,{children:e.hoursworked}),(0,te.jsx)(E.A,{align:"left",children:(0,te.jsxs)(u.A,{direction:"row",children:["pending"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,te.jsx)(y.A,{label:"Closed",color:"info",size:"small"})]})})]})},s)))})]})})})})})})]})))]})]})})]})})},e.locationaddress))),(0,te.jsx)(v.Ay,{item:!0,xs:12,children:(0,te.jsx)(K.A,{sx:{borderWidth:1}})}),(0,te.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,te.jsx)(Z.A,{title:"Order Addons",sx:{height:"100%"},children:(0,te.jsx)(v.Ay,{container:!0,spacing:2,children:(He||[]).map((e=>(0,te.jsx)(t.Fragment,{children:(0,te.jsx)(v.Ay,{item:!0,children:(0,te.jsx)(y.A,{icon:(0,te.jsx)(h.A,{}),variant:"outlined",color:"error",label:e.addon})})},e.addon)))})})}),(0,te.jsx)(v.Ay,{item:!0,xs:12,sm:6,children:(0,te.jsx)(Z.A,{title:"Total",sx:{height:"100%"},children:(0,te.jsxs)(u.A,{spacing:2,children:[(0,te.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,te.jsx)(S.A,{color:As.palette.grey[500],children:"Sub Total:"}),(0,te.jsxs)(S.A,{children:["$",""===De?(0,te.jsx)(W.A,{sx:{width:"30px"}}):De]})]}),(0,te.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,te.jsx)(S.A,{color:As.palette.grey[500],children:"Tax:"}),(0,te.jsx)(S.A,{children:""===Se?(0,te.jsx)(W.A,{sx:{width:"30px"}}):Se})]}),(0,te.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,te.jsx)(S.A,{variant:"subtitle1",children:"Grand Total:"}),(0,te.jsx)(S.A,{variant:"subtitle1",children:""===ke?(0,te.jsx)(W.A,{sx:{width:"30px"}}):"$".concat(ke)})]})]})})}),(0,te.jsx)(v.Ay,{item:!0,xs:12,children:(0,te.jsxs)(u.A,{direction:"column",sx:{mt:2},children:[(0,te.jsx)(S.A,{color:"secondary",children:"Other Instructions:"}),(0,te.jsx)(S.A,{sx:{ml:3},children:Oe})]})})]})})})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/6248.d7ba49cb.chunk.js b/build/static/js/6248.d7ba49cb.chunk.js new file mode 100644 index 0000000..0079f3d --- /dev/null +++ b/build/static/js/6248.d7ba49cb.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6248],{23787:(e,s,i)=>{i.d(s,{FG:()=>A,nV:()=>x,pY:()=>j,pg:()=>h});var n=i(89379),r=i(80045),t=i(93230),a=i(2235),l=i(16491),o=i(82053),c=i(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:s,scroll:i=!1,onScroll:a,sx:l}=e,o=(0,r.A)(e,d);return(0,c.jsx)(t.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:a,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},o),{},{children:s}))},h=e=>{let{accent:s="#662582",header:i,footer:r,selected:t=!1,onClick:o,children:d,sx:x}=e;return(0,c.jsxs)(a.A,{elevation:0,onClick:o,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?s:"#e2e8f0",background:t?"".concat(s,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:s}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[i,d,r]})]})},A=e=>{let{children:s,columns:i=2,sx:r}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},r),children:s})},j=e=>{let{label:s,value:i,children:n,full:r=!1,align:t="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:r?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,c.jsx)(o.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:s}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(o.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},66248:(e,s,i)=>{i.r(s),i.d(s,{default:()=>oe});var n=i(89379),r=i(9950),t=i(46702),a=i(28429),l=i(26910),o=i(63189),c=i(19474),d=i(58833),x=i(53067),h=i(62824),A=i(52329),j=i(36256),m=i(32653),g=i(96583),p=i(28170),u=i(93230),f=i(41413),b=i(60899),v=i(25277),y=i(65429),w=i(92743),Y=i(36080),C=i(82053),S=i(29925),k=i(82223),z=i(40033),D=i(48159),M=i(84142),I=i(46639),F=i(93038),T=i(83274),H=i(25333),E=i(1320),O=i(15769),P=i(69780),W=i(9213),_=i(21671),R=i(34075),N=i(79739),U=i(25713),L=i(82917),q=i(25979),B=i(33738),$=i(74745),G=i(37476),K=i(72179),V=i(50027),X=i(52351),Z=i(4159),J=i.n(Z),Q=i(14857),ee=i(47223),se=i(23787),ie=i(46585),ne=i(94118),re=i(97973),te=i(8881),ae=i(44414),le=i(36220);J().extend(le);const oe=()=>{const[e,s]=(0,r.useState)([]),[i,Z]=(0,r.useState)(!0),le=(0,a.zy)(),[oe,ce]=(0,r.useState)(""),[de,xe]=(0,r.useState)(""),[he,Ae]=(0,r.useState)(""),[je,me]=(0,r.useState)(""),[ge,pe]=(0,r.useState)(!1),[ue,fe]=(0,r.useState)(""),[be,ve]=(0,r.useState)(""),[ye,we]=(0,r.useState)(!1),[Ye,Ce]=(0,r.useState)(""),[Se]=(0,r.useState)(""),[ke,ze]=(0,r.useState)(""),[De,Me]=(0,r.useState)(""),[Ie,Fe]=(0,r.useState)(""),[Te,He]=(0,r.useState)(""),[Ee,Oe]=(0,r.useState)([]),[Pe,We]=(0,r.useState)(""),[_e,Re]=(0,r.useState)(""),[Ne,Ue]=(0,r.useState)([]),[Le,qe]=(0,r.useState)([]),[Be,$e]=(0,r.useState)(""),[Ge,Ke]=(0,r.useState)(""),[Ve]=(0,r.useState)(""),[Xe]=(0,r.useState)(""),[Ze,Je]=(0,r.useState)(""),[Qe,es]=(0,r.useState)([]),[ss,is]=(0,r.useState)({shifts:0,assigned:0,remaining:0,shiftid:0,price:0}),[ns,rs]=(0,r.useState)(0),{state:ts}=(0,a.zy)(),[as,ls]=(0,r.useState)(""),os=(0,a.Zp)(),[cs,ds]=(0,r.useState)(["",""]),[xs,hs]=(0,r.useState)(""),[As,js]=(0,r.useState)(!1);(0,r.useEffect)((()=>{console.log("categoryarr"),console.log(e,de,Te,Ve,Xe)}),[Qe]),(0,r.useEffect)((()=>{ts&&($e(ts.orderheaderid),Ke(ts.tenantid)),console.log(ts),console.log(Date.now())}),[]),(0,r.useEffect)((()=>{ts&&($e(ts.orderheaderid),Ke(ts.tenantid)),console.log(ts),console.log(Date.now())}),[ts.orderheaderid,ts.tenantid]);const ms=(0,Q.A)(),gs=(0,ee.A)(ms.breakpoints.down("md")),ps=async()=>{Z(!0),await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getordersbystatus?tenantid=").concat(Ge)).then((e=>{console.log(e);let s=e.data.Details.find((e=>e.orderheaderid==Be));console.log("result"),console.log(s),Oe(s.orderaddons),He(s.venuetype),We(s.remarks),hs(s.startdate),fe(s.tenantname),xe(""),ve(s.tenantaddress),me(s.eventname),Ae(J()(s.orderdate).format("MM/DD/YYYY")||""),ce(s.orderid),Ce(s.orderstatus),ze(s.taxamount),Me(s.orderamount),Fe(s.ordervalue),Re(J()(s.cancelled).format("MM/DD/YYYY")||""),Je(s.pending),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))},us=async()=>{Z(!0),await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderdetails?orderheaderid=").concat(Be)).then((e=>{console.log("res"),console.log(e),s(e.data.Details||[]),console.log("categoryarr"),es(e.data.Details),console.log(e.data.Details),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))},fs=async e=>{Z(!0);try{await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getassignedinfo?orderdetailid=").concat(e)).then((e=>{console.log(e),e.data.status&&Ue(e.data.Details),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))}catch(s){console.log(s),Z(!1)}},bs=async e=>{let s={orderheaderid:Be,orderprocessid:e.orderprocessid,orderdetailid:e.orderdetailid,orderstatus:"pending",pending:J()().format("YYYY-MM-DD HH:mm:ss"),status:1};console.log(s),await l.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/updateprocessstatus"),s).then((s=>{console.log(s),"Successful"===s.data.message&&((0,te.M8)("Role unassigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ss.assigned>ss.shifts&&vs(e),ps(),us(),pe(!1),Cs(),ys(),setTimeout((()=>{Cs()}),2e3))})).catch((e=>{console.log(e)}))},vs=e=>{let s;console.log(e);let i=[e.userfcmtoken],n=[{notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Un-Asigned",message:"".concat(e.firstname," has been Un-assigned to the order ").concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:oe,success:0,orderstatus:"assigned",processing:J()().format("YYYY-MM-DD HH:mm:ss"),notifytype:2,notifyreason:"Staff Un-Assigned"}];s={Title:"Staff Un-Asigned",message:"A Staff has been Un-assigned to the order ".concat(oe),tenantid:Ge,orderheaderid:Be,orderid:oe,configid:2};let r={notifications:n,fcmmodel:{priority:"high",registration_ids:i,data:s,notification:{body:"An order has been Un-assigned ".concat(oe),title:"Legendary",sound:"ring",content_available:!0,click_action:"FLUTTER_NOTIFICATION_CLICK"}}};console.log("grpnotifyobj unassign"),console.log(r),Ys(r)};(0,r.useEffect)((()=>{console.log(Be),Be&&Ge?(ps(),us(),Cs(),console.log(le.state||"")):Z(!1),console.log(Be,Ge)}),[Be,Ge,as]);const ys=()=>{we(!1),qe([]),ds(["",""])};(0,r.useEffect)((()=>{console.log(ss)}));const ws=async e=>{let s=e.userfcmtoken,i={notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:oe,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK"};console.log(i,s),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/send"),{priority:"high",registration_ids:[s],data:i,notification:{body:"A Staff has been assigned to ".concat(oe),title:"Legendary",sound:"ring",content_available:!0}},{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),(0,te.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})})).catch((e=>{console.log(e)}))},Ys=async e=>{console.log(e),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/sendall"),e,{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),e.data.status&&((0,te.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ps())})).catch((e=>{console.log(e)}))},Cs=async()=>{await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderstatuscount?orderheaderid=").concat(Be)).then((e=>{e.data.status?(console.log(e),ls(e.data.pendingcount),ps()):(ls(e.data.pendingcount),ps())})).catch((e=>{console.log(e)}))};function Ss(e){let{open:s,handleClose:i}=e;const[n,t]=(0,r.useState)("");return(0,ae.jsx)(g.A,{open:s,onClose:()=>i(!1),maxWidth:"xs",fullScreen:gs,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:(0,ae.jsx)(p.A,{sx:{mt:2,my:1},children:(0,ae.jsxs)(u.A,{alignItems:"center",spacing:3.5,children:[(0,ae.jsx)(f.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,ae.jsx)(j.A,{})}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:oe.slice(4),variant:"combined",color:"warning",size:"small"})}),(0,ae.jsxs)(u.A,{spacing:2,children:[As&&(0,ae.jsxs)(y.A,{color:"warning",variant:"border",icon:(0,ae.jsx)(ie.A,{}),children:[(0,ae.jsx)(w.A,{children:"Order is within 24Hrs time frame. The order will be invoiced with standard pricing as agreed."}),(0,ae.jsx)(Y.A,{href:"https://thelegendarystaff.com/",target:"_blank",children:"Terms & Condition link"})]}),(0,ae.jsx)(C.A,{variant:"h4",align:"center",children:"Please type in the order number to confirm."}),(0,ae.jsx)(S.A,{type:"text",onChange:e=>{console.log(e.target.value),t(e.target.value)},error:n!==oe.slice(4),value:n})]}),(0,ae.jsxs)(u.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,ae.jsx)(k.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{n===oe.slice(4)&&((async()=>{await l.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/cancel"),{orderheaderid:parseInt(Be),orderstatus:"cancelled",cancelled:J()().format("YYYY-MM-DD HH:mm:ss"),unserviceable:As?0:1}).then((e=>{console.log(e),e.data.status&&Be&&Ge&&(ps(),us())})).catch((e=>{console.log(e)}))})(),i(!0))},autoFocus:!0,children:"Yes, Cancel"}),(0,ae.jsx)(k.A,{fullWidth:!0,onClick:()=>i(!1),color:"secondary",variant:"outlined",children:"No"})]})]})})})}return(0,ae.jsxs)(ae.Fragment,{children:[i&&(0,ae.jsx)(X.A,{}),(0,ae.jsx)(Ss,{open:ge,handleClose:()=>{pe(!1)}}),(0,ae.jsxs)(g.A,{maxWidth:!1,fullWidth:!0,open:ye,onClose:ys,scroll:"paper",fullScreen:gs,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},TransitionComponent:G.s,children:[(0,ae.jsxs)(z.A,{children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsxs)(u.A,{direction:{sm:"row",xs:"column"},spacing:2,alignItems:"center",children:[(0,ae.jsx)(C.A,{variant:"h3",children:"Assign Roles"}),(0,ae.jsx)(v.A,{label:ue,variant:"light",color:"primary"})]}),(0,ae.jsx)(v.A,{label:oe,variant:"combined",color:"warning",size:"large"})]}),(0,ae.jsxs)(b.Ay,{container:!0,sx:{p:1},spacing:2,children:[(0,ae.jsx)(b.Ay,{item:!0,sm:6,xs:12,children:(0,ae.jsx)(D.A,{value:ns,onChange:()=>rs((e=>0===e?1:0)),variant:"scrollable",scrollButtons:"auto",children:(0,ae.jsx)(M.A,{label:Se})})}),(0,ae.jsx)(b.Ay,{item:!0,sm:6,xs:12,children:(0,ae.jsxs)(u.A,{direction:"row",justifyContent:{xs:"flex-start",sm:"flex-end"},sx:{height:"100%"},spacing:2,children:[(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Required:".concat(ss.shifts),variant:"combined",color:"primary",size:"normal"}),(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Assigned: ".concat(ss.assigned),variant:"combined",color:"success",size:"normal"}),(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Remaining: ".concat(ss.remaining),variant:"combined",color:"error",size:"normal"})]})})]})]}),(0,ae.jsx)(p.A,{dividers:!0,children:0===Ne.length?(0,ae.jsx)(ae.Fragment,{children:i?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})})}):(0,ae.jsx)(C.A,{children:"No Staffs Available"})}):gs?(0,ae.jsx)(se.nV,{children:Ne.map(((e,s)=>{const i=!!Le.find((s=>s.userid==e.userid));return(0,ae.jsxs)(se.pg,{accent:"#662582",selected:i,children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,children:[(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,ae.jsx)(f.A,{alt:"",src:"",sx:{width:32,height:32}}),(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"subtitle2",children:e.firstname}),(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.contactno})]})]}),e.orderdetailid!==orderdetailid?(0,ae.jsx)(F.A,{disabled:0!==e.orderdetailid,checked:i,onClick:s=>{if(console.log(ss),ss.remaining>=0){if(s.target.checked&&0!=ss.remaining){let s=Le;s.push({userid:e.userid,orderdetailid:orderdetailid,productid:productid,shiftid:ss.shiftid,userrate:ss.price,productrate:e.rolecost,firstname:e.firstname}),qe([...s]);let i=ss;i.assigned++,i.remaining=i.shifts-i.assigned,is((0,n.A)({},i))}else if(ss.assigned!=ss.shifts||0===ss.remaining&&!s.target.checked){let s=Le,i=s.findIndex((s=>s.userid===e.userid));s.splice(i,1),qe([...s]);let r=ss;r.assigned--,r.remaining=r.shifts-r.assigned,is((0,n.A)({},r))}console.log(Le)}}}):(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",children:[(0,ae.jsx)(v.A,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,ae.jsx)(T.A,{title:"Unassign",children:(0,ae.jsx)(H.A,{color:"error",onClick:()=>{console.log(e),bs(e)},children:(0,ae.jsx)(ne.A,{})})}),(0,ae.jsx)(T.A,{title:"Send Notification",children:(0,ae.jsx)(H.A,{color:"info",onClick:()=>{console.log(e),ws(e)},children:(0,ae.jsx)(m.A,{})})})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Category",children:(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",spacing:.25,children:[(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,ae.jsx)(v.A,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,ae.jsx)(se.pY,{label:"Price",value:e.rolecost}),(0,ae.jsx)(se.pY,{label:"Experience",value:"".concat(e.experience," Years")}),(0,ae.jsx)(se.pY,{label:"Level",children:(0,ae.jsx)(v.A,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,ae.jsx)(se.pY,{label:"City",value:e.city}),e.orderid&&(0,ae.jsx)(se.pY,{label:"Order",children:(0,ae.jsx)(v.A,{label:e.orderid,color:"warning",size:"small",variant:"light"})})]})]},s)}))}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Staff"}),(0,ae.jsx)(_.A,{children:"Category"}),(0,ae.jsx)(_.A,{children:"Price"}),(0,ae.jsx)(_.A,{children:"Experience"}),(0,ae.jsx)(_.A,{children:"Level"}),(0,ae.jsx)(_.A,{children:"City"}),(0,ae.jsx)(_.A,{children:"Action"}),(0,ae.jsx)(_.A,{})]})}),(0,ae.jsx)(R.A,{children:Ne.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsxs)(W.A,{sx:{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5":"",":hover":{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5 !important":""}},children:[(0,ae.jsx)(_.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,ae.jsx)(_.A,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,ae.jsx)(f.A,{alt:"",size:"sm",src:"",sx:{width:"25px",height:"25px"}}),(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"caption",children:e.firstname}),(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.contactno})]})]})}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,ae.jsx)(v.A,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,ae.jsx)(_.A,{children:e.rolecost}),(0,ae.jsxs)(_.A,{align:"left",children:[e.experience," Years"]}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsx)(v.A,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,ae.jsx)(_.A,{align:"left",children:e.city}),(0,ae.jsx)(_.A,{align:"left",children:e.orderdetailid!==orderdetailid?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(F.A,{disabled:0!==e.orderdetailid,checked:!!Le.find((s=>s.userid==e.userid)),onClick:s=>{if(console.log(ss),ss.remaining>=0){if(s.target.checked&&0!=ss.remaining){let s=Le;s.push({userid:e.userid,orderdetailid:orderdetailid,productid:productid,shiftid:ss.shiftid,userrate:ss.price,productrate:e.rolecost,firstname:e.firstname}),qe([...s]);let i=ss;i.assigned++,i.remaining=i.shifts-i.assigned,is((0,n.A)({},i))}else if(ss.assigned!=ss.shifts||0===ss.remaining&&!s.target.checked){let s=Le,i=s.findIndex((s=>s.userid===e.userid));s.splice(i,1),qe([...s]);let r=ss;r.assigned--,r.remaining=r.shifts-r.assigned,is((0,n.A)({},r))}console.log(Le)}}})}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(v.A,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,ae.jsx)(T.A,{title:"Unassign",children:(0,ae.jsx)(H.A,{color:"error",onClick:()=>{console.log(e),bs(e)},children:(0,ae.jsx)(ne.A,{})})}),(0,ae.jsx)(T.A,{title:"Send Notification",children:(0,ae.jsx)(H.A,{color:"info",onClick:()=>{console.log(e),ws(e)},children:(0,ae.jsx)(m.A,{})})})]})}),(0,ae.jsx)(_.A,{children:e.orderid&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(v.A,{label:e.orderid,color:"warning",size:"small",variant:"light"})})})]})},s)))})]})})}),(0,ae.jsx)(N.A,{children:(0,ae.jsxs)(u.A,{sx:{mt:2,width:{xs:"100%",sm:"auto"}},direction:{xs:"column",sm:"row"},justifyContent:"flex-end",spacing:{xs:1.5,sm:5},children:[Ne.length>0&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},variant:"contained",onClick:async()=>{let e=[],s=[];Le.map((i=>{e.push({orderprocessid:0,processdate:J()().format("YYYY-MM-DD HH:mm:ss"),tenantid:Ge,orderheaderid:Be,orderdetailid:i.orderdetailid,productid:i.productid,userid:i.userid,orderstatus:"pending",pending:"".concat(J()(Ze).format("YYYY-MM-DD")," ").concat(J()(Ze).format("HH:mm:ss")),starttime:"".concat(J()(Ve).format("YYYY-MM-DD")," ").concat(J()(Ve).format("HH:mm:ss")),endtime:"".concat(J()(Xe).format("YYYY-MM-DD")," ").concat(J()(Xe).format("HH:mm:ss")),appuserid:parseInt(localStorage.getItem("appuserid")),shiftid:i.shiftid,userrate:i.userrate,productrate:i.productrate}),Le.map((e=>{s.push({notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:0,shiftid:e.shiftid,userid:e.userid,orderid:oe,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK",firstname:e.firstname})}))})),console.log("arr"),console.log(e),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorderprocess"),e).then((e=>{console.log(e),"Successfully created"===e.data.message&&((0,te.M8)("Roles assigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),we(!1),us(),Cs())})).catch((e=>{console.log(e)})),console.log(e)},children:"OK"}),(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},color:"warning",variant:"contained",onClick:()=>{qe([]);let e=ss;e.remaining=e.shifts,e.assigned=0,is(e)},children:"clear"})]}),(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},color:"error",variant:"contained",onClick:()=>{ys()},children:"Close"})]})})]}),(0,ae.jsxs)(b.Ay,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,ae.jsx)(U.A,{sx:{position:"sticky",top:"60px",bgcolor:ms.palette.background.default,zIndex:1,width:"100%"},children:(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(u.A,{direction:{md:"row",xs:"column"},justifyContent:"space-between",alignItems:"flex-end",sx:{width:"100%",p:1},children:[(0,ae.jsxs)(u.A,{direction:"row",spacing:2,alignItems:"center",justifyContent:"flex-start",sx:{width:{xs:"100%",md:"0"}},children:[(0,ae.jsx)(H.A,{onClick:()=>history.back(),children:(0,ae.jsx)(o.A,{})}),(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,ae.jsx)(C.A,{variant:"h3",children:"Details"}),(0,ae.jsxs)(u.A,{direction:"row",spacing:1,children:[(0,ae.jsx)(v.A,{label:""===oe?(0,ae.jsx)(L.A,{sx:{width:"80px",bgcolor:"#fff9c4"},animation:"wave"}):oe,variant:"combined",color:"warning",size:"small"}),(0,ae.jsx)(v.A,{label:""===he?(0,ae.jsx)(L.A,{sx:{width:"80px",bgcolor:"#b3e5fc"},animation:"wave"}):he,variant:"combined",color:"primary",size:"small"}),"pending"===Ye&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===Ye&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===Ye&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===Ye&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===Ye&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===Ye&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===Ye&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===Ye&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"}),"modified"===Ye&&(0,ae.jsx)(v.A,{label:"Modified",color:"secondary",size:"small",variant:"contained"})]})]})]}),(0,ae.jsxs)(u.A,{direction:{xs:"column",sm:"row"},spacing:2,sx:{mt:{md:0,xs:2},width:{xs:"100%",md:"auto"}},children:[("pending"===Ye||"assigned"===Ye||"confirmed"===Ye||"modified"===Ye)&&(0,ae.jsx)(T.A,{title:"Edit",children:(0,ae.jsx)(k.A,{variant:"outlined",color:"info",sx:{borderRadius:"40px",width:{xs:"100%",sm:"auto"}},startIcon:(0,ae.jsx)(t.A,{color:"info"}),onClick:e=>{e.stopPropagation(),J()(J()().format("MM-DD-YYYY")).isBefore(J()(J()(xs).format("MM-DD-YYYY")))?os("/editorder",{state:{orderheaderid:Be,tenantid:Ge}}):(0,te.M8)("Order cannot be edited.\n Order date is not valid at this time",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:4e3,style:{whiteSpace:"pre-line"}})},children:"Edit Order"})}),"cancelled"!==Ye&&""!==Ye&&"completed"!==Ye&&"closed"!==Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(k.A,{variant:"outlined",color:"error",onClick:()=>{console.log(J()(xs).diff(J()(),"m")/60),J()(xs).diff(J()(),"m")/60>24?(js(!1),pe(!0)):(js(!0),pe(!0))},sx:{borderRadius:"40px",mt:{xs:2,sm:0},width:{xs:"100%",sm:"auto"}},startIcon:(0,ae.jsx)(K.A,{}),children:"Cancel Order"})}),"cancelled"===Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(v.A,{label:"Order Cancelled on ".concat(_e),variant:"combined",color:"error"})})]})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sx:{mt:-2},children:(0,ae.jsx)(V.A,{content:!1,width:"100%",children:(0,ae.jsxs)(b.Ay,{container:!0,spacing:2.5,sx:{p:2.5},children:[(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:1,children:[(0,ae.jsx)(C.A,{variant:"h5",children:"Client"}),(0,ae.jsx)(C.A,{color:"secondary",children:""===ue?(0,ae.jsx)(L.A,{sx:{width:"40%"},animation:"wave"}):ue}),(0,ae.jsx)(q.A,{sx:{width:"100%"},children:(0,ae.jsx)(C.A,{color:"secondary",children:""===be?(0,ae.jsx)(L.A,{sx:{width:"90%"},animation:"wave"}):be})})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:1,children:[(0,ae.jsx)(C.A,{variant:"h5",children:"Event"}),(0,ae.jsx)(q.A,{sx:{width:"100%"},children:(0,ae.jsx)(C.A,{color:"secondary",children:""===je?(0,ae.jsx)(L.A,{sx:{width:"40%"},animation:"wave"}):je})})]})})}),Qe.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(V.A,{sx:{opacity:0==e.shiftstatus?"":"0.7"},children:[(0,ae.jsxs)(u.A,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{md:"center",xs:"flex-start"},spacing:2,sx:{p:2},children:[(0,ae.jsxs)(u.A,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{md:"center",xs:"flex-start"},children:[(0,ae.jsxs)(C.A,{variant:"h5",children:["Shift ",s+1]}),(0,ae.jsxs)(C.A,{color:"secondary",children:[(0,ae.jsx)(c.A,{})," ","",e.locationaddress]}),1===e.shiftstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary"})]}),(0,ae.jsx)(u.A,{direction:"row",spacing:1,children:e.ordercontacts.map((e=>(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(T.A,{title:e.contactname,children:(0,ae.jsx)(f.A,{sx:{bgcolor:"#2196f3",width:30,height:30},alt:"A",children:e.contactname.charAt(0).toUpperCase()})})})))})]}),gs?(0,ae.jsxs)(se.nV,{children:[0===e.orderdetails.length&&(0,ae.jsxs)(se.pg,{accent:"#662582",children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),e.orderdetails.map(((e,n)=>(0,ae.jsxs)(se.pg,{accent:"#662582",sx:{opacity:0==e.status?"":"0.7"},children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,children:[(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsxs)(C.A,{sx:{fontSize:10,fontWeight:800,color:"#94a3b8"},children:["#",n+1]}),(0,ae.jsx)(C.A,{variant:"subtitle1",children:e.productname})]}),(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",children:[(0,ae.jsx)(T.A,{title:"Expand",children:(0,ae.jsx)(H.A,{"aria-label":"expand row",style:{color:ms.palette.primary.main},onClick:()=>{Ue([]),ds(cs[0]===s&&cs[1]===n?["",""]:[s,n]),fs(e.orderdetailid)},children:cs[0]===s&&cs[1]===n?(0,ae.jsx)(h.A,{}):(0,ae.jsx)(A.A,{})})}),"cancelled"===Ye&&(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,ae.jsx)(d.A,{})}),1===e.status&&(0,ae.jsx)(T.A,{title:"Cancelled",children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},children:(0,ae.jsx)(K.A,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,ae.jsx)(T.A,{title:"Assigned count is greater than ordered count",children:(0,ae.jsx)(H.A,{color:"warning",children:(0,ae.jsx)(re.A,{})})})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Start Date",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.starttime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"End Date",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.endtime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"Unpaid Break",value:e.unpaidbreak||0}),(0,ae.jsx)(se.pY,{label:"Count",children:(0,ae.jsx)(v.A,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,ae.jsx)(se.pY,{label:"Assigned",children:(0,ae.jsx)(v.A,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,ae.jsx)(se.pY,{label:"Price",value:"$".concat(e.price)}),(0,ae.jsx)(se.pY,{label:"Amount",value:"$".concat(e.landingamount)})]}),(0,ae.jsxs)(B.A,{in:cs[0]===s&&cs[1]===n,timeout:"auto",unmountOnExit:!0,children:[(0,ae.jsx)($.A,{sx:{my:1.5}}),0===Ne.length?i?(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})}):(0,ae.jsx)(u.A,{sx:{p:1},children:(0,ae.jsx)(C.A,{children:"No Staffs has been Assigned"})}):(0,ae.jsx)(u.A,{spacing:1,children:Ne.map(((e,s)=>(0,ae.jsxs)(se.pg,{accent:"#0ea5e9",children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"subtitle2",children:e.staffname}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:e.productname,color:"info",variant:"light",size:"small"})})]}),(0,ae.jsxs)(u.A,{direction:"row",children:["pending"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Start Time",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Starttime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"End Time",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Endtime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"Pay Rate",value:e.rolecost}),(0,ae.jsx)(se.pY,{label:"Hours Worked",value:e.hoursworked}),(0,ae.jsx)(se.pY,{label:"Clockin",children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(se.pY,{label:"Clockout",children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})})]})]},s)))})]})]},n+1)))]}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Role"}),(0,ae.jsx)(_.A,{children:"Start Date"}),(0,ae.jsx)(_.A,{children:"End Date"}),(0,ae.jsx)(_.A,{children:"Unpaid break"}),(0,ae.jsx)(_.A,{children:"Count"}),(0,ae.jsx)(_.A,{children:"Assigned"}),(0,ae.jsx)(_.A,{children:"Attire"}),(0,ae.jsx)(_.A,{children:"Price"}),(0,ae.jsx)(_.A,{children:"Amount"}),(0,ae.jsx)(_.A,{children:"Action"})]})}),(0,ae.jsxs)(R.A,{children:[0===e.orderdetails.length&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsxs)(_.A,{children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),(0,ae.jsxs)(_.A,{children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})})]})}),e.orderdetails.map(((e,n)=>(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(W.A,{sx:{"&:last-child td, &:last-child th":{border:0},opacity:0==e.status?"":"0.7"},children:[(0,ae.jsx)(_.A,{children:n+1}),(0,ae.jsx)(_.A,{children:e.productname}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body1",children:J()(e.starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.starttime).format("hh:mm A")})]})}),(0,ae.jsxs)(_.A,{children:[" ",(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body1",children:J()(e.endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.endtime).format("hh:mm A")})]})]}),(0,ae.jsx)(_.A,{children:e.unpaidbreak||0}),(0,ae.jsx)(_.A,{align:"center",children:(0,ae.jsx)(v.A,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,ae.jsx)(_.A,{align:"center",children:(0,ae.jsx)(v.A,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,ae.jsx)(_.A,{width:"100px"}),(0,ae.jsxs)(_.A,{children:["$",e.price]}),(0,ae.jsxs)(_.A,{children:["$",e.landingamount]}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"row",children:[(0,ae.jsx)(T.A,{title:"Expand",children:(0,ae.jsx)(H.A,{"aria-label":"expand row",style:{color:ms.palette.primary.main},onClick:()=>{Ue([]),ds(cs[0]===s&&cs[1]===n?["",""]:[s,n]),fs(e.orderdetailid)},children:cs[0]===s&&cs[1]===n?(0,ae.jsx)(h.A,{}):(0,ae.jsx)(A.A,{})})}),"cancelled"===Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,ae.jsx)(d.A,{})})}),1===e.status&&(0,ae.jsx)(T.A,{title:"Cancelled",children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},children:(0,ae.jsx)(K.A,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,ae.jsx)(T.A,{title:"Assigned count is greater than ordered count",children:(0,ae.jsx)(H.A,{color:"warning",children:(0,ae.jsx)(re.A,{})})})]})})]},n+1),(0,ae.jsx)(W.A,{sx:{p:2},children:(0,ae.jsx)(_.A,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:11,sx:{width:"100%"},children:(0,ae.jsx)(B.A,{in:cs[0]===s&&cs[1]===n,timeout:"auto",unmountOnExit:!0,children:(0,ae.jsx)(V.A,{sx:{width:"100%"},children:0===Ne.length?(0,ae.jsx)(ae.Fragment,{children:i?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})})}):(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{sx:{p:1},children:(0,ae.jsx)(C.A,{children:"No Staffs has been Assigned"})})})}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Staff"}),(0,ae.jsx)(_.A,{children:"Start Time"}),(0,ae.jsx)(_.A,{children:"End Time"}),(0,ae.jsx)(_.A,{children:"Pay Rate"}),(0,ae.jsx)(_.A,{align:"center",children:"Clockin"}),(0,ae.jsx)(_.A,{align:"center",children:"Clockout"}),(0,ae.jsx)(_.A,{children:"Hours Worked"}),(0,ae.jsx)(_.A,{children:"Status"})]})}),(0,ae.jsx)(R.A,{children:Ne.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsxs)(W.A,{sx:{},children:[(0,ae.jsx)(_.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"caption",children:e.staffname}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:e.productname,color:"info",variant:"light",size:"small"})})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Starttime).format("hh:mm A")})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Endtime).format("hh:mm A")})]})}),(0,ae.jsx)(_.A,{children:e.rolecost}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(_.A,{children:e.hoursworked}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"row",children:["pending"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"})]})})]})},s)))})]})})})})})})]})))]})]})})]})})},e.locationaddress))),(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsx)($.A,{sx:{borderWidth:1}})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{title:"Order Addons",sx:{height:"100%"},children:(0,ae.jsx)(b.Ay,{container:!0,spacing:2,children:(Ee||[]).map((e=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsx)(b.Ay,{item:!0,children:(0,ae.jsx)(v.A,{icon:(0,ae.jsx)(x.A,{}),variant:"outlined",color:"error",label:e.addon})})},e.addon)))})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{title:"Total",sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:2,children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{color:ms.palette.grey[500],children:"Sub Total:"}),(0,ae.jsxs)(C.A,{children:["$",""===De?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):De]})]}),(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{color:ms.palette.grey[500],children:"Tax:"}),(0,ae.jsx)(C.A,{children:""===ke?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):ke})]}),(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{variant:"subtitle1",children:"Grand Total:"}),(0,ae.jsx)(C.A,{variant:"subtitle1",children:""===Ie?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):"$".concat(Ie)})]})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(u.A,{direction:"column",sx:{mt:2},children:[(0,ae.jsx)(C.A,{color:"secondary",children:"Other Instructions:"}),(0,ae.jsx)(C.A,{sx:{ml:3},children:Pe})]})})]})})})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/6666.5d38556f.chunk.js b/build/static/js/6666.5d38556f.chunk.js deleted file mode 100644 index 4f18d55..0000000 --- a/build/static/js/6666.5d38556f.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6666],{54413:(e,s,a)=>{a.r(s),a.d(s,{default:()=>oe});var t=a(80045),i=a(89379),r=a(9950),n=a(98007),l=a(47113),c=a(82215),d=a(99810),o=a(49029),u=a(33516),m=a(48513),p=a(37119),h=a(2527),x=a.n(h);a(55392);x().PolylineOffset={translatePoint:(e,s,a)=>x().point(e.x+s*Math.cos(a),e.y+s*Math.sin(a)),offsetPointLine(e,s){const a=e.length;if(a<2)throw new Error("Line should be defined by at least 2 points");let t,i=e[0];const r=Math.PI/2,n=[];for(let l=1;l=0&&l<=1&&c>=0&&c<=1?x().point(e.x+c*i.x,e.y+c*i.y):null},segmentAsVector:(e,s)=>x().point(s.x-e.x,s.y-e.y),joinLineSegments(e){const s=[];let a=e[0].offset;s.push(a[0]);for(let t=1;te.latLngToLayerPoint(s)));return this.offsetPoints(t,a).map((s=>e.layerPointToLatLng(s)))}};const v=x().Polyline.prototype._projectLatlngs;x().Polyline.prototype._projectLatlngs=function(e,s,a){const t=this.options.offset;if(!t||"number"!==typeof t)return v.call(this,e,s,a);if(!(e[0]instanceof x().LatLng)){for(let t=0;tthis._map.latLngToLayerPoint(e))),r=x().PolylineOffset.offsetPoints(i,t);for(let n=0;n{const e=t,r=e.onTime+e.late,n=s.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),l=n<0,c=a.filter((e=>e.anomaly)),d=a.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length,o=a.filter((e=>w.yP.has(String(e.orderstatus||"").toLowerCase()))).length,u=null==e.kmDeltaPct?"":e.kmDeltaPct>25?"is-over":e.kmDeltaPct<-5?"is-under":"",m=a.length||1,p=e.onTime+e.late||1,h=Math.round(d/m*60+e.onTime/p*25+(m-e.anomalies)/m*15),x=h>=85?"#16a34a":h>=65?"#f59e0b":"#dc2626",v=h>=85?"Excellent":h>=65?"Acceptable":"Needs review",j=a.filter((e=>e.actualTs)),g=j.reduce(((e,s)=>!e||s.actualTs.isBefore(e)?s.actualTs:e),null),f=j.reduce(((e,s)=>!e||s.actualTs.isAfter(e)?s.actualTs:e),null),N=g&&f?Math.max(0,f.diff(g,"minute")):0,b=a.length>1?Math.round(N/(a.length-1)):0,y=N>0?(e.actualKm/(N/60)).toFixed(1):null,k=a.filter((e=>!e.isLoading&&e.coordsCount>0)),S=k.filter((e=>null!=e.timeDeltaMin&&!e.anomaly)).sort(((e,s)=>e.timeDeltaMin-s.timeDeltaMin))[0]||null,_=k.filter((e=>e.anomaly)).sort(((e,s)=>{const a=Math.abs(e.kmDeltaPct||0)+(e.timeDeltaMin>0?e.timeDeltaMin:0);return Math.abs(s.kmDeltaPct||0)+(s.timeDeltaMin>0?s.timeDeltaMin:0)-a}))[0]||null,F=i.filter(((e,s)=>{var a;const t=null===(a=e.order)||void 0===a?void 0:a.step;return null!=t&&t!==s+1})),M=[];F.forEach((e=>{var s;const a=null===(s=e.order)||void 0===s?void 0:s.step,t=i.findIndex((s=>s.sequenceStep===e.sequenceStep))+1,r=t-a,n=M[M.length-1];n&&n.delta===r&&n.lastActualPos+1===t?(n.items.push({d:e,planned:a,actualPos:t,delta:r}),n.lastActualPos=t):M.push({delta:r,items:[{d:e,planned:a,actualPos:t,delta:r}],lastActualPos:t})}));const C={};s.orders.forEach((e=>{const s=e.trip_number||1;C[s]||(C[s]=[]),C[s].push(e)}));const z=Object.entries(C).sort(((e,s)=>{let[a]=e,[t]=s;return Number(a)-Number(t)})).map((e=>{let[s,a]=e;return{tNum:s,count:a.length,plannedKm:a.reduce(((e,s)=>e+parseFloat(s.kms||0)),0),actualKm:a.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:a.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),delivered:a.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length}}));return{sum:e,totalSteps:r,totalProfit:n,isLoss:l,deviations:c,delivered:d,skipped:o,stepDeltaPct:u,score:h,scoreColor:x,scoreLabel:v,firstDelivery:g,lastDelivery:f,activeMin:N,avgPerStop:b,avgSpeed:y,bestStep:S,worstStep:_,outOfOrderSteps:F,seqRuns:M,tripList:z}}),[s,a,t,i]),h=null!=n?a.find((e=>e.sequenceStep===n)):null,x=e=>{l((s=>s===e?null:e))},v=function(e){let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{d:a,planned:t,actualPos:i,delta:r}=e;return(0,F.jsxs)("li",{className:"cdp-seq-diff".concat(n===a.sequenceStep?" is-focused":"").concat(s?"":" is-nested"),onClick:()=>x(a.sequenceStep),children:[(0,F.jsx)("span",{className:"cdp-seq-diff-num",style:{background:(0,w.gM)((t||a.sequenceStep)-1)},children:t||a.sequenceStep}),(0,F.jsxs)("div",{className:"cdp-seq-diff-body",children:[(0,F.jsx)("div",{className:"cdp-seq-diff-title",children:a.deliverycustomer||"Step ".concat(t||a.sequenceStep)}),(0,F.jsxs)("div",{className:"cdp-seq-diff-sub",children:["Visited ",(0,F.jsx)("strong",{children:(0,w.IE)(i)})," ","\xb7 planned ",(0,F.jsx)("strong",{children:(0,w.IE)(t)})]})]}),(0,F.jsx)("span",{className:"cdp-seq-diff-tag",children:r>0?"+".concat(r):"".concat(r)})]},"diff-".concat(a.sequenceStep))},{sum:j,totalSteps:g,totalProfit:f,isLoss:N,deviations:b,delivered:y,skipped:k,stepDeltaPct:_,score:M,scoreColor:C,scoreLabel:z,firstDelivery:A,lastDelivery:P,activeMin:E,avgPerStop:D,avgSpeed:L,bestStep:q,worstStep:I,outOfOrderSteps:O,seqRuns:R,tripList:T}=p;return(0,F.jsxs)("aside",{id:"compare-data-panel",className:"compare-data-panel",children:[(0,F.jsxs)("div",{className:"cdp-head",children:[(0,F.jsxs)("div",{className:"cdp-head-title",children:[(0,F.jsx)("span",{className:"cdp-rider-dot",style:{background:s.color}}),(0,F.jsxs)("div",{className:"cdp-head-text",children:[(0,F.jsx)("div",{className:"cdp-rider-name",children:s.riderName}),(0,F.jsx)("div",{className:"cdp-head-badge",children:"PLANNED vs ACTUAL"})]})]}),(0,F.jsx)("button",{type:"button",className:"cdp-close",onClick:m,title:"Exit compare","aria-label":"Exit compare",children:(0,F.jsx)(S.m6K,{})})]}),(0,F.jsxs)("div",{className:"cdp-scroll",children:[(0,F.jsx)("section",{className:"cdp-section cdp-score-section",children:(0,F.jsxs)("div",{className:"cdp-score-wrap",children:[(0,F.jsx)("div",{className:"cdp-score-ring",style:{background:"conic-gradient(".concat(C," ").concat(3.6*M,"deg, rgba(15,23,42,0.08) 0deg)")},children:(0,F.jsxs)("div",{className:"cdp-score-inner",children:[(0,F.jsx)("div",{className:"cdp-score-value",style:{color:C},children:M}),(0,F.jsx)("div",{className:"cdp-score-unit",children:"/100"})]})}),(0,F.jsxs)("div",{className:"cdp-score-body",children:[(0,F.jsx)("div",{className:"cdp-score-label",style:{color:C},children:z}),(0,F.jsx)("div",{className:"cdp-score-title",children:"Compliance score"}),(0,F.jsxs)("div",{className:"cdp-score-sub",children:[y,"/",a.length," delivered",j.anomalies>0?" \xb7 ".concat(j.anomalies," deviation").concat(j.anomalies>1?"s":""):"",j.late>0?" \xb7 ".concat(j.late," late"):"",k>0?" \xb7 ".concat(k," skipped"):""]})]})]})}),(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.Zs6,{})}),(0,F.jsx)("span",{className:"cdp-section-title",children:"Day overview"})]}),(0,F.jsxs)("div",{className:"cdp-tiles",children:[(0,F.jsxs)("div",{className:"cdp-tile",children:[(0,F.jsxs)("div",{className:"cdp-tile-label",children:[(0,F.jsx)(S.xI$,{})," Distance"]}),(0,F.jsxs)("div",{className:"cdp-tile-value",children:[j.actualKm.toFixed(1),(0,F.jsx)("span",{className:"cdp-tile-unit",children:"km"})]}),(0,F.jsxs)("div",{className:"cdp-tile-sub",children:["planned ",j.plannedKm.toFixed(1)," km"]})]}),(0,F.jsxs)("div",{className:"cdp-tile".concat(j.anomalies>0?" is-warn":""),children:[(0,F.jsxs)("div",{className:"cdp-tile-label",children:[(0,F.jsx)(S.Wux,{})," Deviation"]}),(0,F.jsx)("div",{className:"cdp-tile-value ".concat(_),children:null!=j.kmDeltaPct?"".concat(j.kmDeltaPct>0?"+":"").concat(j.kmDeltaPct.toFixed(0),"%"):"\u2014"}),(0,F.jsx)("div",{className:"cdp-tile-sub",children:j.anomalies>0?"".concat(j.anomalies," flagged"):"within plan"})]}),(0,F.jsxs)("div",{className:"cdp-tile".concat(j.late>0?" is-warn":""),children:[(0,F.jsxs)("div",{className:"cdp-tile-label",children:[(0,F.jsx)(S.VP9,{})," On-time"]}),(0,F.jsxs)("div",{className:"cdp-tile-value",children:[j.onTime,g>0&&(0,F.jsxs)("span",{className:"cdp-tile-unit",children:["/",g]})]}),(0,F.jsx)("div",{className:"cdp-tile-sub",children:j.late>0?"".concat(j.late," late"):"all on schedule"})]}),(0,F.jsxs)("div",{className:"cdp-tile ".concat(N?"is-loss":"is-gain"),children:[(0,F.jsxs)("div",{className:"cdp-tile-label",children:[N?(0,F.jsx)(S.Rod,{}):(0,F.jsx)(S.imn,{})," ",N?"Loss":"Profit"]}),(0,F.jsxs)("div",{className:"cdp-tile-value",children:[N?"-":"","\u20b9",Math.abs(f).toFixed(0)]}),(0,F.jsxs)("div",{className:"cdp-tile-sub",children:[s.orders.length," ",1===s.orders.length?"order":"orders"," \xb7 ",y," delivered"]})]})]})]}),a.length>0&&(0,F.jsxs)("section",{className:"cdp-section cdp-seq-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head cdp-section-head-clickable",onClick:()=>d((e=>!e)),role:"button","aria-expanded":c,title:c?"Collapse route sequence":"Expand route sequence",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.$G1,{})}),(0,F.jsx)("span",{className:"cdp-section-title",children:"Route sequence"}),(0,F.jsx)("span",{className:"cdp-seq-status".concat(O.length>0?" is-warn":" is-good"),children:O.length>0?"".concat(O.length," out of order"):"In order"}),(0,F.jsx)("span",{className:"cdp-seq-toggle".concat(c?" is-open":""),children:(0,F.jsx)(S.j1Q,{})})]}),c&&(0,F.jsx)("div",{className:"cdp-seq",children:O.length>0?(0,F.jsx)("ul",{className:"cdp-seq-diffs",children:R.map(((e,s)=>{if(1===e.items.length)return v(e.items[0]);const a=e.items[0],t=e.items[e.items.length-1],i=o.has(s),l=e.delta>0?"+".concat(e.delta):"".concat(e.delta),c=e.items.some((e=>e.d.sequenceStep===n));return(0,F.jsxs)(r.Fragment,{children:[(0,F.jsxs)("li",{className:"cdp-seq-diff is-group".concat(i?" is-expanded":"").concat(c?" is-focused":""),onClick:()=>{return e=s,void u((s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a}));var e},"aria-expanded":i,children:[(0,F.jsxs)("span",{className:"cdp-seq-group-num",children:[(0,F.jsx)("span",{className:"cdp-seq-group-num-bg",style:{background:"linear-gradient(135deg, ".concat((0,w.gM)((a.planned||1)-1),", ").concat((0,w.gM)((t.planned||1)-1),")")}}),(0,F.jsxs)("span",{className:"cdp-seq-group-num-label",children:[e.items.length,"\xd7"]})]}),(0,F.jsxs)("div",{className:"cdp-seq-diff-body",children:[(0,F.jsxs)("div",{className:"cdp-seq-diff-title",children:[e.items.length," consecutive steps shifted"," ",(0,F.jsx)("span",{className:"cdp-seq-group-delta",children:l})]}),(0,F.jsxs)("div",{className:"cdp-seq-diff-sub",children:["Planned ",(0,w.IE)(a.planned),"\u2013",(0,w.IE)(t.planned)," ","visited"," ",(0,F.jsxs)("strong",{children:[(0,w.IE)(a.actualPos),"\u2013",(0,w.IE)(t.actualPos)]})]})]}),(0,F.jsx)("span",{className:"cdp-seq-diff-tag",children:l}),(0,F.jsx)("span",{className:"cdp-seq-group-toggle".concat(i?" is-open":""),"aria-hidden":"true",children:(0,F.jsx)(S.j1Q,{})})]}),i&&(0,F.jsx)("li",{className:"cdp-seq-group-children-wrap",children:(0,F.jsx)("ul",{className:"cdp-seq-group-children",children:e.items.map((e=>v(e,!1)))})})]},"run-".concat(s,"-").concat(a.d.sequenceStep))}))}):(0,F.jsxs)("div",{className:"cdp-seq-good",children:[(0,F.jsx)(S.mU9,{})," Rider followed the planned route in order."]})})]}),(A||P)&&(0,F.jsxs)("section",{className:"cdp-section cdp-timing-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.pWE,{})}),(0,F.jsx)("span",{className:"cdp-section-title",children:"Timing"}),E>0&&(0,F.jsxs)("span",{className:"cdp-timing-active-tag",children:[(0,F.jsx)("span",{className:"cdp-timing-active-pulse"}),"Day window"]})]}),(0,F.jsxs)("div",{className:"cdp-timing-clock",children:[(0,F.jsxs)("div",{className:"cdp-clock-card is-start",children:[(0,F.jsxs)("div",{className:"cdp-clock-label",children:[(0,F.jsx)(S.WVj,{})," First delivery"]}),(0,F.jsxs)("div",{className:"cdp-clock-face",children:[(0,F.jsx)("span",{className:"cdp-clock-time",children:A?A.format("hh:mm"):"\u2014"}),(0,F.jsx)("span",{className:"cdp-clock-period",children:A?A.format("A"):""})]}),(0,F.jsx)("div",{className:"cdp-clock-caption",children:"Started"})]}),(0,F.jsxs)("div",{className:"cdp-clock-track","aria-hidden":"true",children:[(0,F.jsx)("span",{className:"cdp-clock-track-line"}),(0,F.jsx)("span",{className:"cdp-clock-track-dot is-start"}),(0,F.jsx)("span",{className:"cdp-clock-track-dot is-end"}),(0,F.jsxs)("div",{className:"cdp-clock-duration",children:[(0,F.jsx)("span",{className:"cdp-clock-duration-icon",children:(0,F.jsx)(S.DZH,{})}),(0,F.jsx)("span",{className:"cdp-clock-duration-val",children:E>0?E>=60?"".concat(Math.floor(E/60),"h ").concat(E%60,"m"):"".concat(E,"m"):"\u2014"}),(0,F.jsx)("span",{className:"cdp-clock-duration-sub",children:"active"})]})]}),(0,F.jsxs)("div",{className:"cdp-clock-card is-end",children:[(0,F.jsxs)("div",{className:"cdp-clock-label",children:[(0,F.jsx)(S.mU9,{})," Last delivery"]}),(0,F.jsxs)("div",{className:"cdp-clock-face",children:[(0,F.jsx)("span",{className:"cdp-clock-time",children:P?P.format("hh:mm"):"\u2014"}),(0,F.jsx)("span",{className:"cdp-clock-period",children:P?P.format("A"):""})]}),(0,F.jsx)("div",{className:"cdp-clock-caption",children:"Finished"})]})]}),(0,F.jsxs)("div",{className:"cdp-timing-stats",children:[(0,F.jsxs)("div",{className:"cdp-timing-stat",children:[(0,F.jsxs)("div",{className:"cdp-timing-stat-head",children:[(0,F.jsx)("div",{className:"cdp-timing-stat-icon",children:(0,F.jsx)(S.VP9,{})}),(0,F.jsxs)("div",{className:"cdp-timing-stat-body",children:[(0,F.jsxs)("div",{className:"cdp-timing-stat-value",children:[D>0?"".concat(D):"\u2014",D>0&&(0,F.jsx)("span",{className:"cdp-timing-stat-unit",children:"min"})]}),(0,F.jsx)("div",{className:"cdp-timing-stat-label",children:"Avg / stop"})]})]}),a.length>0&&(0,F.jsxs)("div",{className:"cdp-timing-stat-viz cdp-stops-dots","aria-hidden":"true",children:[Array.from({length:Math.min(a.length,12)}).map(((e,s)=>(0,F.jsx)("span",{className:"cdp-stop-dot"},"dot-".concat(s)))),(0,F.jsxs)("span",{className:"cdp-timing-stat-viz-label",children:[a.length," stop",1===a.length?"":"s"]})]})]}),null!=L&&(0,F.jsxs)("div",{className:"cdp-timing-stat",children:[(0,F.jsxs)("div",{className:"cdp-timing-stat-head",children:[(0,F.jsx)("div",{className:"cdp-timing-stat-icon",children:(0,F.jsx)(S.BJM,{})}),(0,F.jsxs)("div",{className:"cdp-timing-stat-body",children:[(0,F.jsxs)("div",{className:"cdp-timing-stat-value",children:[L,(0,F.jsx)("span",{className:"cdp-timing-stat-unit",children:"km/h"})]}),(0,F.jsx)("div",{className:"cdp-timing-stat-label",children:"Avg speed"})]})]}),(0,F.jsxs)("div",{className:"cdp-timing-stat-viz cdp-speed-gauge","aria-hidden":"true",children:[(0,F.jsx)("div",{className:"cdp-speed-gauge-track",children:(0,F.jsx)("div",{className:"cdp-speed-gauge-fill",style:{width:"".concat(Math.min(100,parseFloat(L)/60*100),"%")}})}),(0,F.jsxs)("div",{className:"cdp-speed-gauge-scale",children:[(0,F.jsx)("span",{children:"0"}),(0,F.jsx)("span",{children:"30"}),(0,F.jsx)("span",{children:"60 km/h"})]})]})]})]})]}),(q||I)&&(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.SeC,{})}),(0,F.jsx)("span",{className:"cdp-section-title",children:"Highlights"})]}),(0,F.jsxs)("div",{className:"cdp-highlights",children:[q&&(0,F.jsxs)("div",{className:"cdp-highlight is-best",onClick:()=>x(q.sequenceStep),role:"button",title:"Focus this step",children:[(0,F.jsx)("span",{className:"cdp-highlight-rail","aria-hidden":"true"}),(0,F.jsxs)("div",{className:"cdp-highlight-content",children:[(0,F.jsxs)("div",{className:"cdp-highlight-top",children:[(0,F.jsxs)("span",{className:"cdp-highlight-label",children:[(0,F.jsx)("span",{className:"cdp-highlight-chip",children:(0,F.jsx)(S.mU9,{})}),"Fastest stop"]}),(0,F.jsxs)("span",{className:"cdp-highlight-step-chip",style:{background:(0,w.gM)(q.sequenceStep-1)},children:["Step ",q.sequenceStep]})]}),(0,F.jsx)("div",{className:"cdp-highlight-title",children:q.deliverycustomer||"Step ".concat(q.sequenceStep)}),(0,F.jsx)("div",{className:"cdp-highlight-meta",children:(0,F.jsx)("span",{className:"cdp-highlight-pill is-good",children:null!=q.timeDeltaMin?0===q.timeDeltaMin?"On schedule":"".concat(q.timeDeltaMin>0?"+":"").concat(q.timeDeltaMin," min vs plan"):"On schedule"})})]})]}),I&&(0,F.jsxs)("div",{className:"cdp-highlight is-worst",onClick:()=>x(I.sequenceStep),role:"button",title:"Focus this step",children:[(0,F.jsx)("span",{className:"cdp-highlight-rail","aria-hidden":"true"}),(0,F.jsxs)("div",{className:"cdp-highlight-content",children:[(0,F.jsxs)("div",{className:"cdp-highlight-top",children:[(0,F.jsxs)("span",{className:"cdp-highlight-label",children:[(0,F.jsx)("span",{className:"cdp-highlight-chip",children:(0,F.jsx)(S.Wux,{})}),"Biggest deviation"]}),(0,F.jsxs)("span",{className:"cdp-highlight-step-chip",style:{background:(0,w.gM)(I.sequenceStep-1)},children:["Step ",I.sequenceStep]})]}),(0,F.jsx)("div",{className:"cdp-highlight-title",children:I.deliverycustomer||"Step ".concat(I.sequenceStep)}),(0,F.jsxs)("div",{className:"cdp-highlight-meta",children:[null!=I.kmDeltaPct&&(0,F.jsxs)("span",{className:"cdp-highlight-pill is-bad",children:[I.kmDeltaPct>0?"+":"",I.kmDeltaPct.toFixed(0),"% route"]}),null!=I.timeDeltaMin&&I.timeDeltaMin>0&&(0,F.jsxs)("span",{className:"cdp-highlight-pill is-bad",children:["+",I.timeDeltaMin,"m late"]})]})]})]})]})]}),T.length>1&&(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.$G1,{})}),(0,F.jsxs)("span",{className:"cdp-section-title",children:["Trips (",T.length,")"]})]}),(0,F.jsx)("div",{className:"cdp-trips",children:T.map((e=>{const s=e.profit<0;return(0,F.jsxs)("div",{className:"cdp-trip",children:[(0,F.jsxs)("div",{className:"cdp-trip-head",children:[(0,F.jsxs)("span",{className:"cdp-trip-badge",children:["Trip ",e.tNum]}),(0,F.jsxs)("span",{className:"cdp-trip-meta",children:[e.delivered,"/",e.count," delivered"]})]}),(0,F.jsxs)("div",{className:"cdp-trip-stats",children:[(0,F.jsxs)("span",{title:"Distance",children:[(0,F.jsx)(S.xI$,{}),e.actualKm.toFixed(1),"km",(0,F.jsxs)("small",{children:[" / ",e.plannedKm.toFixed(1)]})]}),(0,F.jsxs)("span",{className:s?"is-over":"",title:s?"Loss":"Profit",children:[(0,F.jsx)(S.ohY,{}),s?"-":"","\u20b9",Math.abs(e.profit).toFixed(0)]})]})]},"trip-".concat(e.tNum))}))})]}),h&&(e=>{const s=(0,w.gM)(h.sequenceStep-1),a=h.kmDelta>=0?"+":"",t=h.anomaly?"is-over":h.kmDelta<-.1?"is-under":"",i=null!=h.timeDeltaMin?h.timeDeltaMin>10?"is-over":h.timeDeltaMin<-2?"is-under":"":"",r=(0,w.Cx)(h.orderstatus),n=parseFloat((null===(e=h.order)||void 0===e?void 0:e.profit)||0);return(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.$G1,{})}),(0,F.jsxs)("span",{className:"cdp-section-title",children:["Step ",h.sequenceStep," details"]}),(0,F.jsx)("button",{type:"button",className:"cdp-section-clear",onClick:()=>l(null),title:"Clear step focus",children:"Show all"})]}),(0,F.jsxs)("div",{className:"compare-delta".concat(h.anomaly?" is-anomaly":""),children:[(0,F.jsxs)("div",{className:"compare-delta-title",children:[(0,F.jsx)("span",{className:"compare-delta-step-badge",style:{background:s},children:h.sequenceStep}),(0,F.jsxs)("div",{className:"compare-delta-title-text",children:[(0,F.jsx)("div",{className:"compare-delta-title-main",children:h.deliverycustomer||"Step ".concat(h.sequenceStep)}),(0,F.jsxs)("div",{className:"compare-delta-title-sub",children:[h.pickupcustomer?"from ".concat(h.pickupcustomer," \xb7 "):"","Order #",h.orderid]})]}),h.orderstatus&&(0,F.jsx)("span",{className:"compare-delta-status",style:{background:r.bg,color:r.fg},children:r.label})]}),(0,F.jsxs)("div",{className:"compare-delta-grid",children:[(0,F.jsxs)("div",{className:"compare-delta-cell".concat(h.anomaly?" is-anomaly":""),children:[(0,F.jsx)("span",{className:"compare-delta-cell-label",children:"Distance"}),(0,F.jsxs)("span",{className:"compare-delta-cell-val",children:[h.actualKm.toFixed(2)," ",(0,F.jsx)("span",{className:"compare-delta-cell-unit",children:"km"})]}),(0,F.jsxs)("span",{className:"compare-delta-cell-sub",children:["planned ",h.plannedKm.toFixed(2)," km"]})]}),(0,F.jsxs)("div",{className:"compare-delta-cell",children:[(0,F.jsx)("span",{className:"compare-delta-cell-label",children:"\u0394 Route"}),(0,F.jsxs)("span",{className:"compare-delta-cell-val ".concat(t),children:[a,h.kmDelta.toFixed(2)," km"]}),(0,F.jsx)("span",{className:"compare-delta-cell-sub",children:null!=h.kmDeltaPct?"".concat(a).concat(h.kmDeltaPct.toFixed(0),"% vs plan"):"no planned km"})]}),(0,F.jsxs)("div",{className:"compare-delta-cell",children:[(0,F.jsx)("span",{className:"compare-delta-cell-label",children:"Time"}),(0,F.jsx)("span",{className:"compare-delta-cell-val ".concat(i),children:null!=h.timeDeltaMin?"".concat(h.timeDeltaMin>0?"+":"").concat(h.timeDeltaMin," min"):"\u2014"}),(0,F.jsx)("span",{className:"compare-delta-cell-sub",children:h.actualTs&&h.expectedTs?"".concat(h.actualTs.format("HH:mm")," vs ").concat(h.expectedTs.format("HH:mm")):h.actualTs?"delivered ".concat(h.actualTs.format("HH:mm")):"in flight"})]}),!Number.isNaN(n)&&0!==n&&(0,F.jsxs)("div",{className:"compare-delta-cell".concat(n<0?" is-anomaly":""),children:[(0,F.jsx)("span",{className:"compare-delta-cell-label",children:n<0?"Loss":"Profit"}),(0,F.jsxs)("span",{className:"compare-delta-cell-val ".concat(n<0?"is-over":"is-under"),children:[n<0?"-":"","\u20b9",Math.abs(n).toFixed(0)]}),(0,F.jsx)("span",{className:"compare-delta-cell-sub",children:"order revenue"})]})]})]})]})})(),b.length>0&&(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon cdp-icon-warn",children:(0,F.jsx)(S.ItP,{})}),(0,F.jsxs)("span",{className:"cdp-section-title",children:["Deviations (",b.length,")"]})]}),(0,F.jsx)("ul",{className:"cdp-dev-list",children:b.map((e=>{const s=(0,w.gM)(e.sequenceStep-1),a=e.kmDelta>=0?"+":"";return(0,F.jsxs)("li",{className:"cdp-dev-item".concat(n===e.sequenceStep?" is-focused":""),onClick:()=>x(e.sequenceStep),children:[(0,F.jsx)("span",{className:"cdp-dev-num",style:{background:s},children:e.sequenceStep}),(0,F.jsxs)("div",{className:"cdp-dev-body",children:[(0,F.jsx)("div",{className:"cdp-dev-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),(0,F.jsxs)("div",{className:"cdp-dev-meta",children:[null!=e.kmDeltaPct&&(0,F.jsxs)("span",{className:"cdp-dev-chip is-over",children:[a,e.kmDeltaPct.toFixed(0),"% route"]}),null!=e.timeDeltaMin&&e.timeDeltaMin>10&&(0,F.jsxs)("span",{className:"cdp-dev-chip is-over",children:["+",e.timeDeltaMin,"m late"]})]})]})]},"dev-".concat(e.sequenceStep))}))})]}),(0,F.jsxs)("section",{className:"cdp-section",children:[(0,F.jsxs)("div",{className:"cdp-section-head",children:[(0,F.jsx)("span",{className:"cdp-section-icon",children:(0,F.jsx)(S.EgJ,{})}),(0,F.jsxs)("span",{className:"cdp-section-title",children:["Steps (",a.length,")"]}),(0,F.jsxs)("span",{className:"cdp-section-sub",children:[y,"/",a.length," delivered"]})]}),(0,F.jsx)("ul",{className:"cdp-step-list",children:a.map((e=>{var s;const a=(0,w.gM)(e.sequenceStep-1),t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),r=w.yP.has(t),l=i&&!e.anomaly,c=n===e.sequenceStep,d=(0,w.Cx)(e.orderstatus),o=parseFloat((null===(s=e.order)||void 0===s?void 0:s.profit)||0),u=e.kmDelta>=0?"+":"",m=null!=e.timeDeltaMin?e.timeDeltaMin>10?"is-over":e.timeDeltaMin<-2?"is-under":"":"",p=["cdp-step",c?"is-focused":"",e.anomaly?"is-anomaly":"",l?"is-correct":"",r?"is-skipped":"",e.isLoading?"is-loading":""].filter(Boolean).join(" ");return(0,F.jsxs)("li",{className:p,onClick:()=>x(e.sequenceStep),children:[(0,F.jsxs)("span",{className:"cdp-step-num",style:{background:a},children:[e.sequenceStep,l&&(0,F.jsx)("span",{className:"cdp-step-check",children:(0,F.jsx)(S.mU9,{})}),e.anomaly&&(0,F.jsx)("span",{className:"cdp-step-flag",children:(0,F.jsx)(S.ItP,{})})]}),(0,F.jsxs)("div",{className:"cdp-step-body",children:[(0,F.jsxs)("div",{className:"cdp-step-title-row",children:[(0,F.jsx)("span",{className:"cdp-step-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),e.orderstatus&&(0,F.jsx)("span",{className:"cdp-step-status",style:{background:d.bg,color:d.fg},children:d.label})]}),(0,F.jsxs)("div",{className:"cdp-step-sub",children:[e.pickupcustomer?"from ".concat(e.pickupcustomer," \xb7 "):"","Order #",e.orderid]}),(0,F.jsxs)("div",{className:"cdp-step-deltas",children:[(0,F.jsxs)("span",{className:"cdp-step-delta",title:"Distance",children:[(0,F.jsx)(S.xI$,{}),e.actualKm.toFixed(1),"km",e.plannedKm>0&&(0,F.jsxs)("small",{className:e.anomaly?"is-over":"",children:[" ",u,e.kmDelta.toFixed(1)]})]}),(0,F.jsxs)("span",{className:"cdp-step-delta ".concat(m),title:"Delivery time",children:[(0,F.jsx)(S.VP9,{}),e.actualTs?e.actualTs.format("HH:mm"):"\u2014",null!=e.timeDeltaMin&&(0,F.jsxs)("small",{children:[" ",e.timeDeltaMin>0?"+":"",e.timeDeltaMin,"m"]})]}),!Number.isNaN(o)&&0!==o&&(0,F.jsxs)("span",{className:"cdp-step-delta".concat(o<0?" is-over":""),title:o<0?"Loss":"Profit",children:[(0,F.jsx)(S.ohY,{}),o<0?"-":"","\u20b9",Math.abs(o).toFixed(0)]})]})]})]},"step-".concat(e.sequenceStep))}))})]})]})]})};var C=a(85571);const z=["_ts"],A="#6366f1",P="#10b981",E=e=>{const s=parseFloat(e);return Number.isFinite(s)?s:NaN},D=e=>{if(!e)return"";const s=String(e).trim();if(!s)return"";if(s.includes(",")){const e=s.split(",").map((e=>e.trim())).filter(Boolean);return 0===e.length?s:e.length<=2?e.join(", "):e.slice(-2).join(", ")}const a=s.split(/\s+/).filter(Boolean),t=a.length>6?a.slice(-6).join(" "):s;return t.length>40?"".concat(t.slice(0,40).trim(),"\u2026"):t},L=e=>Number.isFinite(E(e.droplat||e.deliverylat))&&Number.isFinite(E(e.droplon||e.deliverylong)),q=e=>e.pickuplat||e.pickuplatitude||e.pickup_lat,I=e=>e.pickuplong||e.pickuplongitude||e.picklongitude||e.pickup_lon,O=e=>Number.isFinite(E(q(e)))&&Number.isFinite(E(I(e))),R=[{id:"morning",name:"Morning Batch",startHour:0,endHour:8},{id:"afternoon",name:"Afternoon Batch",startHour:9,endHour:12.5},{id:"evening",name:"Evening Batch",startHour:16,endHour:19}],T="dispatch.slots.v9",H=["dispatch.slots.v1","dispatch.slots.v2","dispatch.slots.v3","dispatch.slots.v4","dispatch.slots.v5","dispatch.slots.v6","dispatch.slots.v7","dispatch.slots.v8"],Y=(e,s)=>"Slot ".concat(e+1," \xb7 ").concat(V(s)),V=e=>{const s=Math.floor(e),a=Math.round(60*(e-s)),t=(s+11)%12+1,i=s>=12&&s<24?"PM":"AM";if(0===a)return"".concat(t," ").concat(i);const r=String(a).padStart(2,"0");return"".concat(t,":").concat(r," ").concat(i)},K=(e,s)=>s>=24?"After ".concat(V(e)):"".concat(V(e),"\u2013").concat(V(s)),B=R.map(((e,s)=>(0,i.A)((0,i.A)({},e),{},{label:e.name||Y(s,e.startHour),range:K(e.startHour,e.endHour)}))),U=(e,s)=>{for(const a of s)if(e>=a.startHour&&e2&&void 0!==arguments[2]?arguments[2]:B;const a=((e,s)=>{const a=G.find((e=>e.id===s))||G[0];for(const t of a.keys)if(null!==e&&void 0!==e&&e[t])return e[t];return null})(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all");if(!a)return null;const t=String(a).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(t))return null;const i=g()(a);return i.isValid()?U(i.hour()+i.minute()/60,s):null};function W(e){let{targetRef:s}=e;const a=(0,n.ko)();return(0,r.useEffect)((()=>(s.current=a,()=>{s.current=null})),[a]),null}function $(e,s){const a=e=>e*Math.PI/180,t=a(e[0]),i=a(s[0]),r=a(s[0]-e[0]),n=a(s[1]-e[1]),l=Math.sin(r/2)**2+Math.cos(t)*Math.cos(i)*Math.sin(n/2)**2;return 12742*Math.asin(Math.min(1,Math.sqrt(l)))}function Z(e){if(!Array.isArray(e)||e.length<2)return 0;let s=0;for(let a=1;a{let a=0,t=1/0;for(let i=0;i{const a=Math.max(s,i);t.push(e.slice(i,a+1)),i=a})),t}const Q=e=>{if(!e)return null;const s=g()(e);return s.isValid()?s.format("HH:mm:ss"):String(e)},ee=[{key:"assigntime",label:"Assigned"},{key:"acceptedtime",label:"Accepted"},{key:"arrivaltime",label:"Arrived"},{key:"pickuptime",label:"Pickup"},{key:"starttime",label:"Started"},{key:"deliverytime",label:"Delivered",final:!0}],se=e=>{const s=e.filter(L);if(!s.length)return[];const a=e.find(O),t=[];return a&&t.push([E(q(a)),E(I(a))]),s.forEach((e=>t.push([E(e.droplat||e.deliverylat),E(e.droplon||e.deliverylong)]))),t},ae=(e,s,a)=>{if(!a||0===a.length)return"".concat(e,"-").concat(s);const t=a.map((e=>"".concat(e[0].toFixed(5),",").concat(e[1].toFixed(5)))).join("|");return"".concat(e,"-").concat(s,"-").concat(t)};delete x().Icon.Default.prototype._getIconUrl,x().Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const te=["#0055FF","#00D82C","#FF6B00","#9D00FF","#FF00A8","#00C2B2","#FF9900","#FF0000"],ie=e=>{const s=String(null!==e&&void 0!==e?e:"");if(!s)return te[0];let a=0;for(let t=0;t>>0;return te[a%te.length]},re=e=>{let{focusedItem:s,viewMode:a,orders:t,kitchens:i,locationKey:l}=e;const c=(0,n.ko)(),d=(0,r.useRef)(""),o=(0,r.useMemo)((()=>{const e=null!=l?"loc:".concat(l,"|"):"",r=e=>{let s=0,a=0,t=0;for(const i of e)Number.isFinite(i[0])&&Number.isFinite(i[1])&&(s+=i[0],a+=i[1],t+=1);return 0===t?"0":"".concat((s/t).toFixed(1),",").concat((a/t).toFixed(1))};if(s){var n,c,d;const a=null!==(n=null!==(c=null!==(d=s.id)&&void 0!==d?d:s.kitchenName)&&void 0!==c?c:s.name)&&void 0!==n?n:null!=s.lat?"".concat(s.lat,",").concat(s.lon):"item",t=s.orders?s.orders.length:0;return"".concat(e,"f|").concat(a,"|").concat(t)}const o=(i||[]).map((e=>[e.lat,e.lon])),u=r(o);if("kitchens"===a){const s=o.filter((e=>Number.isFinite(e[0])&&Number.isFinite(e[1]))).length;return"".concat(e,"k|").concat(s,"|").concat(u)}if("all"===a){const s=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]));return"".concat(e,"a|").concat(s.length,"|").concat(r(s))}return"".concat(e,"m|").concat(a||"","|").concat(o.length,"|").concat(u)}),[s,a,t,i,l]);return(0,r.useEffect)((()=>{if(d.current===o)return;let e=[];s?s.orders?(e=s.orders.map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])),s.orders.forEach((s=>e.push([E(q(s)),E(I(s))])))):e=[[s.lat,s.lon]]:"kitchens"===a?(e=(i||[]).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).map((e=>[e.lat,e.lon])),0===e.length&&(e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])))):"all"===a?e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])):(e=(i||[]).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).map((e=>[e.lat,e.lon])),0===e.length&&(e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]))));const r=e.filter((e=>Number.isFinite(e[0])&&Number.isFinite(e[1])));if(r.length>0){const e=x().latLngBounds(r);if(e.isValid()){1===r.length||e.getNorthEast().equals(e.getSouthWest())?c.setView(r[0],15,{animate:!0,duration:.6}):c.flyToBounds(e,{padding:[60,60],duration:.6,maxZoom:16}),d.current=o}}else;}),[o,s,a,t,i,c]),null},ne=e=>{let{children:s}=e;return(0,F.jsx)("span",{className:"ico-inline",style:{display:"inline-flex",alignItems:"center",verticalAlign:"-2px",marginRight:4},children:s})},le=[{key:"morning",label:"Morning",timeRange:"12:00 AM \u2013 8:00 AM",sub:"Early shift orders",color:"#f59e0b",bg:"#fffbeb",border:"#fde68a"},{key:"afternoon",label:"Noon",timeRange:"9:00 AM \u2013 12:30 PM",sub:"Lunch rush window",color:"#10b981",bg:"#ecfdf5",border:"#a7f3d0"},{key:"evening",label:"Evening",timeRange:"4:00 PM \u2013 7:00 PM",sub:"Dinner & end-of-day",color:"#6366f1",bg:"#eef2ff",border:"#c7d2fe"}],ce=e=>{if(null==e)return"\u2014";if("number"===typeof e)return e.toLocaleString("en-IN");const s=parseFloat(e);return Number.isFinite(s)?s.toLocaleString("en-IN"):String(e)},de=e=>{if(!e||"string"!==typeof e)return null;const s=e.split(":").map(Number);if(s.length<2||s.some((e=>!Number.isFinite(e))))return null;const[a,t,i=0]=s;return 3600*a+60*t+i},oe=e=>{let{data:s,embedded:a=!1,selectedRiderId:n,onRiderSelect:h,pulseOrderId:v,onChangeRider:j}=e;const V=null!==s&&void 0!==s&&s.zones&&s.zones.length>0?"zones":"riders",[G,oe]=(0,r.useState)(V),[ue,me]=(0,r.useState)("live"),[pe,he]=(0,r.useState)({}),[xe,ve]=(0,r.useState)(null),[je,ge]=(0,r.useState)(null),[fe,Ne]=(0,r.useState)(null);(0,r.useEffect)((()=>{if(!fe)return;const e=e=>{"Escape"===e.key&&Ne(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[fe]);const be=(0,f.n)({mutationFn:_.W0,onMutate:e=>ve(e.batch),onSuccess:(e,s)=>{he((a=>(0,i.A)((0,i.A)({},a),{},{[s.batch]:{data:e,fetchedAt:g()().format("HH:mm:ss")}})))},onSettled:()=>ve(null)}),ye=e=>{ge(e);const s=pe[e];s&&s.data&&!1!==s.data.success||be.mutate({batch:e,tenantId:916})},ke=15e3,Se=(0,r.useRef)(null);(0,r.useEffect)((()=>{Se.current=xe}),[xe]),(0,r.useEffect)((()=>{if("analysis"!==ue)return;if(!je)return;const e=setInterval((()=>{Se.current||"undefined"!==typeof document&&document.hidden||be.mutate({batch:je,tenantId:916})}),ke);return()=>clearInterval(e)}),[ue,je]);const[_e,we]=(0,r.useState)(new Set),[Fe,Me]=(0,r.useState)(null),[Ce,ze]=(0,r.useState)(null),[Ae,Pe]=(0,r.useState)(null),[Ee,De]=(0,r.useState)(null),[Le,qe]=(0,r.useState)("planned"),Ie=(0,r.useRef)({}),Oe=(0,r.useRef)(new Set),Re=(0,r.useRef)(new Set),Te=((0,r.useRef)(null),(0,r.useRef)(null)),[He,Ye]=(0,r.useState)(null),Ve=void 0!==n,[Ke,Be]=(0,r.useState)(""),{data:Ue}=(0,N.I)({queryKey:["appLocations"],queryFn:_.aL,staleTime:3e5}),Ge="undefined"!==typeof window?localStorage.getItem("applocationid"):null,[Je,We]=(0,r.useState)(null!=Ge?Number(Ge):0),[$e,Ze]=(0,r.useState)(!1),Xe=(0,r.useRef)(null),[Qe,es]=(0,r.useState)("assigned"),[ss,as]=(0,r.useState)(!1),ts=(0,r.useRef)(null),[is,rs]=(0,r.useState)((()=>{if("undefined"===typeof window)return B;try{const e=window.localStorage.getItem(T);if(!e)return B;const s=JSON.parse(e);return Array.isArray(s)&&s.length===R.length?s.map(((e,s)=>{const a=e.id||"slot-".concat(s+1),t=Number(e.startHour)||0,i=Number(e.endHour)||24,r=B.find((e=>e.id===a));return{id:a,startHour:t,endHour:i,label:(null===r||void 0===r?void 0:r.name)||Y(s,t),range:K(t,i)}})):B}catch(e){return B}})),ns=is,[ls,cs]=(0,r.useState)(!1),ds=(0,r.useRef)(null);(0,r.useEffect)((()=>{if("undefined"!==typeof window)try{H.forEach((e=>window.localStorage.removeItem(e)))}catch(e){}}),[]);const os=(0,r.useRef)(!1);(0,r.useEffect)((()=>{if(os.current){if("undefined"!==typeof window)try{window.localStorage.setItem(T,JSON.stringify(is.map((e=>{let{id:s,startHour:a,endHour:t}=e;return{id:s,startHour:a,endHour:t}}))))}catch(e){}}else os.current=!0}),[is]),(0,r.useEffect)((()=>{if(!$e)return;const e=e=>{Xe.current&&!Xe.current.contains(e.target)&&Ze(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[$e]),(0,r.useEffect)((()=>{if(!ss)return;const e=e=>{ts.current&&!ts.current.contains(e.target)&&as(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[ss]),(0,r.useEffect)((()=>{if(!ls)return;const e=e=>{ds.current&&!ds.current.contains(e.target)&&cs(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[ls]);const[us,ms]=(0,r.useState)(null),[ps,hs]=(0,r.useState)(""),{data:xs,isFetching:vs,isError:js,error:gs}=(0,N.I)({queryKey:["riderPeriodicLog",us],queryFn:()=>(0,_.ne)(us),enabled:"rider-info"===G&&null!=us,refetchInterval:"rider-info"===G&&null!=us&&15e3,refetchIntervalInBackground:!1,staleTime:5e3,refetchOnWindowFocus:!1}),fs=(0,r.useMemo)((()=>{const e=parseFloat(null===xs||void 0===xs?void 0:xs.latitude),s=parseFloat(null===xs||void 0===xs?void 0:xs.longitude);return Number.isFinite(e)&&Number.isFinite(s)?{lat:e.toFixed(4),lon:s.toFixed(4)}:null}),[null===xs||void 0===xs?void 0:xs.latitude,null===xs||void 0===xs?void 0:xs.longitude]),{data:Ns}=(0,N.I)({queryKey:["reverseGeocode",null===fs||void 0===fs?void 0:fs.lat,null===fs||void 0===fs?void 0:fs.lon],queryFn:async()=>{const e=await fetch("https://nominatim.openstreetmap.org/reverse?lat=".concat(fs.lat,"&lon=").concat(fs.lon,"&format=json&zoom=16&addressdetails=1"),{headers:{Accept:"application/json"}});if(!e.ok)return null;const s=await e.json(),a=(null===s||void 0===s?void 0:s.address)||{};return{area:a.suburb||a.neighbourhood||a.village||a.hamlet||a.city_district||a.town||a.city||a.county||a.state||"",display:(null===s||void 0===s?void 0:s.display_name)||""}},enabled:"rider-info"===G&&!!fs,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}),bs=(0,r.useMemo)((()=>{if(!Ue)return null;const e=Ue.find((e=>String(e.applocationid)===String(Je)));return(null===e||void 0===e?void 0:e.locationname)||null}),[Ue,Je]),[ys,ks]=(0,r.useState)({}),Ss=(0,r.useRef)({}),[_s,ws]=(0,r.useState)({}),Fs=(0,r.useRef)({}),[Ms,Cs]=(0,r.useState)(!1),[zs,As]=(0,r.useState)([]),[Ps,Es]=(0,r.useState)({}),Ds=(0,r.useRef)(!1),[Ls,qs]=(0,r.useState)(g()().format("YYYY-MM-DD")),[Is,Os]=(0,r.useState)(!1),[Rs,Ts]=(0,r.useState)((()=>g()(Ls).isValid()?g()(Ls).startOf("month"):g()().startOf("month"))),Hs=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(!Is)return;const e=e=>{Hs.current&&(Hs.current.contains(e.target)||Os(!1))},s=e=>{"Escape"===e.key&&Os(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",s)}}),[Is]),(0,r.useEffect)((()=>{if(Is){const e=g()(Ls);e.isValid()&&Ts(e.startOf("month"))}}),[Is,Ls]);const[Ys,Vs]=(0,r.useState)(!1),[Ks,Bs]=(0,r.useState)("combined"),[Us,Gs]=(0,r.useState)(!0),[Js,Ws]=(0,r.useState)(!0),[$s,Zs]=(0,r.useState)((()=>new Set)),Xs=(0,r.useRef)(!1),[Qs,ea]=(0,r.useState)(!1),sa=(0,r.useRef)(!1),aa=(0,r.useRef)(!1),[ta,ia]=(0,r.useState)(!1),[ra,na]=(0,r.useState)(null),la=(0,r.useRef)(null),ca=(0,r.useRef)(null);ca.current||(ca.current=x().canvas({padding:1.5,tolerance:5}));const{data:da}=(0,N.I)({queryKey:[Je,Ls,""],queryFn:_.zb,refetchInterval:15e3,refetchIntervalInBackground:!1,staleTime:5e3,refetchOnWindowFocus:!1}),oa=(0,r.useMemo)((()=>(da||[]).map((e=>{var s;const a=parseFloat(null===e||void 0===e?void 0:e.latitude),t=parseFloat(null===e||void 0===e?void 0:e.longitude);return Number.isFinite(a)&&Number.isFinite(t)?{id:String(null!==(s=e.userid)&&void 0!==s?s:""),userid:e.userid,username:e.username||"Rider #".concat(e.userid),status:String(e.status||"").toLowerCase(),contactno:e.contactno,orderid:e.orderid,logdate:e.logdate,lat:a,lon:t}:null})).filter(Boolean)),[da]),[ua,ma]=(0,r.useState)((()=>{const e=g()();return U(e.hour()+e.minute()/60,B)||B[0].id}));(0,r.useEffect)((()=>{var e;"all"!==ua&&(ns.some((e=>e.id===ua))||ma((null===(e=ns[0])||void 0===e?void 0:e.id)||"all"))}),[ns,ua]);const pa=(0,r.useRef)(null),ha=!s,xa="undefined"!==typeof window&&localStorage.getItem("userid")||0,{data:va,isFetching:ja,isError:ga,fetchNextPage:fa,hasNextPage:Na,isFetchingNextPage:ba}=(0,b.q)({queryKey:["dispatchDeliveries",Je,xa,"all",Ls,Ls,50,"",0,0,0],queryFn:_.tL,getNextPageParam:e=>{var s;return null!==(s=e.nextPage)&&void 0!==s?s:void 0},enabled:ha});(0,r.useEffect)((()=>{ha&&Na&&!ba&&fa()}),[ha,Na,ba,fa]);const ya=(0,r.useMemo)((()=>{const e=((null===va||void 0===va?void 0:va.pages)||[]).flatMap((e=>e.rows||[])),s=new Set,a=[];for(const t of e){const e=null!=t.orderid?String(t.orderid):null;e&&s.has(e)||(e&&s.add(e),a.push(t))}return a}),[va]),ka=(0,r.useMemo)((()=>{const e=new Map;return ya.forEach((s=>{const a=String(s.userid||s.rider_id||"");a&&"unassigned"!==a&&"0"!==a&&(e.has(a)||e.set(a,{id:a,riderName:s.ridername||s.rider_name||s.username||"Rider ".concat(a)}))})),Array.from(e.values()).sort(((e,s)=>String(e.riderName).localeCompare(String(s.riderName))))}),[ya]),Sa=(0,r.useMemo)((()=>{const e={all:ya.length};return ns.forEach((s=>{e[s.id]=0})),ya.forEach((s=>{const a=J(s,Qe,ns);a&&(e[a]=(e[a]||0)+1)})),e}),[ya,Qe,ns]),_a=(0,r.useMemo)((()=>"all"===ua?ya:ya.filter((e=>J(e,Qe,ns)===ua))),[ya,ua,Qe,ns]),wa=(0,r.useMemo)((()=>{if(!ha)return null;if(!_a.length)return{code:200,zone_summary:[],zones:[]};const e=e=>String(e||"").trim(),s={};_a.forEach((a=>{const t=e(a.deliverysuburb)||e(a.locationsuburb)||e(a.zone_name)||"Unzoned",i=t.toLowerCase(),r=String(a.userid||a.rider_id||"unassigned"),n=a.ridername||a.rider_name||a.username||("unassigned"===r?"Unassigned":"Rider ".concat(r));s[i]||(s[i]={zone_name:t,riders:{}}),s[i].riders[r]||(s[i].riders[r]={rider_id:r,rider_name:n,orders:[]}),s[i].riders[r].orders.push(a)}));const a=Object.values(s).map((e=>{const s=Object.values(e.riders).map((e=>{const s=[...e.orders].sort(((e,s)=>g()(e.deliverydate||e.assigntime||0).valueOf()-g()(s.deliverydate||s.assigntime||0).valueOf()));return(0,i.A)((0,i.A)({},e),{},{orders:s.map(((e,s)=>(0,i.A)((0,i.A)({},e),{},{trip_number:e.trip_number||1,step:e.step||s+1})))})}));return{zone_name:e.zone_name,riders:s}}));return{code:200,zone_summary:a.map((e=>{const s=e.riders.flatMap((e=>e.orders)),a=s.filter((e=>e.userid||e.rider_id)).length;return{zone_name:e.zone_name,total_orders:s.length,assigned_orders:a,unassigned_orders_count:s.length-a,active_riders_count:e.riders.filter((e=>"unassigned"!==e.rider_id)).length,total_delivery_kms:s.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),total_profit:s.reduce(((e,s)=>e+parseFloat(s.profit||0)),0)}})),zones:a}}),[ha,_a]),Fa=(0,r.useMemo)((()=>{const e=s||wa||{zones:[],zone_summary:[]},a=e.zones||[],t={};(e.zone_summary||[]).forEach((e=>{t[e.zone_name]=e}));const i=(e,s)=>{const a={};return e.forEach((e=>{const t=s(e);t&&(a[t]=(a[t]||0)+1)})),Object.entries(a).map((e=>{let[s,a]=e;return{name:s,count:a}})).sort(((e,s)=>s.count-e.count))};return a.map((e=>{var s,a,r,n;const l=t[e.zone_name]||{},c=(e.riders||[]).flatMap((e=>e.orders||[])),d=(e.riders||[]).filter((e=>e.rider_id&&"unassigned"!==e.rider_id)).length,o=i(c,(e=>e.deliverysuburb||e.locationsuburb)),u=i(c,(e=>e.pickupcustomer||e.kitchen_key)),m={};return c.forEach((e=>{const s=String(e.orderstatus||"unknown").toLowerCase();m[s]=(m[s]||0)+1})),{id:e.zone_name,name:e.zone_name,riders:e.riders||[],orders:c,totalOrders:null!==(s=l.total_orders)&&void 0!==s?s:c.length,activeRidersCount:null!==(a=l.active_riders_count)&&void 0!==a?a:d,totalKms:null!==(r=l.total_delivery_kms)&&void 0!==r?r:c.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),totalProfit:null!==(n=l.total_profit)&&void 0!==n?n:c.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),suburbs:o,kitchens:u,statusCounts:m}}))}),[s,wa]),{riders:Ma,kitchens:Ca,allOrders:za,stats:Aa}=(0,r.useMemo)((()=>{const e=[];((s||wa||{zones:[],zone_summary:[]}).zones||[]).forEach((s=>{(s.riders||[]).forEach((a=>{a.orders.forEach((t=>{e.push((0,i.A)((0,i.A)({},t),{},{zone_name:s.zone_name,rider_name:a.rider_name,rider_id:a.rider_id}))}))}))}));const a={};e.forEach((e=>{const s=e.rider_id||e.userid||"unknown";a[s]||(a[s]={id:s,riderName:e.rider_name||e.username||e.rider||s,orders:[],color:te[Object.keys(a).length%te.length]}),a[s].orders.push(e)}));const t={};e.forEach((e=>{const s=e.pickupcustomer||e.kitchen_key||"Unknown",a=s.toLowerCase().trim();t[a]?!Number.isFinite(t[a].lat)&&O(e)&&(t[a].lat=E(q(e)),t[a].lon=E(I(e))):t[a]={id:a,kitchenName:s,lat:E(q(e)),lon:E(I(e)),orders:[],riders:new Set},t[a].orders.push(e),e.rider_id&&t[a].riders.add(e.rider_id)}));const r=e.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),n=e.reduce(((e,s)=>e+parseFloat(s.profit||0)),0);return{riders:Object.values(a).map((e=>(0,i.A)((0,i.A)({},e),{},{orders:[...e.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)}))}))).sort(((e,s)=>s.orders.length-e.orders.length)),kitchens:Object.values(t).sort(((e,s)=>s.orders.length-e.orders.length)),allOrders:e,stats:{totalOrders:e.length,totalKms:r,totalProfit:n,totalRiders:Object.keys(a).length}}}),[s,wa]),Pa=Ve?n&&Ma.find((e=>e.id===n))||null:Fe,Ea=(0,r.useCallback)((e=>{h&&h(e?e.id:null),Ve||Me(e),De(null)}),[Ve,h]),Da=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=Pa?Pa.id:null;e!==Da.current&&(Pa?C.A.info("Focused rider changed to: ".concat(Pa.riderName," (").concat(Pa.orders.length," orders)")):C.A.info("Focused rider reset to: None"),Da.current=e)}),[Pa]),(0,r.useEffect)((()=>{Ee?C.A.info("Focused order updated: ID ".concat(Ee.orderid)):C.A.debug("Focused order selection cleared")}),[Ee]);const La=(0,r.useRef)(0);(0,r.useEffect)((()=>{za&&za.length!==La.current&&(C.A.info("Orders database updated: ".concat(za.length," orders actively tracked")),La.current=za.length)}),[za]);const qa=(0,r.useRef)(0);(0,r.useEffect)((()=>{oa&&oa.length!==qa.current&&(C.A.info("Live riders list updated: ".concat(oa.length," active riders mapped")),qa.current=oa.length)}),[oa]);const Ia=(0,r.useMemo)((()=>Pa?{orders:Pa.orders.length,riders:1,km:Pa.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:Pa.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),label:"Focused Rider"}:Ce?{orders:Ce.orders.length,riders:Ce.riders.size,km:Ce.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:Ce.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),label:"Focused Kitchen"}:{orders:Aa.totalOrders,riders:Aa.totalRiders,km:Aa.totalKms,profit:Aa.totalProfit,label:"Total Fleet"}),[Pa,Ce,Aa]),Oa=(0,r.useMemo)((()=>{if(!Pa)return[];const e=new Set;return Pa.orders.forEach((s=>{null!=s.deliveryid&&""!==s.deliveryid&&0!==s.deliveryid&&e.add(String(s.deliveryid))})),Array.from(e)}),[Pa]),Ra=(0,y.E)({queries:Oa.map((e=>({queryKey:["deliveryLogs",e],queryFn:async()=>{var s,a;const i=await k.A.get("".concat("https://jupiter.nearle.app/live/api/v3","/deliveries/getdeliverylogs/?deliveryid=").concat(e));return function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e)||0===e.length)return[];const a=e.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&(Math.abs(e.lat)>.1||Math.abs(e.lng)>.1)));if(0===a.length)return[];if(1===a.length)return[{lat:a[0].lat,lng:a[0].lng,logdate:a[0].logdate,_ts:a[0]._ts}];const t=null!=s.processNoise?s.processNoise:1e-10,i=null!=s.measurementNoise?s.measurementNoise:2e-9,r=null!=s.outlierGate?s.outlierGate:9,n=null!=s.maxSpeedKmh?s.maxSpeedKmh:120,l=e=>e._ts||(e.logdate?new Date(e.logdate).getTime():0);let c=0;for(;cn||(d.push(e),o=s)}if(d.length<2)return d.map((e=>({lat:e.lat,lng:e.lng,logdate:e.logdate,_ts:e._ts})));const u=e=>{const s=d.length,a=new Array(s),n=new Array(s),c=new Array(s),o=new Array(s),u=new Array(s),m=l(d[0]),p=l(d[1]),h=Math.max(.1,(p-m)/1e3),x=(d[1][e]-d[0][e])/h;a[0]=[d[0][e],x],n[0]=[i,0,0,1],c[0]=a[0].slice(),o[0]=n[0].slice(),u[0]=0;let v=m;for(let g=1;gr){a[g]=[x,j],n[g]=[_,w,F,M];continue}const A=_/z,P=F/z,E=x+A*C,D=j+P*C;a[g]=[E,D],n[g]=[(1-A)*_,(1-A)*w,F-P*_,M-P*w]}const j=new Array(s);j[s-1]=a[s-1].slice();for(let t=s-2;t>=0;t--){const e=u[t+1],[s,i,r,l]=n[t],d=s+e*i,m=i,p=r+e*l,h=l,[x,v,g,f]=o[t+1],N=x*f-v*g;if(!Number.isFinite(N)||Math.abs(N)<1e-30){j[t]=a[t].slice();continue}const b=f/N,y=-v/N,k=-g/N,S=x/N,_=d*b+m*k,w=d*y+m*S,F=p*b+h*k,M=p*y+h*S,C=j[t+1][0]-c[t+1][0],z=j[t+1][1]-c[t+1][1];j[t]=[a[t][0]+_*C+w*z,a[t][1]+F*C+M*z]}return j.map((e=>e[0]))},m=u("lat"),p=u("lng");return d.map(((e,s)=>({lat:m[s],lng:p[s],logdate:e.logdate,_ts:e._ts})))}(([null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.details,null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.data,null===i||void 0===i?void 0:i.data,i].find((e=>Array.isArray(e)))||[]).map((e=>{var s,a,t;const i=null!==e&&void 0!==e&&e.logdate?g()(e.logdate):null;return{lat:parseFloat(null!==(s=null===e||void 0===e?void 0:e.latitude)&&void 0!==s?s:null===e||void 0===e?void 0:e.lat),lng:parseFloat(null!==(a=null!==(t=null===e||void 0===e?void 0:e.longitude)&&void 0!==t?t:null===e||void 0===e?void 0:e.lng)&&void 0!==a?a:null===e||void 0===e?void 0:e.lon),logdate:null===e||void 0===e?void 0:e.logdate,_ts:i&&i.isValid()?i.valueOf():Number.MAX_SAFE_INTEGER}})).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng))).sort(((e,s)=>e._ts-s._ts))).map((e=>{let{_ts:s}=e;return(0,t.A)(e,z)}))},enabled:Ys&&null!=Pa,staleTime:3e5,refetchOnWindowFocus:!1,retry:1})))}),Ta=(0,r.useMemo)((()=>{if(!Pa)return[];const e=e=>{const s=e.deliverytime||e.expecteddeliverytime;if(!s)return Number.MAX_SAFE_INTEGER;const a=g()(s);return a.isValid()?a.valueOf():Number.MAX_SAFE_INTEGER};return Pa.orders.filter((e=>null!=e.deliveryid&&""!==e.deliveryid&&0!==e.deliveryid)).sort(((s,a)=>{const t=e(s)-e(a);return 0!==t?t:(s.step||0)-(a.step||0)})).map(((e,s)=>{const a=Oa.indexOf(String(e.deliveryid)),t=a>=0?Ra[a]:null;return{sequenceStep:s+1,orderid:e.orderid,deliveryid:e.deliveryid,deliverycustomer:e.deliverycustomer,pickupcustomer:e.pickupcustomer,step:e.step,tripNumber:e.trip_number||1,deliverytime:e.deliverytime||e.expecteddeliverytime,kms:parseFloat(e.actualkms||e.kms||0)||0,profit:parseFloat(e.profit||0)||0,orderstatus:e.orderstatus,isLoading:(null===t||void 0===t?void 0:t.isLoading)||(null===t||void 0===t?void 0:t.isFetching),isError:null===t||void 0===t?void 0:t.isError,coords:(null===t||void 0===t?void 0:t.data)||[]}}))}),[Pa,Oa,Ra]),Ha=(0,r.useMemo)((()=>Pa?Ta.map((e=>{const s=Pa.orders.find((s=>String(s.deliveryid)===String(e.deliveryid))),a=parseFloat((null===s||void 0===s?void 0:s.kms)||0)||0,t=_s[e.deliveryid];let i=0;Array.isArray(t)&&t.length>=2?i=Z(t):null!=(null===s||void 0===s?void 0:s.actualkms)&&""!==s.actualkms?i=parseFloat(s.actualkms)||0:e.coords.length>=2&&(i=Z(e.coords.map((e=>[e.lat,e.lng]))));const r=i-a,n=a>0?r/a*100:null,l=null!==s&&void 0!==s&&s.expecteddeliverytime?g()(s.expecteddeliverytime):null,c=null!==s&&void 0!==s&&s.deliverytime?g()(s.deliverytime):null,d=null!==l&&void 0!==l&&l.isValid()&&null!==c&&void 0!==c&&c.isValid()?c.diff(l,"minute"):null,o=a>0&&i>1.25*a||null!=d&&d>15;return{sequenceStep:e.sequenceStep,deliveryid:e.deliveryid,orderid:e.orderid,order:s,plannedKm:a,actualKm:i,kmDelta:r,kmDeltaPct:n,expectedTs:null!==l&&void 0!==l&&l.isValid()?l:null,actualTs:null!==c&&void 0!==c&&c.isValid()?c:null,timeDeltaMin:d,anomaly:o,orderstatus:e.orderstatus,deliverycustomer:e.deliverycustomer,pickupcustomer:null===s||void 0===s?void 0:s.pickupcustomer,isLoading:e.isLoading,coordsCount:e.coords.length}})):[]),[Ta,Pa,_s]),Ya=(0,r.useMemo)((()=>{if(0===Ha.length)return{plannedKm:0,actualKm:0,kmDeltaPct:null,anomalies:0,late:0,onTime:0};const e=Ha.filter((e=>!e.isLoading&&e.coordsCount>0)),s=e.reduce(((e,s)=>e+s.plannedKm),0),a=e.reduce(((e,s)=>e+s.actualKm),0);return{plannedKm:s,actualKm:a,kmDeltaPct:s>0?(a-s)/s*100:null,anomalies:e.filter((e=>e.anomaly)).length,late:e.filter((e=>null!=e.timeDeltaMin&&e.timeDeltaMin>5)).length,onTime:e.filter((e=>null!=e.timeDeltaMin&&e.timeDeltaMin<=5)).length}}),[Ha]),Va=(0,r.useMemo)((()=>[...Ha].sort(((e,s)=>{var a,t;return((null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep)-((null===(t=s.order)||void 0===t?void 0:t.step)||s.sequenceStep)}))),[Ha]),Ka=(0,r.useMemo)((()=>[...Ha].sort(((e,s)=>e.sequenceStep-s.sequenceStep))),[Ha]),Ba=(0,r.useMemo)((()=>{if(!Ys||!ra||!Pa)return null;const e=Ta.find((e=>e.sequenceStep===ra));if(!e)return null;const s=Pa.orders.find((s=>String(s.deliveryid)===String(e.deliveryid)));return s?{orders:[s],id:"cmp-step-".concat(ra,"-").concat(s.orderid)}:null}),[Ys,ra,Pa,Ta]);(0,r.useEffect)((()=>{na(null),Zs(new Set),Bs("combined")}),[Ys,null===Pa||void 0===Pa?void 0:Pa.id]),(0,r.useEffect)((()=>{!Pa&&Ys&&Vs(!1)}),[Pa,Ys]),(0,r.useEffect)((()=>{Xs.current&&Pa&&(Xs.current=!1,Vs(!0))}),[Pa]),(0,r.useEffect)((()=>{Ys&&!aa.current?(sa.current=Qs,ea(!0),ia(!1)):!Ys&&aa.current&&ea(sa.current),aa.current=Ys}),[Ys]);const Ua=(0,r.useCallback)((async(e,s,a)=>{if(a.length<2)return;const t=ae(e,s,a);if(void 0!==Ss.current[t])return;Ss.current[t]=null,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:null})));const r=a.map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),n="https://router.project-osrm.org/route/v1/driving/".concat(r,"?overview=full&geometries=geojson");try{const e=await fetch(n),s=await e.json();if(s.routes&&s.routes[0]){const e=s.routes[0].geometry.coordinates.map((e=>[e[1],e[0]]));Ss.current[t]=e,ks((s=>(0,i.A)((0,i.A)({},s),{},{[t]:e})))}else Ss.current[t]=!1,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:!1})))}catch(l){console.error("OSRM Fetch error:",l),Ss.current[t]=!1,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:!1})))}}),[]);(0,r.useEffect)((()=>{Ss.current={},ks({}),Fs.current={},ws({})}),[Ls,ua]);const Ga=(0,r.useCallback)((async(e,s)=>{if(void 0!==Fs.current[e])return;if(!Array.isArray(s)||s.length<2)return;Fs.current[e]=null,ws((s=>(0,i.A)((0,i.A)({},s),{},{[e]:null})));const a=s=>{Fs.current[e]=s,ws((a=>(0,i.A)((0,i.A)({},a),{},{[e]:s})))},t=()=>{Fs.current[e]=!1,ws((s=>(0,i.A)((0,i.A)({},s),{},{[e]:!1})))},r=(e,s)=>{if(e.length<=s)return e;const a=Math.ceil(e.length/s),t=e.filter(((e,s)=>s%a===0)),i=e[e.length-1];return t[t.length-1]!==i&&t.push(i),t};try{const e=r(s,90).map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),t="https://router.project-osrm.org/match/v1/driving/".concat(e,"?overview=full&geometries=geojson&gaps=ignore&tidy=true"),i=await fetch(t),n=await i.json();if(n.matchings&&n.matchings.length>0){const e=n.matchings.flatMap((e=>{var s;return((null===(s=e.geometry)||void 0===s?void 0:s.coordinates)||[]).map((e=>[e[1],e[0]]))}));if(e.length>=2)return void a(e)}}catch(n){console.warn("OSRM Match error, trying route fallback:",n)}try{const e=r(s,25).map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),i="https://router.project-osrm.org/route/v1/driving/".concat(e,"?overview=full&geometries=geojson"),n=await fetch(i),l=await n.json();if(l.routes&&l.routes[0]){const e=l.routes[0].geometry.coordinates.map((e=>[e[1],e[0]]));if(e.length>=2)return void a(e)}t()}catch(n){console.error("OSRM Route fallback error:",n),t()}}),[]);(0,r.useEffect)((()=>{Ys&&Pa&&Ta.forEach((e=>{if(!e.deliveryid||e.coords.length<2)return;const s=e.coords.map((e=>[e.lat,e.lng]));Ga(e.deliveryid,s)}))}),[Ta,Ys,Pa,Ga]),(0,r.useEffect)((()=>{Ds.current=Ms}),[Ms]),(0,r.useEffect)((()=>{if(a)return;const e=()=>{const e=new Date;Be([e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>String(e).padStart(2,"0"))).join(":"))},s=setInterval(e,1e3);return e(),()=>clearInterval(s)}),[a]),(0,r.useEffect)((()=>{we(new Set(Ma.map((e=>e.id))))}),[Ma]),(0,r.useEffect)((()=>{Ma.forEach((e=>{if(!_e.has(e.id))return;if(Pa&&Pa.id!==e.id)return;const s={};e.orders.forEach((e=>{const a=e.trip_number||1;s[a]||(s[a]=[]),s[a].push(e)})),Object.entries(s).forEach((s=>{let[a,t]=s;const i=[...t].sort(((e,s)=>(e.step||0)-(s.step||0))),r=se(i);r.length>=2&&Ua(e.id,a,r)}))}))}),[Ma,_e,Pa,Ua]);const Ja=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(!ha)return;const e=()=>{const e=g()();return e.hour()+e.minute()/60};null===Ja.current&&(Ja.current=e());const s=setInterval((()=>{const s=e(),a=U(Ja.current,ns),t=U(s,ns);Ja.current=s,t&&t!==a&&ma((e=>e===a?t:e))}),3e4);return()=>clearInterval(s)}),[ha,ns]),(0,r.useEffect)((()=>{De(null)}),[null===Ce||void 0===Ce?void 0:Ce.id]),(0,r.useEffect)((()=>{const e=pa.current;e&&"function"===typeof e.scrollIntoView&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}),[ua]),(0,r.useEffect)((()=>{if(!Ee)return;const e=setTimeout((()=>{var e;const s=null===za||void 0===za||null===(e=za.find)||void 0===e?void 0:e.call(za,(e=>String(e.orderid)===String(Ee.orderid)));s&&Ye(s)}),350);return()=>clearTimeout(e)}),[Ee,za]);const Wa=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x().divIcon({className:"",iconSize:s?[56,56]:[46,46],iconAnchor:s?[28,28]:[23,23],popupAnchor:[0,s?-30:-24],html:'
').concat((e||"K").charAt(0).toUpperCase(),"
")})},$a=e=>{var s;return(null===(s=Ma.find((s=>s.id===e)))||void 0===s?void 0:s.color)||"#475569"},Za=(e,s)=>{if(!e||!s||!L(s))return null;const a=oa.find((s=>String(s.id)===String(e)));if(!a)return null;const t=E(s.droplat||s.deliverylat),i=E(s.droplon||s.deliverylong);if(!Number.isFinite(t)||!Number.isFinite(i))return null;const r=$([a.lat,a.lon],[t,i]);return Math.round(1e3*r)},Xa=e=>null===e||void 0===e?"":e>=1e3?"".concat((e/1e3).toFixed(1)," km"):"".concat(e," m");return(0,F.jsxs)("div",{className:"dispatch-container".concat(a?" embedded":"").concat(Ys?" compare-open":""),children:[!a&&(0,F.jsxs)("div",{id:"hdr",children:[(0,F.jsxs)("div",{className:"logo",children:[(0,F.jsx)("div",{className:"logo-badge",children:"D"}),(0,F.jsx)("div",{className:"logo-name",children:"Dispatch"}),Ue&&Ue.length>0&&(0,F.jsxs)("div",{className:"logo-city-wrap",ref:Xe,children:[(0,F.jsxs)("button",{type:"button",className:"logo-city ".concat($e?"open":""),onClick:()=>Ze((e=>!e)),"aria-haspopup":"listbox","aria-expanded":$e,title:"Switch hub",children:[(0,F.jsx)(S.JFD,{}),(0,F.jsx)("span",{className:"logo-city-text",children:bs||"All locations"}),(0,F.jsx)(S.j1Q,{className:"logo-city-caret"})]}),$e&&(0,F.jsx)("div",{className:"logo-city-menu",role:"listbox",children:Ue.map((e=>{const s=String(e.applocationid)===String(Je);return(0,F.jsxs)("button",{type:"button",role:"option","aria-selected":s,className:"logo-city-option ".concat(s?"active":""),onClick:()=>(e=>{if(C.A.info("Switching hub/location ID:",e),We(Number(e)),Ze(!1),"undefined"!==typeof window)try{localStorage.setItem("applocationid",String(e))}catch(s){}Ea(null),ze(null),Pe(null)})(e.applocationid),children:[(0,F.jsx)(S.JFD,{className:"logo-city-option-icon"}),(0,F.jsx)("span",{children:e.locationname}),s&&(0,F.jsx)("span",{className:"logo-city-option-check",children:"\u2713"})]},e.applocationid)}))})]}),(0,F.jsxs)("div",{id:"dispatch-top-tabs",className:"dtt-inline",children:[(0,F.jsxs)("button",{type:"button",className:"dtt-tab ".concat("live"===ue?"active":""),onClick:()=>me("live"),children:[(0,F.jsx)("span",{className:"dtt-icon",children:(0,F.jsx)(S.Cd7,{})}),"Live"]}),(0,F.jsxs)("button",{type:"button",className:"dtt-tab ".concat("analysis"===ue?"active":""),onClick:()=>me("analysis"),children:[(0,F.jsx)("span",{className:"dtt-icon",children:(0,F.jsx)(S.DX0,{})}),"Analysis"]})]})]}),(0,F.jsxs)("div",{className:"hdr-stats",children:[(()=>{const e=Ia.profit<0,s=Math.abs(Ia.profit);return(0,F.jsxs)("span",{className:"strat-stat ".concat(e?"strat-stat-loss":"strat-stat-profit"),title:"".concat(e?"Loss":"Profit"," (").concat(Ia.label,")"),children:[(0,F.jsx)("span",{className:"strat-stat-icon",children:e?(0,F.jsx)(S.Rod,{}):(0,F.jsx)(S.imn,{})}),(0,F.jsx)("span",{className:"strat-stat-label",children:e?"Loss":"Profit"}),(0,F.jsxs)("span",{className:"strat-stat-value",children:[e?"-":"","\u20b9",s.toFixed(0)]})]})})(),ha&&(0,F.jsxs)(F.Fragment,{children:[ja&&(0,F.jsxs)("span",{className:"live-status",children:[(0,F.jsx)("span",{className:"live-dot"})," Loading ",ya.length?"\xb7 ".concat(ya.length," loaded"):""]}),!ja&&!ga&&(0,F.jsxs)("span",{className:"live-status live-status-ready",children:[(0,F.jsx)("span",{className:"live-dot ready"})," ",_a.length," orders",(0,F.jsxs)("span",{className:"live-status-sub",children:[" / ",ya.length," total"]})]}),ga&&(0,F.jsxs)("span",{className:"live-status live-status-error",children:[(0,F.jsx)("span",{className:"live-dot error"})," Failed to load"]}),(()=>{const e=g()().startOf("day"),s=e.format("YYYY-MM-DD"),a=g()(Ls),t=Ls===s,i=a.isAfter(e,"day"),r=s=>{if(!s)return;const a=s.format("YYYY-MM-DD");a!==Ls?s.isAfter(e,"day")||(qs(a),Ea(null),ze(null),Pe(null),Os(!1)):Os(!1)},n=Rs.startOf("month"),l=n.subtract(n.day(),"day"),c=Array.from({length:42},((e,s)=>l.add(s,"day"))),d=!Rs.add(1,"month").startOf("month").isAfter(e,"month");return(0,F.jsxs)("div",{className:"date-chip".concat(t?" is-today":"").concat(Is?" is-open":""),ref:Hs,children:[(0,F.jsx)("button",{type:"button",className:"date-chip-nav",onClick:()=>r(a.subtract(1,"day")),"aria-label":"Previous day",title:"Previous day",children:(0,F.jsx)(S.E_E,{})}),(0,F.jsxs)("button",{type:"button",className:"date-chip-main",onClick:()=>Os((e=>!e)),"aria-haspopup":"dialog","aria-expanded":Is,children:[(0,F.jsx)("span",{className:"date-chip-icon","aria-hidden":"true",children:(0,F.jsx)(S.dDC,{})}),(0,F.jsxs)("span",{className:"date-chip-text",children:[(0,F.jsxs)("span",{className:"date-chip-label",children:["Date",t&&(0,F.jsx)("span",{className:"date-chip-today-pill",children:"Today"})]}),(0,F.jsx)("span",{className:"date-chip-value",children:a.isValid()?a.format("ddd, MMM D, YYYY"):"\u2014"})]}),(0,F.jsx)("span",{className:"date-chip-chevron".concat(Is?" is-open":""),"aria-hidden":"true",children:(0,F.jsx)(S.j1Q,{})})]}),(0,F.jsx)("button",{type:"button",className:"date-chip-nav",onClick:()=>{t||i||r(a.add(1,"day"))},disabled:t||i,"aria-label":"Next day",title:t?"You're viewing today":"Next day",children:(0,F.jsx)(S.xVu,{})}),Is&&(0,F.jsxs)("div",{className:"date-cal-popover",role:"dialog","aria-label":"Pick a date",children:[(0,F.jsxs)("div",{className:"date-cal-header",children:[(0,F.jsx)("button",{type:"button",className:"date-cal-nav",onClick:()=>Ts((e=>e.subtract(1,"month"))),"aria-label":"Previous month",children:(0,F.jsx)(S.E_E,{})}),(0,F.jsx)("div",{className:"date-cal-title",children:Rs.format("MMMM YYYY")}),(0,F.jsx)("button",{type:"button",className:"date-cal-nav",onClick:()=>{const s=Rs.add(1,"month");s.startOf("month").isAfter(e,"month")||Ts(s)},disabled:!d,"aria-label":"Next month",children:(0,F.jsx)(S.xVu,{})})]}),(0,F.jsx)("div",{className:"date-cal-weekdays",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((e=>(0,F.jsx)("div",{className:"date-cal-weekday",children:e},e)))}),(0,F.jsx)("div",{className:"date-cal-grid",children:c.map((a=>{const t=a.month()===Rs.month(),i=a.format("YYYY-MM-DD")===Ls,n=a.format("YYYY-MM-DD")===s,l=a.isAfter(e,"day"),c=["date-cal-day",!t&&"is-other-month",i&&"is-selected",n&&"is-today",l&&"is-disabled"].filter(Boolean).join(" ");return(0,F.jsx)("button",{type:"button",className:c,disabled:l,onClick:()=>r(a),"aria-current":n?"date":void 0,"aria-pressed":i,children:a.date()},a.format("YYYY-MM-DD"))}))}),(0,F.jsxs)("div",{className:"date-cal-presets",children:[(0,F.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e),children:"Today"}),(0,F.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e.subtract(1,"day")),children:"Yesterday"}),(0,F.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e.subtract(7,"day")),children:"\u22127 days"})]})]})]})})()]})]}),(0,F.jsx)("div",{id:"clock",children:Ke})]}),(a||"live"===ue)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{id:"strat-row",children:[(0,F.jsxs)("button",{className:"sbt ".concat("kitchens"===G?"active":""),onClick:()=>{C.A.info("View mode changed: By Location"),oe("kitchens"),Ea(null),ze(null),Pe(null)},children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.JFD,{})})," By Location"]}),(0,F.jsxs)("button",{className:"sbt ".concat("zones"===G?"active":""),onClick:()=>{C.A.info("View mode changed: By Zone"),oe("zones"),Ea(null),ze(null),Pe(null)},children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.Cd7,{})})," By Zone"]}),(0,F.jsxs)("button",{className:"sbt ".concat("riders"===G?"active":""),onClick:()=>{C.A.info("View mode changed: By Rider"),oe("riders"),Ea(null),ze(null),Pe(null)},children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.bsz,{})})," By Rider"]}),(0,F.jsxs)("button",{className:"sbt ".concat("all"===G?"active":""),onClick:()=>{C.A.info("View mode changed: All Routes"),oe("all"),Ea(null),ze(null),Pe(null)},children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.Zs6,{})})," All Routes"]}),(0,F.jsxs)("button",{type:"button",className:"sbt sbt-rider-info ".concat("rider-info"===G?"active":""),onClick:()=>{oe("rider-info"),Ea(null),ze(null),Pe(null)},title:"Live GPS / battery / status snapshot for a rider",children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.k4P,{})})," Rider Info"]})]}),ha&&"rider-info"!==G&&(0,F.jsxs)("div",{id:"batch-row",children:[(0,F.jsx)("span",{className:"batch-label",children:"Batch"}),(0,F.jsx)("div",{className:"batch-scroll",children:ns.map((e=>{var s;const a=ua===e.id;return(0,F.jsxs)("button",{ref:a?pa:null,className:"batch-btn batch-slot ".concat(a?"active":""),onClick:()=>{ma(e.id),Ea(null),ze(null),Pe(null)},title:"".concat(e.label," (").concat(e.range,")"),children:[(0,F.jsx)("span",{className:"batch-btn-label",children:e.label}),(0,F.jsx)("span",{className:"batch-btn-count",children:null!==(s=Sa[e.id])&&void 0!==s?s:0})]},e.id)}))})]}),"rider-info"===G?(0,F.jsxs)("div",{className:"rider-info-mode",children:[(0,F.jsxs)("div",{className:"ri-sidebar",children:[(0,F.jsxs)("div",{className:"ri-sb-head",children:[(0,F.jsx)("div",{className:"ri-sb-title",children:"Riders"}),(0,F.jsxs)("div",{className:"ri-sb-sub",children:[ka.length," ",1===ka.length?"rider":"riders"," today"]})]}),(0,F.jsxs)("div",{className:"ri-search",children:[(0,F.jsx)(S.gZ7,{className:"ri-search-icon"}),(0,F.jsx)("input",{type:"text",className:"ri-search-input",placeholder:"Search by name or ID",value:ps,onChange:e=>hs(e.target.value)})]}),(()=>{const e=ps.trim().toLowerCase(),s=ka.filter((s=>!e||(String(s.riderName||"").toLowerCase().includes(e)||String(s.id).includes(e))));return 0===s.length?(0,F.jsx)("div",{className:"ri-empty",children:ps?'No riders match "'.concat(ps,'"'):"No riders have orders today"}):(0,F.jsx)("div",{className:"ri-rider-list",children:s.map((e=>{const s=String(us)===String(e.id);return(0,F.jsxs)("button",{type:"button",className:"ri-rider-item ".concat(s?"active":""),onClick:()=>ms(e.id),children:[(0,F.jsx)("span",{className:"ri-rider-dot",style:{background:ie(e.id)}}),(0,F.jsxs)("span",{className:"ri-rider-info-block",children:[(0,F.jsx)("span",{className:"ri-rider-name",children:e.riderName}),(0,F.jsxs)("span",{className:"ri-rider-meta",children:["#",e.id]})]}),(0,F.jsx)("span",{className:"ri-rider-arrow",children:"\u2192"})]},e.id)}))})})()]}),(0,F.jsx)("div",{className:"ri-main",children:null==us?(0,F.jsxs)("div",{className:"ri-placeholder",children:[(0,F.jsx)("div",{className:"ri-placeholder-icon",children:(0,F.jsx)(S.k4P,{})}),(0,F.jsx)("div",{className:"ri-placeholder-title",children:"Pick a rider"}),(0,F.jsx)("div",{className:"ri-placeholder-sub",children:"Select a rider from the list on the left to see their live GPS, battery, connection, and current order snapshot."})]}):(0,F.jsxs)(F.Fragment,{children:[vs&&!xs&&(0,F.jsx)("div",{className:"ri-loading",children:"Loading rider snapshot\u2026"}),js&&(0,F.jsxs)("div",{className:"ri-error",children:["Couldn't load this rider's log. ",(null===gs||void 0===gs?void 0:gs.message)||""]}),xs&&(()=>{const e=xs,s=parseFloat(e.latitude),a=parseFloat(e.longitude),t=Number.isFinite(s)&&Number.isFinite(a),i=parseInt(String(e.battery||"").replace("%",""),10),r=Number.isFinite(i)&&i<=20,n=parseFloat(e.speed),c=String(e.status||"").toLowerCase();return(0,F.jsxs)("div",{className:"ri-snapshot",children:[(0,F.jsxs)("div",{className:"ri-snap-head",children:[(0,F.jsx)("div",{className:"ri-snap-name",children:e.username||"Rider #".concat(e.userid)}),(0,F.jsxs)("div",{className:"ri-snap-meta",children:[(0,F.jsxs)("span",{children:["#",e.userid]}),e.status&&(0,F.jsx)("span",{className:"ri-status ri-status-".concat(c),children:e.status}),(0,F.jsxs)("span",{className:"ri-live ".concat(vs?"is-refetching":""),children:[(0,F.jsx)("span",{className:"ri-live-dot"}),vs?"Updating\u2026":"Live"]})]}),e.logdate&&(0,F.jsxs)("div",{className:"ri-snap-time",children:[(0,F.jsx)(S.VP9,{})," Last seen ",e.logdate]})]}),(0,F.jsxs)("div",{className:"ri-snap-grid",children:[(0,F.jsxs)("div",{className:"ri-stat ".concat(r?"ri-stat-warn":""),children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.wZm,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Battery"}),(0,F.jsxs)("div",{className:"ri-stat-value",children:[e.battery||"\u2014",e.is_charging&&(0,F.jsx)("span",{className:"ri-stat-tag",children:"Charging"})]})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.Xh5,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Connection"}),(0,F.jsx)("div",{className:"ri-stat-value",children:e.connection||"\u2014"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.HPi,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"GPS Accuracy"}),(0,F.jsx)("div",{className:"ri-stat-value",children:e.accuracy?"".concat(e.accuracy," m"):"\u2014"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.o8z,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Location Service"}),(0,F.jsx)("div",{className:"ri-stat-value",children:e.location_service||"\u2014"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.BJM,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Speed"}),(0,F.jsx)("div",{className:"ri-stat-value",children:Number.isFinite(n)?"".concat(n.toFixed(2)," km/h"):"\u2014"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.bqQ,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Heading"}),(0,F.jsx)("div",{className:"ri-stat-value",children:null!=e.heading?"".concat(e.heading,"\xb0"):"\u2014"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.pSF,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"App State"}),(0,F.jsx)("div",{className:"ri-stat-value",children:e.is_background?"Background":"Foreground"})]})]}),(0,F.jsxs)("div",{className:"ri-stat",children:[(0,F.jsx)("div",{className:"ri-stat-icon",children:(0,F.jsx)(S.gsJ,{})}),(0,F.jsxs)("div",{className:"ri-stat-body",children:[(0,F.jsx)("div",{className:"ri-stat-label",children:"Current Order"}),(0,F.jsx)("div",{className:"ri-stat-value",children:e.orderid||"\u2014"})]})]})]}),t&&(0,F.jsxs)("div",{className:"ri-map-section",children:[(0,F.jsxs)("div",{className:"ri-coords-label",children:[(0,F.jsx)(S.gwi,{})," ",s.toFixed(6),", ",a.toFixed(6)]}),(0,F.jsx)("div",{className:"ri-map",children:(0,F.jsxs)(d.W,{center:[s,a],zoom:13,scrollWheelZoom:!1,style:{height:"100%",width:"100%"},children:[(0,F.jsx)(o.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),(0,F.jsxs)(l.p,{position:[s,a],children:[(0,F.jsx)(u.m,{direction:"top",offset:[0,-10],permanent:!0,className:"ri-area-banner",children:(null===Ns||void 0===Ns?void 0:Ns.area)||"Locating area\u2026"}),(0,F.jsxs)(m.z,{children:[(0,F.jsx)("div",{style:{fontWeight:700,marginBottom:2},children:e.username||"Rider #".concat(e.userid)}),(null===Ns||void 0===Ns?void 0:Ns.area)&&(0,F.jsx)("div",{style:{fontSize:12,color:"#0f172a",marginBottom:4},children:Ns.area}),(0,F.jsx)("div",{style:{fontSize:11,color:"#64748b"},children:e.logdate?"Last seen ".concat(e.logdate):"".concat(s.toFixed(6),", ").concat(a.toFixed(6))})]})]})]},"".concat(e.userid,"-").concat(s,"-").concat(a))})]})]})})()]})})]}):(0,F.jsxs)("div",{id:"body",className:"".concat(Qs?"sidebar-collapsed":""," ").concat(Ys?"compare-mode":""," ").concat(Ys&&ta?"compare-data-collapsed":"").trim(),children:[(0,F.jsx)("button",{type:"button",className:"sidebar-toggle-tab".concat(Qs?" is-collapsed":""),onClick:()=>ea((e=>!e)),title:Qs?"Show sidebar":"Hide sidebar","aria-label":Qs?"Show sidebar":"Hide sidebar",children:Qs?(0,F.jsx)(S.xVu,{}):(0,F.jsx)(S.E_E,{})}),Ys&&Pa&&(0,F.jsx)("button",{type:"button",className:"compare-data-toggle-tab".concat(ta?" is-collapsed":""),onClick:()=>ia((e=>!e)),title:ta?"Show details panel":"Hide details panel","aria-label":ta?"Show details panel":"Hide details panel",children:ta?(0,F.jsx)(S.E_E,{}):(0,F.jsx)(S.xVu,{})}),(0,F.jsxs)("div",{id:"sidebar",children:[!Pa&&(0,F.jsxs)("div",{className:"sb-header",children:[(0,F.jsxs)("div",{className:"sb-header-top",children:[(0,F.jsxs)("div",{className:"sb-header-title",children:[(0,F.jsx)("span",{className:"sb-title-bar","aria-hidden":"true"}),(0,F.jsx)("span",{className:"sb-title-text",children:"RIDER DISPATCH"})]}),(0,F.jsxs)("span",{className:"sb-header-scope",title:Ia.label,children:[(0,F.jsx)("span",{className:"sb-scope-dot"}),Ia.label]})]}),(0,F.jsxs)("div",{className:"sb-header-tiles",children:[(0,F.jsxs)("div",{className:"sb-tile sb-tile-orders",children:[(0,F.jsx)("span",{className:"sb-tile-icon",children:(0,F.jsx)(S.gsJ,{})}),(0,F.jsxs)("div",{className:"sb-tile-body",children:[(0,F.jsx)("div",{className:"sb-tile-value",children:Ia.orders}),(0,F.jsx)("div",{className:"sb-tile-label",children:1===Ia.orders?"Order":"Orders"})]})]}),(0,F.jsxs)("div",{className:"sb-tile sb-tile-riders",children:[(0,F.jsx)("span",{className:"sb-tile-icon",children:(0,F.jsx)(S.aVM,{})}),(0,F.jsxs)("div",{className:"sb-tile-body",children:[(0,F.jsx)("div",{className:"sb-tile-value",children:Ia.riders}),(0,F.jsx)("div",{className:"sb-tile-label",children:1===Ia.riders?"Rider":"Riders"})]})]})]})]}),Pa||Ce?(0,F.jsxs)("div",{id:"route-detail",children:[(0,F.jsxs)("button",{className:"rd-back",onClick:()=>{Ea(null),ze(null)},children:["\u2190 Back to ",Ae?Ae.name:"list"]}),Pa?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"rd-rider-name",style:{color:Pa.color},children:Pa.riderName}),(()=>{const e=Pa.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),s=Pa.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),a=s<0;return(0,F.jsxs)("div",{className:"rd-stats-grid",children:[(0,F.jsxs)("div",{className:"rd-stat rd-stat-orders",children:[(0,F.jsx)("div",{className:"rd-stat-icon",children:(0,F.jsx)(S.gsJ,{})}),(0,F.jsx)("div",{className:"rd-stat-value",children:Pa.orders.length}),(0,F.jsx)("div",{className:"rd-stat-label",children:"Orders"})]}),(0,F.jsxs)("div",{className:"rd-stat rd-stat-distance",children:[(0,F.jsx)("div",{className:"rd-stat-icon",children:(0,F.jsx)(S.xI$,{})}),(0,F.jsxs)("div",{className:"rd-stat-value",children:[e.toFixed(1),(0,F.jsx)("span",{className:"rd-stat-unit",children:"km"})]}),(0,F.jsx)("div",{className:"rd-stat-label",children:"Distance"})]}),(0,F.jsxs)("div",{className:"rd-stat rd-stat-profit ".concat(a?"is-loss":"is-gain"),children:[(0,F.jsx)("div",{className:"rd-stat-icon",children:a?(0,F.jsx)(S.Rod,{}):(0,F.jsx)(S.imn,{})}),(0,F.jsxs)("div",{className:"rd-stat-value",children:[a?"-":"","\u20b9",Math.abs(s).toFixed(0)]}),(0,F.jsx)("div",{className:"rd-stat-label",children:a?"Loss":"Profit"})]})]})})(),(()=>{const e={};Pa.orders.forEach((s=>{const a=s.trip_number||1;e[a]||(e[a]=[]),e[a].push(s)}));const s=[...Pa.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),a=s?s.orderid:null,t=e=>{const s=e.deliverytime||e.expecteddeliverytime;if(!s)return Number.MAX_SAFE_INTEGER;const a=g()(s);return a.isValid()?a.valueOf():Number.MAX_SAFE_INTEGER},i="time"===Le;let n=null;return Object.entries(e).sort(((e,s)=>{let[a]=e,[t]=s;return Number(a)-Number(t)})).map((e=>{let[s,l]=e;const c=i?[...l].sort(((e,s)=>{const a=t(e)-t(s);return 0!==a?a:(e.step||0)-(s.step||0)})):l;return(0,F.jsxs)("div",{className:"trip-block",children:[(0,F.jsxs)("div",{className:"trip-header",style:{background:"".concat(Pa.color,"12"),borderColor:"".concat(Pa.color,"30")},children:[(0,F.jsxs)("span",{className:"th-badge",style:{background:Pa.color},children:["Trip ",s]}),(0,F.jsxs)("span",{className:"trip-stats",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gwi,{})}),l.length," stops"]}),(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),l.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]})]}),(0,F.jsxs)("div",{className:"trip-sort-toggle",role:"group","aria-label":"Sort stops by","data-mode":i?"time":"planned",children:[(0,F.jsxs)("button",{type:"button",className:"trip-sort-pill ".concat(i?"":"is-active"),"aria-pressed":!i,onClick:()=>qe("planned"),title:"Sort stops by planned step (dispatched order)",children:[(0,F.jsx)(S.EgJ,{"aria-hidden":"true"}),(0,F.jsx)("span",{children:"Planned"})]}),(0,F.jsxs)("button",{type:"button",className:"trip-sort-pill ".concat(i?"is-active":""),"aria-pressed":i,onClick:()=>qe("time"),title:"Sort stops by completion time (which delivery was done first)",children:[(0,F.jsx)(S.VP9,{"aria-hidden":"true"}),(0,F.jsx)("span",{children:"By time"})]})]})]}),(0,F.jsx)("div",{className:"zone-order-grid",children:c.map(((e,t)=>{const l=(e.kitchen_key||e.pickupcustomer||"Unknown").toLowerCase().trim(),c=null!==n&&l!==n;n=l;const d=Ee&&Ee.orderid===e.orderid,o=a&&e.orderid===a,u=parseFloat(e.droplat||e.deliverylat),m=parseFloat(e.droplon||e.deliverylong),p=Number.isFinite(u)&&Number.isFinite(m),h=(0,w.Cx)(e.orderstatus),x=parseFloat(e.profit||0),v=x<0,g=Za(Pa.id,e),f=e.step||t+1,N=i&&!e.deliverytime;return(0,F.jsxs)(r.Fragment,{children:[c&&(0,F.jsxs)("div",{className:"kitchen-transition",children:[(0,F.jsx)("span",{className:"kt-ico",children:(0,F.jsx)(S.$G1,{})})," Switch to ",(0,F.jsx)("strong",{children:e.pickupcustomer})]}),(0,F.jsxs)("div",{className:"zone-order-card ".concat(p?"clickable":""," ").concat(d?"active":""," ").concat(o?"going-on":""," ").concat(N?"is-pending-time":""),role:p?"button":void 0,tabIndex:p?0:void 0,onClick:p?()=>De(d?null:{orderid:e.orderid,lat:u,lon:m}):void 0,onKeyDown:p?s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),De(d?null:{orderid:e.orderid,lat:u,lon:m}))}:void 0,title:p?d?"Click to show full trip":"Show ".concat(e.deliverycustomer||"order #".concat(e.orderid)," on map"):void 0,children:[(0,F.jsxs)("div",{className:"zone-order-card-head",children:[(0,F.jsx)("div",{className:"zone-order-num",title:"Planned step ".concat(e.step||t+1),children:f}),(0,F.jsx)("div",{className:"zone-order-id-block",children:(0,F.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]})}),(()=>{const s=Q(e.deliverytime),a=Q(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==g;return e.orderstatus||s||a||t?(0,F.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,F.jsx)("span",{className:"zone-order-status",style:{background:h.bg,color:h.fg},children:h.label}),(s||a)&&(0,F.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,F.jsx)(S.VP9,{}),s||a]}),t&&(0,F.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,F.jsx)(S.HPi,{}),Xa(g)]})]}):null})(),j&&(0,F.jsx)("button",{type:"button",className:"zone-order-change-rider",title:"Change rider",onClick:s=>{s.stopPropagation(),j(e,Pa)},children:(0,F.jsx)(S.$G1,{})})]}),(0,F.jsxs)("div",{className:"zone-order-customer",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,F.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,F.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gwi,{})}),e.deliverysuburb||D(e.deliveryaddress)]}),e.ordernotes&&(0,F.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.dKO,{})}),e.ordernotes]}),(0,F.jsxs)("div",{className:"zone-order-stats",children:[(0,F.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,F.jsxs)("span",{className:"zone-order-chip ".concat(v?"is-loss":"is-profit"),title:"Profit",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.ohY,{})}),v?"-":"","\u20b9",Math.abs(x).toFixed(0)]}),null!=e.deliverycharge&&(0,F.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,F.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,F.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||s," \xb7 S",e.step||t+1]})]})]})]},e.orderid)}))})]},s)}))})()]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"rd-rider-name",style:{color:"#f59e0b"},children:Ce.kitchenName}),(0,F.jsxs)("div",{className:"rd-rider-sub",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gsJ,{})}),Ce.orders.length," orders"]}),(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.aVM,{})}),Ce.riders.size," riders"]})]}),(0,F.jsxs)("div",{className:"zone-detail-section",children:[(0,F.jsxs)("div",{className:"zone-section-label",children:["Orders ",(0,F.jsxs)("span",{className:"section-count",children:["(",Ce.orders.length,")"]})]}),0===Ce.orders.length?(0,F.jsx)("div",{className:"zone-suburb-panel-empty",children:"No orders for this kitchen."}):(0,F.jsx)("div",{className:"zone-order-grid",children:Ce.orders.map(((e,s)=>{const a=parseFloat(e.droplat||e.deliverylat),t=parseFloat(e.droplon||e.deliverylong),i=Number.isFinite(a)&&Number.isFinite(t),r=Ee&&Ee.orderid===e.orderid,n=(0,w.Cx)(e.orderstatus),l=parseFloat(e.profit||0),c=l<0,d=e.rider_id||e.userid,o=d?Ma.find((e=>String(e.id)===String(d))):null,u=(()=>{if(!o)return null;const e=[...o.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)}));return e?e.orderid:null})(),m=u&&e.orderid===u,p=d?Za(d,e):null;return(0,F.jsxs)("div",{className:"zone-order-card ".concat(i?"clickable":""," ").concat(r?"active":""," ").concat(m?"going-on":""),role:i?"button":void 0,tabIndex:i?0:void 0,onClick:i?()=>De(r?null:{orderid:e.orderid,lat:a,lon:t}):void 0,children:[(0,F.jsxs)("div",{className:"zone-order-card-head",children:[(0,F.jsx)("div",{className:"zone-order-num",children:e.step||s+1}),(0,F.jsxs)("div",{className:"zone-order-id-block",children:[(0,F.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]}),(0,F.jsxs)("div",{className:"zone-order-rider",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.aVM,{})}),e.rider_name||e.ridername||"Unassigned"]})]}),(()=>{const s=Q(e.deliverytime),a=Q(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==p;return e.orderstatus||s||a||t?(0,F.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,F.jsx)("span",{className:"zone-order-status",style:{background:n.bg,color:n.fg},children:n.label}),(s||a)&&(0,F.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,F.jsx)(S.VP9,{}),s||a]}),t&&(0,F.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,F.jsx)(S.HPi,{}),Xa(p)]})]}):null})()]}),(0,F.jsxs)("div",{className:"zone-order-customer",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,F.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,F.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gwi,{})}),e.deliverysuburb||D(e.deliveryaddress)]}),e.ordernotes&&(0,F.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.dKO,{})}),e.ordernotes]}),(0,F.jsxs)("div",{className:"zone-order-stats",children:[(0,F.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,F.jsxs)("span",{className:"zone-order-chip ".concat(c?"is-loss":"is-profit"),title:"Profit",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.ohY,{})}),c?"-":"","\u20b9",Math.abs(l).toFixed(0)]}),null!=e.deliverycharge&&(0,F.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,F.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,F.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||"-"," \xb7 S",e.step||s+1]})]})]},e.orderid)}))})]})]})]}):Ae?(0,F.jsxs)("div",{id:"route-detail",children:[(0,F.jsx)("button",{className:"rd-back",onClick:()=>Pe(null),children:"\u2190 Back to zones"}),(0,F.jsx)("div",{className:"rd-rider-name",style:{color:"#3b82f6"},children:Ae.name}),(0,F.jsx)("div",{className:"rd-rider-sub",children:(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gsJ,{})}),Ae.totalOrders," ",1===Ae.totalOrders?"order":"orders"]})}),(0,F.jsxs)("div",{className:"zone-detail-section",children:[(0,F.jsxs)("div",{className:"zone-section-label",children:["Orders ",(0,F.jsxs)("span",{className:"section-count",children:["(",Ae.orders.length,")"]})]}),0===Ae.orders.length?(0,F.jsx)("div",{className:"zone-suburb-panel-empty",children:"No orders in this zone."}):(0,F.jsx)("div",{className:"zone-order-grid",children:Ae.orders.map(((e,s)=>{const a=parseFloat(e.droplat||e.deliverylat),t=parseFloat(e.droplon||e.deliverylong),i=Number.isFinite(a)&&Number.isFinite(t),r=Ee&&Ee.orderid===e.orderid,n=(0,w.Cx)(e.orderstatus),l=parseFloat(e.profit||0),c=l<0,d=e.rider_id||e.userid,o=d?Ma.find((e=>String(e.id)===String(d))):null,u=(()=>{if(!o)return null;const e=[...o.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)}));return e?e.orderid:null})(),m=u&&e.orderid===u,p=d?Za(d,e):null;return(0,F.jsxs)("div",{className:"zone-order-card ".concat(i?"clickable":""," ").concat(r?"active":""," ").concat(m?"going-on":""),role:i?"button":void 0,tabIndex:i?0:void 0,onClick:i?()=>De(r?null:{orderid:e.orderid,lat:a,lon:t}):void 0,children:[(0,F.jsxs)("div",{className:"zone-order-card-head",children:[(0,F.jsx)("div",{className:"zone-order-num",children:e.step||s+1}),(0,F.jsxs)("div",{className:"zone-order-id-block",children:[(0,F.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]}),(0,F.jsxs)("div",{className:"zone-order-rider",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.aVM,{})}),e.rider_name||e.ridername||"Unassigned"]})]}),(()=>{const s=Q(e.deliverytime),a=Q(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==p;return e.orderstatus||s||a||t?(0,F.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,F.jsx)("span",{className:"zone-order-status",style:{background:n.bg,color:n.fg},children:n.label}),(s||a)&&(0,F.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,F.jsx)(S.VP9,{}),s||a]}),t&&(0,F.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,F.jsx)(S.HPi,{}),Xa(p)]})]}):null})()]}),(0,F.jsxs)("div",{className:"zone-order-customer",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,F.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,F.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.gwi,{})}),e.deliverysuburb||D(e.deliveryaddress)]}),e.ordernotes&&(0,F.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.dKO,{})}),e.ordernotes]}),(0,F.jsxs)("div",{className:"zone-order-stats",children:[(0,F.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,F.jsxs)("span",{className:"zone-order-chip ".concat(c?"is-loss":"is-profit"),title:"Profit",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.ohY,{})}),c?"-":"","\u20b9",Math.abs(l).toFixed(0)]}),null!=e.deliverycharge&&(0,F.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,F.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,F.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||"-"," \xb7 S",e.step||s+1]})]})]},e.orderid)}))})]})]}):(0,F.jsxs)("div",{id:"riders-panel",children:[(0,F.jsx)("div",{className:"ph",children:"zones"===G?"Zone dispatch":"kitchens"===G?"Kitchen dispatch":"Rider dispatch"}),(0,F.jsx)("div",{id:"rider-cards",children:0!==za.length||ja?"zones"===G?Fa.map(((e,s)=>{const a=e.statusCounts.delivered||0,t=e.totalProfit<0;return(0,F.jsxs)("div",{className:"rcard zone-card",onClick:()=>Pe(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,F.jsxs)("div",{className:"zone-card-header",children:[(0,F.jsx)("div",{className:"zone-card-emoji",children:(0,F.jsx)(S.Cd7,{})}),(0,F.jsxs)("div",{className:"zone-card-titles",children:[(0,F.jsx)("div",{className:"zone-card-name",children:e.name}),(0,F.jsxs)("div",{className:"zone-card-sub",children:[e.activeRidersCount," ",1===e.activeRidersCount?"rider":"riders"," \xb7 ",e.totalOrders," ",1===e.totalOrders?"order":"orders"]})]}),(0,F.jsx)("span",{className:"zone-card-arrow","aria-hidden":"true",children:"\u2192"})]}),e.totalOrders>0&&(0,F.jsxs)("div",{className:"zone-progress-row",children:[(0,F.jsx)("div",{className:"zone-status-bar",title:Object.entries(e.statusCounts).map((e=>{let[s,a]=e;return"".concat((0,w.Cx)(s).label,": ").concat(a)})).join(" \xb7 "),children:Object.entries(e.statusCounts).map((s=>{let[a,t]=s;const i=(0,w.Cx)(a),r=t/e.totalOrders*100;return(0,F.jsx)("div",{className:"zone-status-seg",style:{width:"".concat(r,"%"),background:i.bg}},a)}))}),(0,F.jsxs)("div",{className:"zone-progress-label",children:[a,"/",e.totalOrders]})]}),(0,F.jsxs)("div",{className:"zone-stat-pills",children:[(0,F.jsxs)("span",{className:"zone-stat-pill",title:"Areas covered",children:[(0,F.jsx)("span",{className:"zone-stat-icon",children:(0,F.jsx)(S.gwi,{})}),(0,F.jsx)("span",{className:"zone-stat-value",children:e.suburbs.length}),(0,F.jsx)("span",{className:"zone-stat-label",children:1===e.suburbs.length?"area":"areas"})]}),(0,F.jsxs)("span",{className:"zone-stat-pill",title:"Total distance",children:[(0,F.jsx)("span",{className:"zone-stat-icon",children:(0,F.jsx)(S.xI$,{})}),(0,F.jsx)("span",{className:"zone-stat-value",children:e.totalKms.toFixed(1)}),(0,F.jsx)("span",{className:"zone-stat-label",children:"km"})]}),(0,F.jsxs)("span",{className:"zone-stat-pill",title:"Kitchens",children:[(0,F.jsx)("span",{className:"zone-stat-icon",children:(0,F.jsx)(S.NtI,{})}),(0,F.jsx)("span",{className:"zone-stat-value",children:e.kitchens.length}),(0,F.jsx)("span",{className:"zone-stat-label",children:1===e.kitchens.length?"kitchen":"kitchens"})]}),(0,F.jsxs)("span",{className:"zone-stat-pill ".concat(t?"profit-negative":"profit-positive"),title:"Total profit",children:[(0,F.jsx)("span",{className:"zone-stat-icon",children:(0,F.jsx)(S.ohY,{})}),(0,F.jsx)("span",{className:"zone-stat-value",children:t?"-\u20b9".concat(Math.abs(e.totalProfit).toFixed(0)):"\u20b9".concat(e.totalProfit.toFixed(0))})]})]}),e.suburbs.length>0&&(0,F.jsxs)("div",{className:"zone-card-suburbs",children:[(0,F.jsx)("span",{className:"zone-card-suburbs-text",children:e.suburbs.slice(0,3).map((e=>e.name)).join(" \xb7 ")}),e.suburbs.length>3&&(0,F.jsxs)("span",{className:"zone-card-suburbs-more",children:["+",e.suburbs.length-3]})]})]},e.id)})):"kitchens"===G?Ca.map(((e,s)=>(0,F.jsxs)("div",{className:"rcard",onClick:()=>ze(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,F.jsxs)("div",{className:"rcard-top",children:[(0,F.jsx)("div",{className:"rcard-emo",style:{background:"#f59e0b18",borderColor:"#f59e0b50",color:"#f59e0b"},children:(0,F.jsx)(S.NtI,{})}),(0,F.jsxs)("div",{className:"rcard-info",children:[(0,F.jsx)("div",{className:"rcard-name",children:e.kitchenName}),(0,F.jsxs)("div",{className:"rcard-zone",children:[e.riders.size," riders \xb7 ",(0,F.jsx)(ne,{children:(0,F.jsx)(S.ohY,{})}),"\u20b9",e.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0).toFixed(0)]})]}),(0,F.jsx)("div",{className:"rcard-badge",style:{background:"#f59e0b18",color:"#f59e0b"},children:e.orders.length})]}),(0,F.jsx)("div",{className:"bar-bg",children:(0,F.jsx)("div",{className:"bar-fg",style:{width:"".concat(Math.min(100,e.orders.length/20*100),"%"),background:"#f59e0b"}})}),(0,F.jsxs)("div",{className:"rcard-meta",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),e.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]}),(0,F.jsxs)("span",{children:[e.riders.size," riders"]})]}),(0,F.jsx)("div",{className:"step-ids",children:Array.from(e.riders).slice(0,10).map((e=>{var s;return(0,F.jsx)("span",{className:"step-id",style:{color:$a(e)},children:null===(s=Ma.find((s=>s.id===e)))||void 0===s?void 0:s.riderName.split(" ")[0]},e)}))})]},e.id))):Ma.map(((e,s)=>{var a;const t=e.orders.length,i=e.orders.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length,r=t>0&&i>=t,n=e.orders.find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),l=n?Za(e.id,n):null;return(0,F.jsxs)("div",{className:"rcard",onClick:()=>Ea(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,F.jsxs)("div",{className:"rcard-top",children:[(0,F.jsx)("div",{className:"rcard-emo",style:{background:"".concat(e.color,"18"),borderColor:"".concat(e.color,"50"),color:e.color},children:(0,F.jsx)(S.aVM,{})}),(0,F.jsxs)("div",{className:"rcard-info",children:[(0,F.jsx)("div",{className:"rcard-name",children:e.riderName}),(0,F.jsxs)("div",{className:"rcard-zone",children:[(null===(a=e.orders[0])||void 0===a?void 0:a.zone_name)||bs||"Local"," \xb7 ",new Set(e.orders.map((e=>e.trip_number||1))).size," trips"]})]}),(0,F.jsxs)("div",{className:"rcard-badge ".concat(r?"is-done":""),style:r?void 0:{background:"".concat(e.color,"18"),color:e.color},title:"".concat(i," delivered of ").concat(t," total"),children:[i,"/",t]})]}),(0,F.jsx)("div",{className:"bar-bg",children:(0,F.jsx)("div",{className:"bar-fg",style:{width:"".concat(Math.min(100,t/15*100),"%"),background:e.color}})}),(0,F.jsxs)("div",{className:"rcard-meta",children:[(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.xI$,{})}),e.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]}),null!==l&&(0,F.jsxs)("span",{className:"rcard-est-meters",title:"Estimated distance to next drop location",children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.HPi,{})}),Xa(l)," to drop"]}),(0,F.jsxs)("span",{children:[(0,F.jsx)(ne,{children:(0,F.jsx)(S.ohY,{})}),"\u20b9",e.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0).toFixed(0)]})]}),(0,F.jsx)("div",{className:"step-ids",children:e.orders.slice(0,15).map((e=>(0,F.jsxs)("span",{className:"step-id",children:["S",e.step]},e.orderid)))})]},e.id)})):(e=>{const s=null===(e=ns.find((e=>e.id===ua)))||void 0===e?void 0:e.label,a=ha&&ya.length>0;return(0,F.jsxs)("div",{className:"empty-slot",children:[(0,F.jsx)("div",{className:"empty-slot-icon",children:(0,F.jsx)(S.gsJ,{})}),(0,F.jsx)("div",{className:"empty-slot-title",children:s?"No orders in ".concat(s):"No orders"}),(0,F.jsx)("div",{className:"empty-slot-sub",children:a?"".concat(ya.length," order").concat(1===ya.length?"":"s"," exist in other slots today"):"No deliveries found for this date"})]})})()})]})]}),(0,F.jsxs)("div",{id:"map-wrap",className:"".concat("kitchens"===G?"view-mode-kitchens":""," ").concat(Ys?"compare-split":"").trim(),children:[(0,F.jsxs)(d.W,{center:[11.022,76.982],zoom:12,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},zoomControl:!1,renderer:ca.current,inertia:!0,inertiaDeceleration:2400,inertiaMaxSpeed:2e3,wheelDebounceTime:20,wheelPxPerZoomLevel:80,zoomSnap:.25,children:[(0,F.jsx)(o.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),(0,F.jsx)(p.p,{position:"bottomright"}),Ys&&(0,F.jsx)(W,{targetRef:la}),(0,F.jsx)(re,{focusedItem:Ba||(Pa||Ce)&&Ee||Pa||Ce||Ae,viewMode:G,orders:za,kitchens:Ca,locationKey:Je}),Ca.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).filter((e=>!Pa||e.riders.has(Pa.id))).map(((e,s)=>(0,F.jsx)(l.p,{position:[e.lat,e.lon],icon:Wa(e.kitchenName,(null===Ce||void 0===Ce?void 0:Ce.id)===e.id),zIndexOffset:(null===Ce||void 0===Ce?void 0:Ce.id)===e.id?4e3:2e3,eventHandlers:{click:()=>ze(e),mouseover:e=>e.target.openPopup(),mouseout:e=>e.target.closePopup()},children:(0,F.jsxs)(m.z,{className:"kitchen-popup",maxWidth:220,minWidth:200,autoPan:!0,autoPanPadding:[20,20],children:[(0,F.jsx)("div",{className:"kp-header",children:"KITCHEN"}),(0,F.jsx)("div",{className:"kp-name",children:e.kitchenName}),(0,F.jsxs)("div",{className:"kp-stat",children:[(0,F.jsx)("span",{className:"kp-stat-lbl",children:"Orders"}),(0,F.jsx)("span",{className:"kp-stat-val",children:e.orders.length})]})]})},"k-".concat(s)))),(()=>{if(Ys&&Pa&&"actual"===Ks)return null;let e=za;Ae&&(e=Ae.orders),Ce&&(e=Ce.orders),Pa&&(e=Pa.orders),e=e.filter(L);const s=Ys&&Pa?new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))):null;return e.map(((a,t)=>{const i=a.rider_id,r=!i||_e.has(i);let n,c=$a(i);if(s&&i===Pa.id&&null!=a.deliveryid){const e=s.get(String(a.deliveryid));e&&(c=(0,w.gM)(e-1),n=e)}const d=!!Pa||!!Ce,o=(0,w.Cx)(a.orderstatus),u="delivered"===String(a.orderstatus||"").toLowerCase(),m=v&&String(v)===String(a.orderid),p=a.orderstatus?'\n \n \n ').concat(u?'':"","\n "):"",h=d?(()=>{const s=n||a.step||e.indexOf(a)+1,t=32;return x().divIcon({className:"",iconSize:[t,t],iconAnchor:[16,16],popupAnchor:[0,-28],html:'
9?12:14,"px;opacity:").concat(r?1:.75,'">').concat(s>0?s:"").concat(p,"
")})})():x().divIcon({className:"",iconSize:[24,30],iconAnchor:[2,30],popupAnchor:[10,-25],html:'
').concat(p,"
")});return(0,F.jsx)(l.p,{position:[parseFloat(a.droplat||a.deliverylat),parseFloat(a.droplon||a.deliverylong)],icon:h,zIndexOffset:i?100:0,ref:e=>{e?Ie.current[String(a.orderid)]=e:delete Ie.current[String(a.orderid)]},eventHandlers:{click:()=>{const e=String(a.orderid);Oe.current.has(e)?(Oe.current.delete(e),Ye(null)):(Oe.current.add(e),Ye(a))}}},"".concat(a.orderid,"-").concat(d?"num":"flag"))}))})(),(()=>{const e=Ys&&Pa&&"actual"===Ks;if(Ms)return e?[]:zs.map(((e,s)=>(0,F.jsx)(c.R,{positions:[e.from,e.to],pathOptions:{color:e.color,weight:6,opacity:.9,lineJoin:"round",lineCap:"round"}},s)));const s=[],a=Ae?new Set(Ae.riders.map((e=>String(e.rider_id)))):null;return e||Ma.forEach((e=>{const t=_e.has(e.id);if(Pa&&Pa.id!==e.id)return;if(Ce&&!Ce.riders.has(e.id))return;if(a&&!a.has(String(e.id)))return;const i=e.orders,n={};i.forEach((e=>{const s=e.trip_number||1;n[s]||(n[s]=[]),n[s].push(e)})),Object.entries(n).forEach((a=>{let[i,n]=a;const l=Ce?n.filter((e=>(e.pickupcustomer||e.kitchen_key||"Unknown").toLowerCase().trim()===Ce.id)):n;if(0===l.length)return;const d=[...n].sort(((e,s)=>(e.step||0)-(s.step||0))),o=se(d),u=ae(e.id,i,o),m=ys[u],p=[...l].sort(((e,s)=>(e.step||0)-(s.step||0))),h=Array.isArray(m)&&m.length>=2,x=!1===m;if(!h&&!x)return;const v=h?m:se(p);if(!v||v.length<2)return;const j=t?1:.1,g="kitchens"===G||Ce?7:6,f=Ys&&Pa&&e.id===Pa.id,N=x?"8 6":f&&"combined"===Ks?"6 5":void 0;if(Ys&&Pa&&e.id===Pa.id){const a=new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))),t=p.filter(L),r=t.map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]));let n;if(h)n=X(v,r);else{const e=v.length>r.length;n=[];for(let s=0;s=v.length||t>=v.length?n.push([]):n.push([v[a],v[t]])}}const l="combined"===Ks?5:0;return s.push((0,F.jsx)(c.R,{positions:v,pathOptions:{color:"#ffffff",weight:g+4,opacity:.5*j,lineJoin:"round",lineCap:"round",offset:l}},"".concat(e.id,"-").concat(i,"-halo"))),void n.forEach(((r,n)=>{if(!r||r.length<2)return;const d=t[n],o=d?a.get(String(d.deliveryid)):null,u="combined"===Ks?A:o?(0,w.gM)(o-1):e.color,m=null!=ra&&ra===o,p=m?g+1.5:g,h=m?1:ra?.5*j:j;s.push((0,F.jsx)(c.R,{positions:r,pathOptions:{color:u,weight:p,opacity:h,lineJoin:"round",lineCap:"round",dashArray:N,offset:l}},"".concat(e.id,"-").concat(i,"-step-").concat(n,"-").concat((null===d||void 0===d?void 0:d.deliveryid)||n)))}))}s.push((0,F.jsxs)(r.Fragment,{children:[(0,F.jsx)(c.R,{positions:v,pathOptions:{color:"#ffffff",weight:g+4,opacity:.5*j,lineJoin:"round",lineCap:"round"}}),(0,F.jsx)(c.R,{positions:v,pathOptions:{color:e.color,weight:g,opacity:j,lineJoin:"round",lineCap:"round",dashArray:N}})]},"".concat(e.id,"-").concat(i)))}))})),s})(),oa.filter((e=>Ma.some((s=>String(s.id)===String(e.id))))).filter((e=>!Pa||String(Pa.id)===String(e.id))).map((e=>{var s;const a="active"===e.status?"#16a34a":"#dc2626",t=Ma.find((s=>String(s.id)===String(e.id))),i=null===t||void 0===t||null===(s=t.orders)||void 0===s?void 0:s.slice().sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),r=i?i.deliverysuburb||D(i.deliveryaddress):null,n=x().divIcon({className:"",iconSize:[140,56],iconAnchor:[12,41],popupAnchor:[58,-40],html:'
\n
\n
').concat((e.username||"").replace(/[<>&"']/g,"")).concat(e.orderid?" #".concat(String(e.orderid).replace(/[<>&"']/g,""),""):"","
\n
")});return(0,F.jsx)(l.p,{position:[e.lat,e.lon],icon:n,zIndexOffset:2500,eventHandlers:{click:s=>{const a=String(e.id);Re.current.has(a)?(Re.current.delete(a),s.target.closePopup()):(Re.current.add(a),s.target.openPopup());const t=Ma.find((e=>String(e.id)===a));t&&Ea(t)},popupclose:()=>{Re.current.delete(String(e.id))}},children:(0,F.jsxs)(m.z,{maxWidth:260,autoPan:!0,autoPanPadding:[20,20],className:"dispatch-popup live-rider-popup",children:[(0,F.jsx)("div",{className:"pu-hdr-live",children:(0,F.jsxs)("div",{className:"pu-hdr-left",children:[(0,F.jsx)("span",{className:"pu-live-indicator",style:{"--pulse-color":a},children:(0,F.jsx)("span",{className:"pu-live-dot"})}),(0,F.jsx)("span",{className:"pu-hdr-title",children:"LIVE GPS"})]})}),(0,F.jsxs)("div",{className:"pu-rider-profile",children:[(0,F.jsx)("div",{className:"pu-avatar",style:{backgroundColor:"".concat(a,"12"),color:a},children:(0,F.jsx)(S.bsz,{})}),(0,F.jsxs)("div",{className:"pu-rider-info-text",children:[(0,F.jsxs)("div",{className:"pu-rider-name-row",children:[(0,F.jsx)("span",{className:"pu-rider-name",children:e.username||"Rider #".concat(e.id)}),e.status&&(0,F.jsx)("span",{className:"pu-status-badge ".concat("active"===e.status.toLowerCase()?"active":"idle"),children:e.status})]}),(0,F.jsxs)("div",{className:"pu-rider-meta",children:["Rider ID: #",e.id]})]})]}),(0,F.jsxs)("div",{className:"pu-body-content",children:[e.orderid&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Active Order"}),(0,F.jsxs)("span",{className:"pu-info-value pu-order-badge",children:["#",e.orderid]})]}),i&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Next Stop"}),(0,F.jsxs)("span",{className:"pu-info-value",style:{color:"#4f46e5"},children:["#",i.step||"?"," \xb7 ",i.deliverycustomer||"\u2014"]})]}),r&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Next Location"}),(0,F.jsx)("span",{className:"pu-info-value",title:i.deliveryaddress||r,children:r})]}),(null===i||void 0===i?void 0:i.pickupcustomer)&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Pickup"}),(0,F.jsx)("span",{className:"pu-info-value",title:i.pickupcustomer,children:i.pickupcustomer})]}),e.contactno&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Phone"}),(0,F.jsx)("a",{href:"tel:".concat(e.contactno),className:"pu-info-value pu-phone-link",children:e.contactno})]}),e.logdate&&(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Last Seen"}),(0,F.jsxs)("span",{className:"pu-info-value pu-time-stamp",children:[(0,F.jsx)(S.VP9,{className:"inline-icon"})," ",g()(e.logdate).isValid()?g()(e.logdate).format("hh:mm:ss A"):e.logdate]})]}),(0,F.jsxs)("div",{className:"pu-info-row",children:[(0,F.jsx)("span",{className:"pu-info-label",children:"Position"}),(0,F.jsxs)("span",{className:"pu-info-value pu-coordinates",children:[e.lat.toFixed(5),", ",e.lon.toFixed(5)]})]})]})]})},"live-".concat(e.id))})),Ys&&Pa&&"planned"!==Ks&&Ta.map(((e,s)=>{var a,t;if(0===e.coords.length)return null;const i=(0,w.gM)(s),n="combined"===Ks?P:i,d=[e.coords[0].lat,e.coords[0].lng],o=[e.coords[e.coords.length-1].lat,e.coords[e.coords.length-1].lng],m=_s[e.deliveryid],p=Array.isArray(m)&&m.length>=2?m:e.coords.map((e=>[e.lat,e.lng]));let h=p,v=!0;if(Ms){const s=Ps[e.sequenceStep]||0;s<2?v=!1:h=p.slice(0,Math.min(s,p.length))}const j=ra===e.sequenceStep,f=String(e.orderstatus||"").toLowerCase(),N=w.Ys.has(f),b=w.yP.has(f),y=Ha.find((s=>s.sequenceStep===e.sequenceStep)),k=!(null===y||void 0===y||!y.anomaly),_=null===Pa||void 0===Pa||null===(a=Pa.orders)||void 0===a?void 0:a.find((s=>null!=s.deliveryid&&String(s.deliveryid)===String(e.deliveryid))),M=(0,w.Cx)(e.orderstatus),C=(e.orderstatus&&'\n \n \n ').concat(N?'':"","\n "),["compare-step-pin"]);j&&C.push("is-focused"),N&&C.push("is-delivered"),b&&C.push("is-skipped"),k&&C.push("is-anomaly");const z='
')+''.concat(e.sequenceStep,"")+(N?'':"")+"
",A=x().divIcon({className:"",iconSize:[36,36],iconAnchor:[18,18],popupAnchor:[0,-22],html:z}),E=1===e.sequenceStep,D=E?x().divIcon({className:"",iconSize:[40,40],iconAnchor:[20,20],html:'
')+'
'}):null,L="combined"===Ks?-5:0;return(0,F.jsxs)(r.Fragment,{children:[v&&(0,F.jsx)(c.R,{positions:h,pathOptions:{color:"#ffffff",weight:j?11:9,opacity:j?.75:.55,lineJoin:"round",lineCap:"round",offset:L}}),v&&(0,F.jsx)(c.R,{positions:h,pathOptions:{color:n,weight:j?6.5:5,opacity:j?1:ra?.55:.95,lineJoin:"round",lineCap:"round",offset:L}}),E&&(0,F.jsx)(l.p,{position:d,icon:D,zIndexOffset:j?900:100,eventHandlers:{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep))}},children:(0,F.jsx)(u.m,{direction:"top",offset:[0,-12],opacity:1,className:"compare-tooltip",children:(0,F.jsxs)("div",{className:"cmp-tip",children:[(0,F.jsxs)("div",{className:"cmp-tip-header",children:[(0,F.jsx)("span",{className:"cmp-tip-step",style:{background:i},children:(0,F.jsx)(S.zPd,{})}),(0,F.jsxs)("div",{className:"cmp-tip-title-stack",children:[(0,F.jsx)("div",{className:"cmp-tip-title",children:e.pickupcustomer||"Pickup"}),(0,F.jsx)("div",{className:"cmp-tip-sub",children:null!==(t=e.coords[0])&&void 0!==t&&t.logdate?"Picked up \xb7 ".concat(g()(e.coords[0].logdate).format("hh:mm A")):"Rider trip origin"})]})]}),(0,F.jsx)("div",{className:"cmp-tip-action",children:"Click for step 1 details"})]})})}),(0,F.jsx)(l.p,{position:o,icon:A,zIndexOffset:j?1e3:200,eventHandlers:_?{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep)),Te.current&&(clearTimeout(Te.current),Te.current=null);const a=String(_.orderid);Oe.current.has(a)?(Oe.current.delete(a),Ye(null)):(Oe.current.add(a),Ye(_))}}:{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep)),_&&s.target&&"function"===typeof s.target.openPopup&&s.target.openPopup()}},children:!_&&(0,F.jsx)(u.m,{direction:"top",offset:[0,-20],opacity:1,className:"compare-tooltip",children:(()=>{const s=(0,w.Cx)(e.orderstatus);return(0,F.jsxs)("div",{className:"cmp-tip",children:[(0,F.jsxs)("div",{className:"cmp-tip-header",children:[(0,F.jsx)("span",{className:"cmp-tip-step",style:{background:i},children:e.sequenceStep}),(0,F.jsxs)("div",{className:"cmp-tip-title-stack",children:[(0,F.jsx)("div",{className:"cmp-tip-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),(0,F.jsx)("div",{className:"cmp-tip-sub",children:e.deliverytime?"Delivered ".concat(g()(e.deliverytime).format("hh:mm A")):"".concat(e.coords.length," GPS pings")})]}),e.orderstatus&&(0,F.jsx)("span",{className:"cmp-tip-tag",style:{background:s.bg,color:s.fg},children:s.label})]}),k&&(0,F.jsx)("div",{className:"cmp-tip-anomaly",children:"Deviation flagged \u2014 see details below"}),(0,F.jsx)("div",{className:"cmp-tip-action",children:j?"Click to deselect":"Click for details"})]})})()})})]},"actual-".concat(e.deliveryid))}))]}),Ys&&Pa&&(0,F.jsxs)("div",{className:"compare-view-switcher",role:"group","aria-label":"Compare view layer",children:[(0,F.jsx)("button",{type:"button",className:"actual"===Ks?"is-active":"",onClick:()=>Bs("actual"),title:"Show only the rider's actual GPS trail",children:"Actual"}),(0,F.jsx)("button",{type:"button",className:"planned"===Ks?"is-active":"",onClick:()=>Bs("planned"),title:"Show only the dispatched planned route",children:"Planned"}),(0,F.jsx)("button",{type:"button",className:"combined"===Ks?"is-active":"",onClick:()=>Bs("combined"),title:"Overlay planned (dashed) and actual (solid) on one map",children:"Combined"})]}),(0,F.jsx)("div",{id:"ov-tl"}),(0,F.jsxs)("div",{id:"ov-br",children:[(0,F.jsxs)("button",{className:"sbt ".concat(Ms?"active":""),onClick:()=>{if(Ms)return Cs(!1),As([]),void Es({});Cs(!0),As([]),Es({});const e=Ys&&Pa,s=e?new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))):null,a=[];if(Ma.forEach((t=>{if(!_e.has(t.id))return;if(Pa&&Pa.id!==t.id)return;if(Ce&&!Ce.riders.has(t.id))return;const i={};t.orders.forEach((e=>{const s=e.trip_number||1;i[s]||(i[s]=[]),i[s].push(e)})),Object.entries(i).forEach((i=>{let[r,n]=i;const l=Ce?n.filter((e=>(e.pickupcustomer||e.kitchen_key||"Unknown").toLowerCase().trim()===Ce.id)):n;if(0===l.length)return;const c=[...n].sort(((e,s)=>(e.step||0)-(s.step||0))),d=se(c),o=ae(t.id,r,d),u=ys[o],m=[...l].sort(((e,s)=>(e.step||0)-(s.step||0))),p=se(m),h="kitchens"===G||Ce,x=u||p;if(x.length<2)return;let v=()=>t.color;if(e&&t.id===Pa.id){const e=m.filter(L).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])),a=u?X(u,e):(()=>{const s=p.length>e.length,a=[];for(let t=0;t=p.length||i>=p.length?a.push([]):a.push([p[e],p[i]])}return a})(),i=[];let r=0;a.forEach(((e,s)=>{const a=Math.max(0,((null===e||void 0===e?void 0:e.length)||0)-1);for(let t=0;t{const a=i[e];if(null==a)return t.color;const r=m.filter(L)[a],n=r?s.get(String(r.deliveryid)):null;return n?(0,w.gM)(n-1):t.color}}for(let e=0;ee.delay-s.delay)),a.forEach(((e,s)=>{setTimeout((()=>{As((s=>[...s,e])),s===a.length-1&&setTimeout((()=>{Cs(!1),Es({})}),1e3)}),e.delay)})),e&&Ta.length>0){const e=[...Ta],s=e.map((e=>{const s=_s[e.deliveryid];return Array.isArray(s)&&s.length>=2?s:e.coords.map((e=>[e.lat,e.lng]))})),t=a.length>0?a[a.length-1].delay:800*e.length,i=Math.max(t,600*e.length),r=i/Math.max(1,e.length),n=Date.now(),l=()=>{if(!Ds.current)return;const a=Date.now()-n,t={};e.forEach(((e,i)=>{const n=s[i];if(!n||n.length<2)return;const l=i*r;if(a>=l+r)t[e.sequenceStep]=n.length;else if(a>=l){const s=(a-l)/r;t[e.sequenceStep]=Math.max(2,Math.ceil(s*n.length))}})),Es(t),a{if(Ys)Vs(!1);else{if(!Pa){const e=Ma.find((e=>(e.orders||[]).some((e=>null!=e.deliveryid&&""!==e.deliveryid&&0!==e.deliveryid)))),s=Ma.find((e=>e.orders&&e.orders.length>0)),a=e||s;if(a&&(Ea(a),Ve))return void(Xs.current=!0)}Vs(!0)}},title:Pa?"Compare planned vs. actual route for ".concat(Pa.riderName):"Compare planned vs. actual route (will focus the first rider)",style:{boxShadow:"var(--shadow-lg)",background:Ys?"linear-gradient(135deg, #6366f1, #3b82f6)":"#fff",marginLeft:8,color:Ys?"#fff":void 0},children:[(0,F.jsx)("span",{className:"sbt-icon",children:(0,F.jsx)(S.$G1,{})}),Ys?"Exit Compare":"Compare"]})]})]}),Ys&&Pa&&(0,F.jsx)("div",{id:"compare-map-wrap",children:(()=>{const e=Ta.length,s=Ta.filter((e=>e.coords.length>0)).length,a=Ta.filter((e=>e.isLoading)).length,t=e>0?Math.round(s/e*100):0,i=e>0&&s===e&&0===a,n=null!=ra?Ha.find((e=>e.sequenceStep===ra)):null;return(0,F.jsxs)("div",{className:"compare-header-v2",children:[(0,F.jsxs)("div",{className:"compare-header-row",children:[(0,F.jsxs)("div",{className:"compare-title",children:[(0,F.jsx)("span",{className:"compare-title-dot",style:{background:Pa.color}}),(0,F.jsx)("span",{className:"compare-title-name",children:Pa.riderName}),(0,F.jsx)("span",{className:"compare-title-badge",children:"ACTUAL vs PLANNED"})]}),(0,F.jsxs)("div",{className:"compare-header-tools",children:[null!=ra&&(0,F.jsxs)("button",{type:"button",className:"compare-overall-btn",onClick:()=>na(null),title:"Zoom out to the whole day",children:[(0,F.jsx)(S.Zs6,{})," Overall"]}),(0,F.jsx)("button",{type:"button",className:"compare-timeline-toggle".concat(Js?" is-open":""),onClick:()=>Ws((e=>!e)),title:Js?"Hide planned/actual timeline":"Show planned/actual timeline","aria-expanded":Js,children:(0,F.jsx)(S.j1Q,{})})]})]}),Js&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"compare-timeline-wrap",children:[(0,F.jsxs)("div",{className:"compare-timeline-container",children:[(0,F.jsxs)("div",{className:"compare-timeline-labels",children:[(0,F.jsx)("div",{className:"compare-timeline-label",children:"Planned"}),(0,F.jsx)("div",{className:"compare-timeline-label",children:"Actual"})]}),(0,F.jsxs)("div",{className:"compare-timeline-scrollable",children:[(0,F.jsx)("div",{className:"compare-timeline-track is-planned",children:Va.map(((e,s)=>{var a;const t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),n=w.yP.has(t),l=ra===e.sequenceStep,c=e.isLoading&&0===e.coordsCount,d=!e.isLoading&&0===e.coordsCount,o=(null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep,u=(0,w.gM)(o-1),m=["compare-step",l&&"is-focused",i&&"is-delivered",n&&"is-skipped",!i&&!n&&"is-pending",c&&"is-loading",d&&"is-no-data",e.anomaly&&"is-anomaly"].filter(Boolean).join(" ");return(0,F.jsxs)(r.Fragment,{children:[s>0&&(0,F.jsx)("span",{className:"compare-step-spacer"}),(0,F.jsxs)("button",{type:"button",className:m,style:{"--step-color":u},onClick:()=>na((s=>s===e.sequenceStep?null:e.sequenceStep)),title:"Planned Step ".concat(o)+(e.deliverycustomer?" \xb7 ".concat(e.deliverycustomer):"")+(e.expectedTs?" \xb7 ".concat(e.expectedTs.format("hh:mm A")):"")+(e.anomaly?" \xb7 deviation flagged":""),children:[(0,F.jsx)("span",{className:"compare-step-circle",children:c?(0,F.jsx)("span",{className:"compare-step-spin"}):o}),e.expectedTs&&(0,F.jsx)("span",{className:"compare-step-tick",children:e.expectedTs.format("HH:mm")})]})]},"step-p-".concat(e.deliveryid))}))}),(0,F.jsx)("div",{className:"compare-timeline-track is-actual",children:Ka.map(((e,s)=>{var a;const t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),n=w.yP.has(t),l=ra===e.sequenceStep,c=e.isLoading&&0===e.coordsCount,d=!e.isLoading&&0===e.coordsCount,o=(null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep,u=(0,w.gM)(o-1),m=["compare-step",l&&"is-focused",i&&"is-delivered",n&&"is-skipped",!i&&!n&&"is-pending",c&&"is-loading",d&&"is-no-data",e.anomaly&&"is-anomaly"].filter(Boolean).join(" ");return(0,F.jsxs)(r.Fragment,{children:[s>0&&(0,F.jsx)("span",{className:"compare-step-spacer"}),(0,F.jsxs)("button",{type:"button",className:m,style:{"--step-color":u},onClick:()=>na((s=>s===e.sequenceStep?null:e.sequenceStep)),title:"Actual Visit ".concat(s+1," (Planned Step ").concat(o,")")+(e.deliverycustomer?" \xb7 ".concat(e.deliverycustomer):"")+(e.actualTs?" \xb7 ".concat(e.actualTs.format("hh:mm A")):"")+(e.anomaly?" \xb7 deviation flagged":""),children:[(0,F.jsx)("span",{className:"compare-step-circle",children:c?(0,F.jsx)("span",{className:"compare-step-spin"}):o}),e.actualTs&&(0,F.jsx)("span",{className:"compare-step-tick",children:e.actualTs.format("HH:mm")}),e.anomaly&&(0,F.jsx)("span",{className:"compare-step-flag",title:"Deviation flagged"})]})]},"step-a-".concat(e.deliveryid))}))})]})]}),(0,F.jsxs)("div",{className:"compare-progress-strip",children:[(0,F.jsx)("div",{className:"compare-progress-bar-wrap",children:(0,F.jsx)("div",{className:"compare-progress-bar-fill".concat(i?" is-done":""),style:{width:"".concat(t,"%")}})}),(0,F.jsx)("span",{className:"compare-progress-text",children:a>0?"Loading GPS\u2026 ".concat(s,"/").concat(e):"".concat(s,"/").concat(e," tracks")})]})]}),(()=>{const e="combined"===Ks,s=n?(0,w.gM)(n.sequenceStep-1):"linear-gradient(90deg, ".concat(w.Z3.slice(0,6).join(", "),")"),a=e?A:s,t=e?P:s;return(0,F.jsxs)("div",{className:"compare-legend",children:[(0,F.jsxs)("span",{className:"compare-legend-item",children:[(0,F.jsx)("span",{className:"compare-legend-swatch is-step-color is-dashed",style:{background:a}}),"Planned (dashed)"]}),(0,F.jsxs)("span",{className:"compare-legend-item",children:[(0,F.jsx)("span",{className:"compare-legend-swatch is-step-color",style:{background:t}}),"Actual GPS (solid)"]}),(0,F.jsx)("span",{className:"compare-legend-note",children:"Kalman-smoothed GPS \xb7 OSRM road-snapped"})]})})()]})]})})()}),Ys&&Pa&&(0,F.jsx)(M,{focusedRider:Pa,compareDeltas:Ha,compareSummary:Ya,actualOrdered:Ka,focusedCompareStep:ra,setFocusedCompareStep:na,sequenceOpen:Us,setSequenceOpen:Gs,expandedSeqGroups:$s,setExpandedSeqGroups:Zs,onClose:()=>Vs(!1)})]}),He&&(0,F.jsx)("div",{className:"dispatch-popup-center",role:"dialog","aria-label":"Order ".concat(He.orderid," details"),onMouseEnter:()=>{Te.current&&(clearTimeout(Te.current),Te.current=null)},onMouseLeave:()=>{(e=>{if(!e)return!1;if(Oe.current.has(String(e.orderid)))return!0;if(Ys&&Pa&&null!=e.deliveryid){const s=Ta.find((s=>String(s.deliveryid)===String(e.deliveryid)));if(s&&ra===s.sequenceStep)return!0}return!1})(He)||(Te.current&&clearTimeout(Te.current),Te.current=setTimeout((()=>{Ye(null),Te.current=null}),200))},children:(0,F.jsxs)("div",{className:"dispatch-popup-card dispatch-popup",children:[(0,F.jsx)("button",{type:"button",className:"dispatch-popup-center-close","aria-label":"Close order details",onClick:()=>{Oe.current.delete(String(He.orderid)),Ye(null)},children:"\xd7"}),(e=>{const s=(0,w.Cx)(e.orderstatus),a=e.rider_id||e.userid,t=w.Ys.has(String(e.orderstatus||"").toLowerCase()),i=t?null:Za(a,e);return(0,F.jsxs)("div",{style:{height:"100%",width:"100%"},children:[(0,F.jsxs)("div",{className:"pu-header",children:[(0,F.jsxs)("div",{className:"pu-header-top",children:[(0,F.jsxs)("div",{className:"pu-id",children:["ORDER #",e.orderid]}),e.orderstatus&&(0,F.jsx)("span",{className:"pu-status-chip",style:{background:s.bg,color:s.fg},children:s.label})]}),(0,F.jsxs)("div",{className:"pu-rider",children:[(0,F.jsx)(S.aVM,{})," ",(0,F.jsx)("span",{children:e.rider_name||e.ridername||"Unassigned"})]}),(e.deliverycustomer||e.customername)&&(0,F.jsxs)("div",{className:"pu-customer",title:e.deliverycustomer||e.customername,children:[(0,F.jsx)(S.u9F,{}),(0,F.jsx)("span",{children:e.deliverycustomer||e.customername})]}),null!=e.deliveryid&&(0,F.jsxs)("div",{className:"pu-delivery-id",children:["Delivery #",e.deliveryid]})]}),(0,F.jsxs)("div",{className:"pu-body",children:[ee.some((s=>e[s.key]))&&(0,F.jsxs)("div",{className:"pu-section",children:[(0,F.jsx)("div",{className:"pu-section-label",children:"Timeline"}),(0,F.jsx)("div",{className:"pu-timeline",children:ee.map((s=>{const a=Q(e[s.key]);return a?(0,F.jsxs)("div",{className:"pu-tl-row ".concat(s.final?"delivered":""),children:[(0,F.jsx)("span",{className:"pu-tl-dot"}),(0,F.jsx)("span",{className:"pu-tl-label",children:s.label}),(0,F.jsx)("span",{className:"pu-tl-time",children:a})]},s.key):null}))})]}),(0,F.jsxs)("div",{className:"pu-section",children:[(0,F.jsx)("div",{className:"pu-section-label",children:"Details"}),(0,F.jsxs)("div",{className:"pu-details-grid",children:[(e.pickupcustomer||e.locationname||e.pickuplocation)&&(0,F.jsxs)("div",{className:"pu-detail",children:[(0,F.jsx)("div",{className:"pu-detail-icon",children:(0,F.jsx)(S.NtI,{})}),(0,F.jsxs)("div",{className:"pu-detail-body",children:[(0,F.jsx)("div",{className:"pu-detail-label",children:"Pickup"}),(0,F.jsx)("div",{className:"pu-detail-value",title:e.pickupcustomer||e.locationname||e.pickuplocation,children:e.pickupcustomer||e.locationname||e.pickuplocation})]})]}),(e.deliverysuburb||e.deliveryaddress)&&(0,F.jsxs)("div",{className:"pu-detail",children:[(0,F.jsx)("div",{className:"pu-detail-icon",children:(0,F.jsx)(S.JFD,{})}),(0,F.jsxs)("div",{className:"pu-detail-body",children:[(0,F.jsx)("div",{className:"pu-detail-label",children:"Drop"}),(0,F.jsx)("div",{className:"pu-detail-value",title:e.deliveryaddress||e.deliverysuburb,children:e.deliverysuburb||D(e.deliveryaddress)})]})]}),e.zone_name&&(0,F.jsxs)("div",{className:"pu-detail",children:[(0,F.jsx)("div",{className:"pu-detail-icon",children:(0,F.jsx)(S.Cd7,{})}),(0,F.jsxs)("div",{className:"pu-detail-body",children:[(0,F.jsx)("div",{className:"pu-detail-label",children:"Zone"}),(0,F.jsx)("div",{className:"pu-detail-value",title:e.zone_name,children:e.zone_name})]})]}),(e.rider_id||e.userid)&&(0,F.jsxs)("div",{className:"pu-detail",children:[(0,F.jsx)("div",{className:"pu-detail-icon",children:(0,F.jsx)(S.aVM,{})}),(0,F.jsxs)("div",{className:"pu-detail-body",children:[(0,F.jsx)("div",{className:"pu-detail-label",children:"Rider ID"}),(0,F.jsxs)("div",{className:"pu-detail-value",children:["#",e.rider_id||e.userid]})]})]})]}),(null!=e.kms||null!=e.actualkms||!t&&null!=e.riderkms||null!==i)&&(0,F.jsxs)("div",{className:"pu-distance-row",children:[null!=e.kms&&""!==e.kms&&(0,F.jsxs)("div",{className:"pu-distance-chip",children:[(0,F.jsx)("span",{className:"pu-distance-icon",children:(0,F.jsx)(S.xI$,{})}),(0,F.jsx)("span",{className:"pu-distance-label",children:"Planned"}),(0,F.jsxs)("span",{className:"pu-distance-value",children:[e.kms," km"]})]}),null!=e.actualkms&&""!==e.actualkms&&(0,F.jsxs)("div",{className:"pu-distance-chip",children:[(0,F.jsx)("span",{className:"pu-distance-icon",children:(0,F.jsx)(S.xI$,{})}),(0,F.jsx)("span",{className:"pu-distance-label",children:"Actual"}),(0,F.jsxs)("span",{className:"pu-distance-value",children:[e.actualkms," km"]})]}),!t&&null!=e.riderkms&&""!==e.riderkms&&(0,F.jsxs)("div",{className:"pu-distance-chip",children:[(0,F.jsx)("span",{className:"pu-distance-icon",children:(0,F.jsx)(S.bsz,{})}),(0,F.jsx)("span",{className:"pu-distance-label",children:"Rider"}),(0,F.jsxs)("span",{className:"pu-distance-value",children:[parseFloat(e.riderkms).toFixed(2)," km"]})]}),null!==i&&(0,F.jsxs)("div",{className:"pu-distance-chip pu-est-meters",title:"Estimated distance to drop location",children:[(0,F.jsx)("span",{className:"pu-distance-icon",children:(0,F.jsx)(S.HPi,{})}),(0,F.jsx)("span",{className:"pu-distance-label",children:"Est. to Drop"}),(0,F.jsx)("span",{className:"pu-distance-value",children:Xa(i)})]})]})]})]})]})})(He)]})})]}),!a&&"analysis"===ue&&(0,F.jsxs)("div",{id:"dispatch-analysis",children:[(0,F.jsx)("div",{className:"da-picker-row",children:le.map((e=>{var s;const a=pe[e.key],t=xe===e.key,i=!1===(null===a||void 0===a||null===(s=a.data)||void 0===s?void 0:s.success),r=i?"#fee2e2":a?"".concat(e.color,"22"):"#f1f5f9",n=i?"#dc2626":a?e.color:"#64748b",l=t?"Loading\u2026":i?"! Failed":a?"\u2713 ".concat(a.fetchedAt):"Fetch",c=je===e.key;return(0,F.jsxs)("button",{type:"button",className:"da-picker ".concat(a?"has-data":""," ").concat(t?"is-loading":""," ").concat(c?"is-active":""),onClick:()=>!t&&ye(e.key),style:{borderColor:c?e.color:i?"#fecaca":a?e.border:"#e2e8f0",background:i?"#fef2f2":a?e.bg:"#ffffff",boxShadow:c?"0 0 0 2px ".concat(e.color,"33"):void 0},disabled:t,children:[(0,F.jsxs)("div",{className:"da-picker-head",children:[(0,F.jsx)("div",{className:"da-picker-badge",style:{background:"".concat(e.color,"22"),color:e.color},children:e.label[0]}),(0,F.jsxs)("div",{className:"da-picker-meta",children:[(0,F.jsx)("div",{className:"da-picker-name",children:e.label}),(0,F.jsx)("div",{className:"da-picker-range",children:e.timeRange})]}),(0,F.jsx)("span",{className:"da-picker-status",style:{background:r,color:n},children:l})]}),(0,F.jsx)("div",{className:"da-picker-sub",children:e.sub})]},e.key)}))}),((e,s,a)=>{if(!je)return(0,F.jsx)("div",{className:"da-empty",children:"Pick a batch above to view its efficiency analysis."});const t=le.find((e=>e.key===je)),r=pe[je],n=xe===je;if(n&&!r)return(0,F.jsxs)("div",{className:"da-empty",children:["Loading ",t.label," batch\u2026"]});if(!r)return null;const l=r.data||{};var c,d;if(!1===l.success)return(0,F.jsxs)("div",{className:"da-result-card da-result-card-error",style:{borderColor:"#fecaca",borderTopColor:"#ef4444"},children:[(0,F.jsxs)("div",{className:"da-result-head",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"da-result-title",children:[t.label," Batch"]}),(0,F.jsxs)("div",{className:"da-result-sub",children:[t.timeRange," \xb7 Fetched at ",r.fetchedAt]})]}),(0,F.jsx)("button",{type:"button",className:"da-result-refresh",title:"Retry",onClick:()=>ye(je),disabled:n,style:{background:"#fee2e2",color:"#dc2626"},children:(0,F.jsx)(S.joZ,{})})]}),(0,F.jsxs)("div",{className:"da-error",children:[(0,F.jsxs)("div",{className:"da-error-title",children:[(0,F.jsx)(S.ItP,{}),(0,F.jsx)("span",{children:(null===l||void 0===l||null===(c=l.error)||void 0===c?void 0:c.code)||"Request failed"})]}),(0,F.jsx)("div",{className:"da-error-msg",children:(null===l||void 0===l||null===(d=l.error)||void 0===d?void 0:d.message)||"The server returned an error."}),(null===l||void 0===l?void 0:l.request_id)&&(0,F.jsxs)("div",{className:"da-error-meta",children:["request_id: ",l.request_id]})]})]});const o=l.fleet_summary||{},u=Array.isArray(l.rider_timelines)?l.rider_timelines:[],m=Array.isArray(l.substitution_opportunities)?l.substitution_opportunities:[],p=l.top_recommendation,h=!(!p||!p.idle_rider_name&&!p.idle_rider_id),x=!!(p&&p.action&&"none"!==p.action&&h),v=l.window||{},j=(e,s)=>{const a=String(null!==e&&void 0!==e?e:"").trim();if(!a)return s||"\u2014";const t="string"===typeof s&&/^Rider\s+\d+$/i.test(s.trim()),i=Array.isArray(Ma)?Ma.find((e=>String(e.id)===a)):null;if(i&&i.riderName)return i.riderName;const r=Array.isArray(ka)?ka.find((e=>String(e.id)===a)):null;return r&&r.riderName?r.riderName:!t&&s?s:"Rider ".concat(a)},g=de(o.fleet_start),f=de(o.fleet_done),N=null!=g&&null!=f&&f>g?f-g:null,b=parseFloat(o.avg_utilisation_pct),y=Number.isFinite(b)?b:null,k=null==y?"unknown":y>=85?"good":y>=70?"ok":"low",_="good"===k?"#10b981":"ok"===k?"#f59e0b":"low"===k?"#ef4444":"#94a3b8",w=(e=>{let{assessment:s,spreadMin:a,stdev:t}=e;const i=String(s||"").toLowerCase();return/high imbalance|severe|critical/.test(i)||/imbalance|recommend/.test(i)||null!=a&&a>30||null!=t&&t>1?"warn":/balanced|excellent|good/.test(i)?"success":"info"})({assessment:null===p||void 0===p?void 0:p.fleet_balance_assessment,spreadMin:parseFloat(o.finish_time_spread_minutes),stdev:parseFloat(o.load_balance_stdev)}),M=u.map((e=>{const s=de(e.started_at),a=de(e.finished_at);let t=0,r=100;null!=g&&N&&(null!=s&&(t=Math.max(0,Math.min(100,(s-g)/N*100))),null!=a&&(r=Math.max(0,Math.min(100,(a-g)/N*100))));const n=Math.max(0,r-t),l=parseFloat(e.active_minutes),c=parseFloat(e.idle_minutes),d=(Number.isFinite(l)?l:0)+(Number.isFinite(c)?c:0),o=d>0?l/d*100:y,u=null==o?"unknown":o>=85?"good":o>=70?"ok":"low",m="good"===u?"#10b981":"ok"===u?"#f59e0b":"low"===u?"#ef4444":"#94a3b8",p=j(e.userid,e.name);return(0,i.A)((0,i.A)({},e),{},{displayName:p,_startPct:t,_endPct:r,_activePct:n,_riderUtilPct:o,_riderColor:m})}));return M.sort(((e,s)=>(de(s.finished_at)||0)-(de(e.finished_at)||0))),(0,F.jsxs)("div",{className:"da-detail",children:[(0,F.jsxs)("div",{className:"da-detail-head",style:{borderTopColor:t.color,background:t.bg},children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"da-detail-title",children:[t.label," Batch",(0,F.jsxs)("span",{className:"da-detail-sub-inline",children:[l.date?" \xb7 ".concat(l.date):"",v.from&&v.to?" \xb7 ".concat(v.from," \u2013 ").concat(v.to):""]})]}),(0,F.jsxs)("div",{className:"da-detail-sub",children:["Fetched at ",r.fetchedAt," \xb7 Input deliveries: ",null!==(e=l.input_delivery_count)&&void 0!==e?e:"\u2014"]})]}),(0,F.jsxs)("div",{className:"da-detail-actions",children:[(0,F.jsxs)("span",{className:"da-live-tag ".concat(n?"is-active":""),title:"Auto-refreshing every ".concat(Math.round(15),"s"),children:[(0,F.jsx)("span",{className:"da-live-dot"}),"Live \xb7 ",Math.round(15),"s"]}),(0,F.jsx)("button",{type:"button",className:"da-result-refresh",title:"Refresh now",onClick:()=>{he((e=>{const s=(0,i.A)({},e);return delete s[je],s})),be.mutate({batch:je,tenantId:916})},disabled:n,style:{background:"".concat(t.color,"22"),color:t.color},children:(0,F.jsx)(S.joZ,{})})]})]}),(0,F.jsx)("div",{className:"da-section",children:(0,F.jsxs)("div",{className:"da-hero-row",children:[(0,F.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:t.color},children:[(0,F.jsx)("div",{className:"da-hero-icon",style:{background:"".concat(t.color,"22"),color:t.color},children:(0,F.jsx)(S.gsJ,{})}),(0,F.jsx)("div",{className:"da-hero-value",children:ce(o.total_orders)}),(0,F.jsx)("div",{className:"da-hero-label",children:"Total Orders"}),null!=l.input_delivery_count&&l.input_delivery_count!==o.total_orders&&(0,F.jsxs)("div",{className:"da-hero-sub",children:[l.input_delivery_count," input"]})]}),(0,F.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:"#0ea5e9"},children:[(0,F.jsx)("div",{className:"da-hero-icon",style:{background:"#0ea5e922",color:"#0ea5e9"},children:(0,F.jsx)(S.aVM,{})}),(0,F.jsx)("div",{className:"da-hero-value",children:ce(o.total_riders)}),(0,F.jsx)("div",{className:"da-hero-label",children:"Active Riders"}),null!=o.orders_per_rider_avg&&(0,F.jsxs)("div",{className:"da-hero-sub",children:[o.orders_per_rider_avg," avg orders / rider"]})]}),(0,F.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:"#8b5cf6"},children:[(0,F.jsx)("div",{className:"da-hero-icon",style:{background:"#8b5cf622",color:"#8b5cf6"},children:(0,F.jsx)(S.VP9,{})}),(0,F.jsxs)("div",{className:"da-hero-value",children:[null!=o.total_duration_minutes?"".concat(o.total_duration_minutes):"\u2014",null!=o.total_duration_minutes&&(0,F.jsx)("span",{className:"da-hero-unit",children:" min"})]}),(0,F.jsx)("div",{className:"da-hero-label",children:"Fleet Window"}),o.fleet_start&&o.fleet_done&&(0,F.jsxs)("div",{className:"da-hero-sub",children:[o.fleet_start," \u2192 ",o.fleet_done]})]})]})}),(0,F.jsxs)("div",{className:"da-section",children:[(0,F.jsx)("div",{className:"da-section-label",children:"Fleet Health"}),(0,F.jsxs)("div",{className:"da-health-row",children:[(0,F.jsxs)("div",{className:"da-health-card",children:[(0,F.jsx)("div",{className:"da-ring",style:{"--ring-color":_,"--ring-pct":null!=y?Math.max(0,Math.min(100,y)):0},children:(0,F.jsxs)("span",{className:"da-ring-num",children:[null!=y?"".concat(y.toFixed(0)):"\u2014",null!=y&&(0,F.jsx)("span",{className:"da-ring-unit",children:"%"})]})}),(0,F.jsxs)("div",{className:"da-health-meta",children:[(0,F.jsx)("div",{className:"da-health-label",children:"Avg Utilisation"}),(0,F.jsx)("div",{className:"da-health-sub",style:{color:_},children:"good"===k?"Strong":"ok"===k?"Moderate":"low"===k?"Low":"\u2014"})]})]}),(0,F.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,F.jsx)("div",{className:"da-health-value",children:null!=o.load_balance_stdev?parseFloat(o.load_balance_stdev).toFixed(2):"\u2014"}),(0,F.jsx)("div",{className:"da-health-label",children:"Load Balance \u03c3"}),(0,F.jsx)("div",{className:"da-health-sub",children:null!=o.load_balance_stdev?parseFloat(o.load_balance_stdev)>1?"Uneven workload":"Workload balanced":"Stdev of orders / rider"})]}),(0,F.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,F.jsxs)("div",{className:"da-health-value",children:[null!=o.finish_time_spread_minutes?"".concat(o.finish_time_spread_minutes):"\u2014",null!=o.finish_time_spread_minutes&&(0,F.jsx)("span",{className:"da-health-unit",children:" min"})]}),(0,F.jsx)("div",{className:"da-health-label",children:"Finish Spread"}),(0,F.jsx)("div",{className:"da-health-sub",children:null!=o.finish_time_stdev_minutes?"\u03c3 ".concat(parseFloat(o.finish_time_stdev_minutes).toFixed(1)," min"):"First \u2192 last finish"})]}),(0,F.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,F.jsxs)("div",{className:"da-health-value",children:[null!=o.avg_active_minutes?"".concat(parseFloat(o.avg_active_minutes).toFixed(0)):"\u2014",null!=o.avg_active_minutes&&(0,F.jsx)("span",{className:"da-health-unit",children:" min"})]}),(0,F.jsx)("div",{className:"da-health-label",children:"Avg Active"}),(0,F.jsx)("div",{className:"da-health-sub",children:"Per rider, this batch"})]})]})]}),(0,F.jsxs)("div",{className:"da-section",children:[(0,F.jsx)("div",{className:"da-section-label",children:"Top Recommendation"}),x?(0,F.jsxs)("div",{className:"da-rec-banner is-action",children:[(0,F.jsx)("div",{className:"da-rec-banner-icon",children:(0,F.jsx)(S.DX0,{})}),(0,F.jsxs)("div",{className:"da-rec-banner-body",children:[(0,F.jsxs)("div",{className:"da-rec-head",children:[(0,F.jsx)("div",{className:"da-rec-action",children:(0,F.jsx)("span",{children:(p.action||"recommendation").replaceAll("_"," ")})}),null!=p.fleet_improvement_minutes&&(0,F.jsxs)("span",{className:"da-rec-improve",style:p.fleet_improvement_minutes>0?{background:"#dcfce7",color:"#166534"}:{background:"#f1f5f9",color:"#475569"},children:[p.fleet_improvement_minutes>0?"\u2191":"\u2022"," Fleet improves by ",p.fleet_improvement_minutes," min"]})]}),(0,F.jsxs)("div",{className:"da-rec-line",children:[(0,F.jsx)("strong",{children:j(p.idle_rider_id,p.idle_rider_name)}),p.primary_kitchen&&(0,F.jsxs)(F.Fragment,{children:[" \xb7 primary kitchen ",(0,F.jsx)("strong",{children:p.primary_kitchen})]}),p.second_kitchen&&(0,F.jsxs)(F.Fragment,{children:[" \u2192 also serve ",(0,F.jsx)("strong",{children:p.second_kitchen})," after ",p.second_kitchen_dispatch_after||"\u2014"]})]}),p.description&&(0,F.jsx)("div",{className:"da-rec-desc",children:p.description}),(null===p||void 0===p?void 0:p.fleet_balance_assessment)&&(0,F.jsx)("div",{className:"da-rec-assess",children:p.fleet_balance_assessment}),(null===(s=p.activate_when)||void 0===s||null===(a=s.rules)||void 0===a?void 0:a.length)>0&&(0,F.jsxs)("div",{className:"da-rec-rules",children:[(0,F.jsxs)("div",{className:"da-rec-rules-head",children:["Activate when (",p.activate_when.condition||"AND","):"]}),p.activate_when.rules.map(((e,s)=>(0,F.jsxs)("div",{className:"da-rec-rule",children:[(0,F.jsxs)("code",{children:[e.field," ",e.operator," ",e.value]}),e.reason&&(0,F.jsxs)("span",{className:"da-rec-rule-why",children:[" \u2014 ",e.reason]})]},s)))]})]})]}):(0,F.jsxs)("div",{className:"da-rec-banner is-".concat(w),children:[(0,F.jsx)("div",{className:"da-rec-banner-icon",children:"warn"===w?(0,F.jsx)(S.Wux,{}):"success"===w?(0,F.jsx)(S.mU9,{}):(0,F.jsx)(S.DX0,{})}),(0,F.jsxs)("div",{className:"da-rec-banner-body",children:[(0,F.jsx)("div",{className:"da-rec-action",children:(0,F.jsx)("span",{children:"warn"===w?"Fleet imbalance detected \u2014 no feasible substitution":"success"===w?"Fleet ran balanced \u2014 no reassignment needed":"No action recommended"})}),(null===p||void 0===p?void 0:p.reason)&&(0,F.jsx)("div",{className:"da-rec-desc",children:p.reason}),(null===p||void 0===p?void 0:p.fleet_balance_assessment)&&(0,F.jsx)("div",{className:"da-rec-assess",children:p.fleet_balance_assessment})]})]})]}),M.length>0&&(0,F.jsxs)("div",{className:"da-section",children:[(0,F.jsxs)("div",{className:"da-section-label",children:["Rider Timelines ",(0,F.jsxs)("span",{className:"da-section-count",children:["(",M.length,")"]}),(0,F.jsx)("span",{className:"da-section-hint",children:"Sorted by latest finish \u2014 bottleneck riders first"})]}),(0,F.jsxs)("div",{className:"da-gantt-axis",children:[(0,F.jsx)("span",{children:o.fleet_start||"\u2014"}),(0,F.jsx)("span",{className:"da-gantt-axis-mid",children:null!=o.total_duration_minutes?"".concat(o.total_duration_minutes," min batch"):"Batch window"}),(0,F.jsx)("span",{children:o.fleet_done||"\u2014"})]}),(0,F.jsx)("div",{className:"da-timeline-list",children:M.map((e=>{var s,a,t;const i="active"===String(e.status||"").toLowerCase(),r=null!==(s=e.completed_orders)&&void 0!==s?s:e.order_count,n=null!==(a=e.pending_orders)&&void 0!==a?a:0,l=null!=r&&e.order_count>0?Math.max(0,Math.min(100,r/e.order_count*100)):0,c=null!=e.idle_minutes&&e.idle_minutes>30,d=null!=e.kitchen_confidence&&e.kitchen_confidence<.7;return(0,F.jsxs)("div",{className:"da-timeline-card",children:[(0,F.jsxs)("div",{className:"da-timeline-top",children:[(0,F.jsxs)("div",{className:"da-timeline-name",children:[(0,F.jsx)(S.aVM,{style:{color:e._riderColor}}),(0,F.jsx)("span",{title:e.name&&e.name!==e.displayName?"API name: ".concat(e.name):void 0,children:e.displayName}),(0,F.jsxs)("span",{className:"da-timeline-id",children:["#",e.userid]})]}),(0,F.jsx)("span",{className:"da-pill ".concat(i?"is-active":"is-idle"),children:e.status})]}),(0,F.jsxs)("div",{className:"da-gantt-row",children:[(0,F.jsxs)("div",{className:"da-gantt-track",title:"".concat(e.started_at," \u2192 ").concat(e.finished_at),children:[(0,F.jsxs)("div",{className:"da-gantt-fill",style:{left:"".concat(e._startPct,"%"),width:"".concat(Math.max(2,e._activePct),"%"),background:e._riderColor},children:[(0,F.jsx)("span",{className:"da-gantt-fill-start",children:e.started_at}),(0,F.jsx)("span",{className:"da-gantt-fill-end",children:e.finished_at})]}),e._endPct<99&&(0,F.jsx)("div",{className:"da-gantt-idle",style:{left:"".concat(e._endPct,"%"),width:"".concat(100-e._endPct,"%")},title:"Idle ".concat(e.idle_minutes," min after finishing")})]}),(0,F.jsx)("span",{className:"da-gantt-util",style:{background:"".concat(e._riderColor,"22"),color:e._riderColor},title:"Per-rider utilisation: ".concat(null!=e._riderUtilPct?e._riderUtilPct.toFixed(0):"\u2014","%"),children:null!=e._riderUtilPct?"".concat(e._riderUtilPct.toFixed(0),"%"):"\u2014"})]}),(0,F.jsxs)("div",{className:"da-timeline-mid",children:[e.kitchen?(0,F.jsxs)("span",{className:"da-chip",title:null!=e.kitchen_confidence?"Kitchen confidence: ".concat((100*e.kitchen_confidence).toFixed(0),"%"):void 0,children:[(0,F.jsx)(S.NtI,{})," ",e.kitchen,null!=e.kitchen_confidence&&(0,F.jsx)("span",{className:"da-conf-dot ".concat(d?"is-low":"is-ok"),"aria-label":"Confidence ".concat((100*e.kitchen_confidence).toFixed(0),"%")})]}):(0,F.jsxs)("span",{className:"da-chip",style:{background:"#f8fafc",color:"#64748b",borderColor:"#e2e8f0",borderStyle:"dashed"},title:"Solver did not identify a primary kitchen for this rider",children:[(0,F.jsx)(S.NtI,{})," Unassigned"]}),(0,F.jsxs)("span",{className:"da-chip da-chip-orders",title:"Completed ".concat(r," of ").concat(e.order_count),children:[(0,F.jsx)(S.gsJ,{}),(0,F.jsxs)("span",{className:"da-orders-label",children:[r,"/",e.order_count]}),(0,F.jsx)("span",{className:"da-orders-bar",children:(0,F.jsx)("span",{className:"da-orders-bar-fill",style:{width:"".concat(l,"%")}})}),n>0&&(0,F.jsxs)("span",{className:"da-orders-pending",children:[n," pending"]})]}),null!=e.pace_orders_per_hour&&(0,F.jsxs)("span",{className:"da-chip",title:"Delivery pace this batch",children:[(0,F.jsx)(S.BJM,{})," ",parseFloat(e.pace_orders_per_hour).toFixed(1)," / hr"]}),null!=e.active_minutes&&(0,F.jsxs)("span",{className:"da-chip",title:"Time actively delivering",children:[(0,F.jsx)(S.pWE,{})," ",parseFloat(e.active_minutes).toFixed(0)," min active"]}),(0,F.jsxs)("span",{className:"da-chip",style:c?{background:"#fef3c7",color:"#92400e",borderColor:"#fde68a"}:void 0,title:"Idle time after this rider finished \u2014 fleet kept running",children:[(0,F.jsx)(S.VP9,{})," ",null!==(t=e.idle_minutes)&&void 0!==t?t:0," min idle"]}),null!=e.free_window_minutes&&(0,F.jsxs)("span",{className:"da-chip",style:e.free_window_minutes>=30?{background:"#ecfdf5",color:"#065f46",borderColor:"#a7f3d0"}:e.free_window_minutes>0?{background:"#fefce8",color:"#854d0e",borderColor:"#fde68a"}:{background:"#fef2f2",color:"#991b1b",borderColor:"#fecaca"},title:"Free window before the next batch \u2014 capacity available for a follow-up run",children:[(0,F.jsx)(S.pWE,{})," ",parseFloat(e.free_window_minutes).toFixed(0)," min free"]})]})]},e.userid)}))})]}),m.length>0&&(0,F.jsxs)("div",{className:"da-section",children:[(0,F.jsxs)("div",{className:"da-section-label",children:["Substitution Opportunities ",(0,F.jsxs)("span",{className:"da-section-count",children:["(",m.length,")"]})]}),(0,F.jsx)("div",{className:"da-sub-list",children:m.map(((e,s)=>{var a;const t=e.idle_rider||{},i=e.most_relieved_rider||{},r=null!==(a=e.fleet_improvement_minutes)&&void 0!==a?a:0;return(0,F.jsxs)("div",{className:"da-sub-card",children:[(0,F.jsxs)("div",{className:"da-sub-head",children:[(0,F.jsxs)("div",{className:"da-sub-title",children:[(0,F.jsx)("strong",{children:j(t.userid,t.name)})," ","covers ",(0,F.jsx)("strong",{children:e.target_kitchen})]}),(0,F.jsxs)("span",{className:"da-sub-improve",style:r>0?{background:"#dcfce7",color:"#166534"}:{background:"#f1f5f9",color:"#475569"},children:["Fleet ",r>0?"\u2191":"\u2022"," ",r," min"]})]}),(0,F.jsxs)("div",{className:"da-sub-meta",children:[(0,F.jsxs)("span",{className:"da-chip",children:[(0,F.jsx)(S.xI$,{})," ",e.travel_to_kitchen_km," km"]}),(0,F.jsxs)("span",{className:"da-chip",children:[(0,F.jsx)(S.pWE,{})," ",e.travel_to_kitchen_minutes," min travel"]}),(0,F.jsxs)("span",{className:"da-chip",children:[(0,F.jsx)(S.VP9,{})," arrives ",e.arrive_at_kitchen]}),(0,F.jsxs)("span",{className:"da-chip",children:[(0,F.jsx)(S.gsJ,{})," ",e.total_orders_transferred," orders"]}),(0,F.jsxs)("span",{className:"da-chip",children:[(0,F.jsx)(S.xI$,{})," +",e.extra_km_for_idle_rider," km for idle rider"]})]}),(i.name||null!=i.userid)&&(0,F.jsxs)("div",{className:"da-sub-relieved",children:[(0,F.jsx)(S.imn,{}),"Most relieved: ",(0,F.jsx)("strong",{children:j(i.userid,i.name)})," ","(",i.original_finish," \u2192 ",i.new_finish,", saves"," ",i.time_saved_minutes," min)"]}),Array.isArray(e.orders_to_transfer)&&e.orders_to_transfer.length>0&&(0,F.jsxs)("div",{className:"da-sub-transfers",children:[(0,F.jsx)("div",{className:"da-sub-transfers-head",children:"Orders transferred"}),e.orders_to_transfer.map((e=>{var s;const a=null!==(s=e.improvement_minutes)&&void 0!==s?s:0;return(0,F.jsxs)("div",{className:"da-transfer-row",children:[(0,F.jsxs)("span",{className:"da-transfer-id",children:["#",e.deliveryid]}),(0,F.jsxs)("span",{className:"da-transfer-from",children:["from ",j(e.from_rider_id||e.from_userid,e.from_rider_name)]}),(0,F.jsxs)("span",{className:"da-transfer-time",children:[e.original_delivery_time," \u2192 ",e.estimated_delivery_time]}),(0,F.jsxs)("span",{className:"da-transfer-imp",style:a>0?{background:"#dcfce7",color:"#166534"}:a<0?{background:"#fee2e2",color:"#991b1b"}:{background:"#f1f5f9",color:"#475569"},children:[a>0?"+":"",a," min"]})]},e.deliveryid)}))]})]},s)}))})]})]})})()]}),fe&&(0,F.jsx)("div",{className:"da-pos-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Last known position of ".concat(fe.name),onClick:e=>{e.target===e.currentTarget&&Ne(null)},children:(0,F.jsxs)("div",{className:"da-pos-modal-card",children:[(0,F.jsxs)("div",{className:"da-pos-modal-head",children:[(0,F.jsxs)("div",{className:"da-pos-modal-title-wrap",children:[(0,F.jsx)("div",{className:"da-pos-modal-avatar",style:{background:"".concat(fe.color||"#662582","22"),color:fe.color||"#662582"},children:(0,F.jsx)(S.aVM,{})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"da-pos-modal-title",children:fe.name}),(0,F.jsxs)("div",{className:"da-pos-modal-sub",children:["#",fe.userid,fe.kitchen&&(0,F.jsxs)(F.Fragment,{children:[" \xb7 ",fe.kitchen]}),fe.finished_at&&(0,F.jsxs)(F.Fragment,{children:[" \xb7 finished ",fe.finished_at]})]})]})]}),(0,F.jsxs)("div",{className:"da-pos-modal-actions",children:[(0,F.jsx)("span",{className:"da-pill ".concat("active"===String(fe.status||"").toLowerCase()?"is-active":"is-idle"),children:fe.status||"\u2014"}),(0,F.jsx)("button",{type:"button",className:"da-pos-modal-close","aria-label":"Close",onClick:()=>Ne(null),children:(0,F.jsx)(S.m6K,{})})]})]}),(0,F.jsx)("div",{className:"da-pos-modal-map",children:(0,F.jsxs)(d.W,{center:[fe.lat,fe.lon],zoom:13,scrollWheelZoom:!0,style:{width:"100%",height:"100%"},whenReady:e=>{const s=e.target;requestAnimationFrame((()=>s.invalidateSize())),setTimeout((()=>s.invalidateSize()),260)},children:[(0,F.jsx)(o.e,{attribution:'\xa9 OpenStreetMap',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,F.jsx)(l.p,{position:[fe.lat,fe.lon],children:(0,F.jsxs)(m.z,{children:[(0,F.jsx)("strong",{children:fe.name}),(0,F.jsx)("br",{}),fe.lat.toFixed(6),", ",fe.lon.toFixed(6)]})})]},"".concat(fe.userid,"-").concat(fe.lat,"-").concat(fe.lon))}),(0,F.jsxs)("div",{className:"da-pos-modal-foot",children:[(0,F.jsxs)("div",{className:"da-pos-modal-coord",children:[(0,F.jsx)(S.gwi,{}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:"Lat:"})," ",fe.lat.toFixed(6),(0,F.jsx)("span",{className:"da-pos-modal-sep",children:"\xb7"}),(0,F.jsx)("strong",{children:"Lon:"})," ",fe.lon.toFixed(6)]})]}),(0,F.jsx)("button",{type:"button",className:"da-pos-modal-copy",onClick:()=>{var e,s;const a="".concat(fe.lat.toFixed(6),", ").concat(fe.lon.toFixed(6));null!==(e=navigator)&&void 0!==e&&null!==(s=e.clipboard)&&void 0!==s&&s.writeText&&navigator.clipboard.writeText(a)},title:"Copy coordinates",children:"Copy"})]})]})})]})}},84702:(e,s,a)=>{a.d(s,{Cx:()=>i,IE:()=>d,Ys:()=>r,Z3:()=>l,gM:()=>c,yP:()=>n});const t={created:{label:"Created",bg:"#3b82f6",fg:"#fff"},pending:{label:"Pending",bg:"#f59e0b",fg:"#fff"},accepted:{label:"Accepted",bg:"#8b5cf6",fg:"#fff"},arrived:{label:"Arrived",bg:"#ea580c",fg:"#fff"},picked:{label:"Picked",bg:"#0ea5e9",fg:"#fff"},active:{label:"Active",bg:"#0ea5e9",fg:"#fff"},delivered:{label:"Delivered",bg:"#22c55e",fg:"#fff"},skipped:{label:"Skipped",bg:"#94a3b8",fg:"#fff"},cancelled:{label:"Cancelled",bg:"#ef4444",fg:"#fff"}},i=e=>t[String(e||"").toLowerCase()]||{label:e||"Unknown",bg:"#64748b",fg:"#fff"},r=new Set(["delivered"]),n=new Set(["cancelled","skipped"]),l=["#2563eb","#dc2626","#16a34a","#ea580c","#9333ea","#0891b2","#ca8a04","#db2777","#0f766e","#7c3aed","#65a30d","#0284c7","#b91c1c","#15803d","#a16207","#86198f"],c=e=>l[(e%l.length+l.length)%l.length],d=e=>{if(null==e)return"";const s=["th","st","nd","rd"],a=e%100;return e+(s[(a-20)%10]||s[a]||s[0])}}}]); \ No newline at end of file diff --git a/build/static/js/6666.7adf9309.chunk.js b/build/static/js/6666.7adf9309.chunk.js new file mode 100644 index 0000000..ef2e4d1 --- /dev/null +++ b/build/static/js/6666.7adf9309.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6666],{54413:(e,s,a)=>{a.r(s),a.d(s,{default:()=>me});var t=a(80045),i=a(89379),r=a(9950),n=a(98007),l=a(47113),c=a(82215),d=a(99810),o=a(49029),u=a(33516),m=a(48513),p=a(37119),h=a(2527),x=a.n(h);a(55392);x().PolylineOffset={translatePoint:(e,s,a)=>x().point(e.x+s*Math.cos(a),e.y+s*Math.sin(a)),offsetPointLine(e,s){const a=e.length;if(a<2)throw new Error("Line should be defined by at least 2 points");let t,i=e[0];const r=Math.PI/2,n=[];for(let l=1;l=0&&l<=1&&c>=0&&c<=1?x().point(e.x+c*i.x,e.y+c*i.y):null},segmentAsVector:(e,s)=>x().point(s.x-e.x,s.y-e.y),joinLineSegments(e){const s=[];let a=e[0].offset;s.push(a[0]);for(let t=1;te.latLngToLayerPoint(s)));return this.offsetPoints(t,a).map((s=>e.layerPointToLatLng(s)))}};const v=x().Polyline.prototype._projectLatlngs;x().Polyline.prototype._projectLatlngs=function(e,s,a){const t=this.options.offset;if(!t||"number"!==typeof t)return v.call(this,e,s,a);if(!(e[0]instanceof x().LatLng)){for(let t=0;tthis._map.latLngToLayerPoint(e))),r=x().PolylineOffset.offsetPoints(i,t);for(let n=0;n{const e=t,r=e.onTime+e.late,n=s.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),l=n<0,c=a.filter((e=>e.anomaly)),d=a.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length,o=a.filter((e=>w.yP.has(String(e.orderstatus||"").toLowerCase()))).length,u=null==e.kmDeltaPct?"":e.kmDeltaPct>25?"is-over":e.kmDeltaPct<-5?"is-under":"",m=a.length||1,p=e.onTime+e.late||1,h=Math.round(d/m*60+e.onTime/p*25+(m-e.anomalies)/m*15),x=h>=85?"#16a34a":h>=65?"#f59e0b":"#dc2626",v=h>=85?"Excellent":h>=65?"Acceptable":"Needs review",j=a.filter((e=>e.actualTs)),g=j.reduce(((e,s)=>!e||s.actualTs.isBefore(e)?s.actualTs:e),null),f=j.reduce(((e,s)=>!e||s.actualTs.isAfter(e)?s.actualTs:e),null),N=g&&f?Math.max(0,f.diff(g,"minute")):0,b=a.length>1?Math.round(N/(a.length-1)):0,y=N>0?(e.actualKm/(N/60)).toFixed(1):null,k=a.filter((e=>!e.isLoading&&e.coordsCount>0)),S=k.filter((e=>null!=e.timeDeltaMin&&!e.anomaly)).sort(((e,s)=>e.timeDeltaMin-s.timeDeltaMin))[0]||null,_=k.filter((e=>e.anomaly)).sort(((e,s)=>{const a=Math.abs(e.kmDeltaPct||0)+(e.timeDeltaMin>0?e.timeDeltaMin:0);return Math.abs(s.kmDeltaPct||0)+(s.timeDeltaMin>0?s.timeDeltaMin:0)-a}))[0]||null,F=i.filter(((e,s)=>{var a;const t=null===(a=e.order)||void 0===a?void 0:a.step;return null!=t&&t!==s+1})),M=[];F.forEach((e=>{var s;const a=null===(s=e.order)||void 0===s?void 0:s.step,t=i.findIndex((s=>s.sequenceStep===e.sequenceStep))+1,r=t-a,n=M[M.length-1];n&&n.delta===r&&n.lastActualPos+1===t?(n.items.push({d:e,planned:a,actualPos:t,delta:r}),n.lastActualPos=t):M.push({delta:r,items:[{d:e,planned:a,actualPos:t,delta:r}],lastActualPos:t})}));const C={};s.orders.forEach((e=>{const s=e.trip_number||1;C[s]||(C[s]=[]),C[s].push(e)}));const z=Object.entries(C).sort(((e,s)=>{let[a]=e,[t]=s;return Number(a)-Number(t)})).map((e=>{let[s,a]=e;return{tNum:s,count:a.length,plannedKm:a.reduce(((e,s)=>e+parseFloat(s.kms||0)),0),actualKm:a.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:a.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),delivered:a.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length}}));return{sum:e,totalSteps:r,totalProfit:n,isLoss:l,deviations:c,delivered:d,skipped:o,stepDeltaPct:u,score:h,scoreColor:x,scoreLabel:v,firstDelivery:g,lastDelivery:f,activeMin:N,avgPerStop:b,avgSpeed:y,bestStep:S,worstStep:_,outOfOrderSteps:F,seqRuns:M,tripList:z}}),[s,a,t,i]),v=null!=n?a.find((e=>e.sequenceStep===n)):null,j=e=>{l((s=>s===e?null:e))},g=function(e){let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{d:a,planned:t,actualPos:i,delta:r}=e;return(0,C.jsxs)("li",{className:"cdp-seq-diff".concat(n===a.sequenceStep?" is-focused":"").concat(s?"":" is-nested"),onClick:()=>j(a.sequenceStep),children:[(0,C.jsx)("span",{className:"cdp-seq-diff-num",style:{background:(0,w.gM)((t||a.sequenceStep)-1)},children:t||a.sequenceStep}),(0,C.jsxs)("div",{className:"cdp-seq-diff-body",children:[(0,C.jsx)("div",{className:"cdp-seq-diff-title",children:a.deliverycustomer||"Step ".concat(t||a.sequenceStep)}),(0,C.jsxs)("div",{className:"cdp-seq-diff-sub",children:["Visited ",(0,C.jsx)("strong",{children:(0,w.IE)(i)})," ","\xb7 planned ",(0,C.jsx)("strong",{children:(0,w.IE)(t)})]})]}),(0,C.jsx)("span",{className:"cdp-seq-diff-tag",children:r>0?"+".concat(r):"".concat(r)})]},"diff-".concat(a.sequenceStep))},{sum:f,totalSteps:N,totalProfit:b,isLoss:y,deviations:k,delivered:_,skipped:z,stepDeltaPct:A,score:P,scoreColor:E,scoreLabel:D,firstDelivery:L,lastDelivery:q,activeMin:I,avgPerStop:O,avgSpeed:R,bestStep:T,worstStep:H,outOfOrderSteps:Y,seqRuns:V,tripList:K}=x;return(0,C.jsxs)("aside",{id:"compare-data-panel",className:"compare-data-panel".concat(h?" cdp-is-mobile":""),children:[(0,C.jsxs)("div",{className:"cdp-head",children:[(0,C.jsxs)("div",{className:"cdp-head-title",children:[(0,C.jsx)("span",{className:"cdp-rider-dot",style:{background:s.color}}),(0,C.jsxs)("div",{className:"cdp-head-text",children:[(0,C.jsx)("div",{className:"cdp-rider-name",children:s.riderName}),(0,C.jsx)("div",{className:"cdp-head-badge",children:"PLANNED vs ACTUAL"})]})]}),(0,C.jsx)("button",{type:"button",className:"cdp-close",onClick:m,title:"Exit compare","aria-label":"Exit compare",children:(0,C.jsx)(S.m6K,{})})]}),(0,C.jsxs)("div",{className:"cdp-scroll",children:[(0,C.jsx)("section",{className:"cdp-section cdp-score-section",children:(0,C.jsxs)("div",{className:"cdp-score-wrap",children:[(0,C.jsx)("div",{className:"cdp-score-ring",style:{background:"conic-gradient(".concat(E," ").concat(3.6*P,"deg, rgba(15,23,42,0.08) 0deg)")},children:(0,C.jsxs)("div",{className:"cdp-score-inner",children:[(0,C.jsx)("div",{className:"cdp-score-value",style:{color:E},children:P}),(0,C.jsx)("div",{className:"cdp-score-unit",children:"/100"})]})}),(0,C.jsxs)("div",{className:"cdp-score-body",children:[(0,C.jsx)("div",{className:"cdp-score-label",style:{color:E},children:D}),(0,C.jsx)("div",{className:"cdp-score-title",children:"Compliance score"}),(0,C.jsxs)("div",{className:"cdp-score-sub",children:[_,"/",a.length," delivered",f.anomalies>0?" \xb7 ".concat(f.anomalies," deviation").concat(f.anomalies>1?"s":""):"",f.late>0?" \xb7 ".concat(f.late," late"):"",z>0?" \xb7 ".concat(z," skipped"):""]})]})]})}),(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.Zs6,{})}),(0,C.jsx)("span",{className:"cdp-section-title",children:"Day overview"})]}),(0,C.jsxs)("div",{className:"cdp-tiles",children:[(0,C.jsxs)("div",{className:"cdp-tile",children:[(0,C.jsxs)("div",{className:"cdp-tile-label",children:[(0,C.jsx)(S.xI$,{})," Distance"]}),(0,C.jsxs)("div",{className:"cdp-tile-value",children:[f.actualKm.toFixed(1),(0,C.jsx)("span",{className:"cdp-tile-unit",children:"km"})]}),(0,C.jsxs)("div",{className:"cdp-tile-sub",children:["planned ",f.plannedKm.toFixed(1)," km"]})]}),(0,C.jsxs)("div",{className:"cdp-tile".concat(f.anomalies>0?" is-warn":""),children:[(0,C.jsxs)("div",{className:"cdp-tile-label",children:[(0,C.jsx)(S.Wux,{})," Deviation"]}),(0,C.jsx)("div",{className:"cdp-tile-value ".concat(A),children:null!=f.kmDeltaPct?"".concat(f.kmDeltaPct>0?"+":"").concat(f.kmDeltaPct.toFixed(0),"%"):"\u2014"}),(0,C.jsx)("div",{className:"cdp-tile-sub",children:f.anomalies>0?"".concat(f.anomalies," flagged"):"within plan"})]}),(0,C.jsxs)("div",{className:"cdp-tile".concat(f.late>0?" is-warn":""),children:[(0,C.jsxs)("div",{className:"cdp-tile-label",children:[(0,C.jsx)(S.VP9,{})," On-time"]}),(0,C.jsxs)("div",{className:"cdp-tile-value",children:[f.onTime,N>0&&(0,C.jsxs)("span",{className:"cdp-tile-unit",children:["/",N]})]}),(0,C.jsx)("div",{className:"cdp-tile-sub",children:f.late>0?"".concat(f.late," late"):"all on schedule"})]}),(0,C.jsxs)("div",{className:"cdp-tile ".concat(y?"is-loss":"is-gain"),children:[(0,C.jsxs)("div",{className:"cdp-tile-label",children:[y?(0,C.jsx)(S.Rod,{}):(0,C.jsx)(S.imn,{})," ",y?"Loss":"Profit"]}),(0,C.jsxs)("div",{className:"cdp-tile-value",children:[y?"-":"","\u20b9",Math.abs(b).toFixed(0)]}),(0,C.jsxs)("div",{className:"cdp-tile-sub",children:[s.orders.length," ",1===s.orders.length?"order":"orders"," \xb7 ",_," delivered"]})]})]})]}),a.length>0&&(0,C.jsxs)("section",{className:"cdp-section cdp-seq-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head cdp-section-head-clickable",onClick:()=>d((e=>!e)),role:"button","aria-expanded":c,title:c?"Collapse route sequence":"Expand route sequence",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.$G1,{})}),(0,C.jsx)("span",{className:"cdp-section-title",children:"Route sequence"}),(0,C.jsx)("span",{className:"cdp-seq-status".concat(Y.length>0?" is-warn":" is-good"),children:Y.length>0?"".concat(Y.length," out of order"):"In order"}),(0,C.jsx)("span",{className:"cdp-seq-toggle".concat(c?" is-open":""),children:(0,C.jsx)(S.j1Q,{})})]}),c&&(0,C.jsx)("div",{className:"cdp-seq",children:Y.length>0?(0,C.jsx)("ul",{className:"cdp-seq-diffs",children:V.map(((e,s)=>{if(1===e.items.length)return g(e.items[0]);const a=e.items[0],t=e.items[e.items.length-1],i=o.has(s),l=e.delta>0?"+".concat(e.delta):"".concat(e.delta),c=e.items.some((e=>e.d.sequenceStep===n));return(0,C.jsxs)(r.Fragment,{children:[(0,C.jsxs)("li",{className:"cdp-seq-diff is-group".concat(i?" is-expanded":"").concat(c?" is-focused":""),onClick:()=>{return e=s,void u((s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a}));var e},"aria-expanded":i,children:[(0,C.jsxs)("span",{className:"cdp-seq-group-num",children:[(0,C.jsx)("span",{className:"cdp-seq-group-num-bg",style:{background:"linear-gradient(135deg, ".concat((0,w.gM)((a.planned||1)-1),", ").concat((0,w.gM)((t.planned||1)-1),")")}}),(0,C.jsxs)("span",{className:"cdp-seq-group-num-label",children:[e.items.length,"\xd7"]})]}),(0,C.jsxs)("div",{className:"cdp-seq-diff-body",children:[(0,C.jsxs)("div",{className:"cdp-seq-diff-title",children:[e.items.length," consecutive steps shifted"," ",(0,C.jsx)("span",{className:"cdp-seq-group-delta",children:l})]}),(0,C.jsxs)("div",{className:"cdp-seq-diff-sub",children:["Planned ",(0,w.IE)(a.planned),"\u2013",(0,w.IE)(t.planned)," ","visited"," ",(0,C.jsxs)("strong",{children:[(0,w.IE)(a.actualPos),"\u2013",(0,w.IE)(t.actualPos)]})]})]}),(0,C.jsx)("span",{className:"cdp-seq-diff-tag",children:l}),(0,C.jsx)("span",{className:"cdp-seq-group-toggle".concat(i?" is-open":""),"aria-hidden":"true",children:(0,C.jsx)(S.j1Q,{})})]}),i&&(0,C.jsx)("li",{className:"cdp-seq-group-children-wrap",children:(0,C.jsx)("ul",{className:"cdp-seq-group-children",children:e.items.map((e=>g(e,!1)))})})]},"run-".concat(s,"-").concat(a.d.sequenceStep))}))}):(0,C.jsxs)("div",{className:"cdp-seq-good",children:[(0,C.jsx)(S.mU9,{})," Rider followed the planned route in order."]})})]}),(L||q)&&(0,C.jsxs)("section",{className:"cdp-section cdp-timing-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.pWE,{})}),(0,C.jsx)("span",{className:"cdp-section-title",children:"Timing"}),I>0&&(0,C.jsxs)("span",{className:"cdp-timing-active-tag",children:[(0,C.jsx)("span",{className:"cdp-timing-active-pulse"}),"Day window"]})]}),(0,C.jsxs)("div",{className:"cdp-timing-clock",children:[(0,C.jsxs)("div",{className:"cdp-clock-card is-start",children:[(0,C.jsxs)("div",{className:"cdp-clock-label",children:[(0,C.jsx)(S.WVj,{})," First delivery"]}),(0,C.jsxs)("div",{className:"cdp-clock-face",children:[(0,C.jsx)("span",{className:"cdp-clock-time",children:L?L.format("hh:mm"):"\u2014"}),(0,C.jsx)("span",{className:"cdp-clock-period",children:L?L.format("A"):""})]}),(0,C.jsx)("div",{className:"cdp-clock-caption",children:"Started"})]}),(0,C.jsxs)("div",{className:"cdp-clock-track","aria-hidden":"true",children:[(0,C.jsx)("span",{className:"cdp-clock-track-line"}),(0,C.jsx)("span",{className:"cdp-clock-track-dot is-start"}),(0,C.jsx)("span",{className:"cdp-clock-track-dot is-end"}),(0,C.jsxs)("div",{className:"cdp-clock-duration",children:[(0,C.jsx)("span",{className:"cdp-clock-duration-icon",children:(0,C.jsx)(S.DZH,{})}),(0,C.jsx)("span",{className:"cdp-clock-duration-val",children:I>0?I>=60?"".concat(Math.floor(I/60),"h ").concat(I%60,"m"):"".concat(I,"m"):"\u2014"}),(0,C.jsx)("span",{className:"cdp-clock-duration-sub",children:"active"})]})]}),(0,C.jsxs)("div",{className:"cdp-clock-card is-end",children:[(0,C.jsxs)("div",{className:"cdp-clock-label",children:[(0,C.jsx)(S.mU9,{})," Last delivery"]}),(0,C.jsxs)("div",{className:"cdp-clock-face",children:[(0,C.jsx)("span",{className:"cdp-clock-time",children:q?q.format("hh:mm"):"\u2014"}),(0,C.jsx)("span",{className:"cdp-clock-period",children:q?q.format("A"):""})]}),(0,C.jsx)("div",{className:"cdp-clock-caption",children:"Finished"})]})]}),(0,C.jsxs)("div",{className:"cdp-timing-stats",children:[(0,C.jsxs)("div",{className:"cdp-timing-stat",children:[(0,C.jsxs)("div",{className:"cdp-timing-stat-head",children:[(0,C.jsx)("div",{className:"cdp-timing-stat-icon",children:(0,C.jsx)(S.VP9,{})}),(0,C.jsxs)("div",{className:"cdp-timing-stat-body",children:[(0,C.jsxs)("div",{className:"cdp-timing-stat-value",children:[O>0?"".concat(O):"\u2014",O>0&&(0,C.jsx)("span",{className:"cdp-timing-stat-unit",children:"min"})]}),(0,C.jsx)("div",{className:"cdp-timing-stat-label",children:"Avg / stop"})]})]}),a.length>0&&(0,C.jsxs)("div",{className:"cdp-timing-stat-viz cdp-stops-dots","aria-hidden":"true",children:[Array.from({length:Math.min(a.length,12)}).map(((e,s)=>(0,C.jsx)("span",{className:"cdp-stop-dot"},"dot-".concat(s)))),(0,C.jsxs)("span",{className:"cdp-timing-stat-viz-label",children:[a.length," stop",1===a.length?"":"s"]})]})]}),null!=R&&(0,C.jsxs)("div",{className:"cdp-timing-stat",children:[(0,C.jsxs)("div",{className:"cdp-timing-stat-head",children:[(0,C.jsx)("div",{className:"cdp-timing-stat-icon",children:(0,C.jsx)(S.BJM,{})}),(0,C.jsxs)("div",{className:"cdp-timing-stat-body",children:[(0,C.jsxs)("div",{className:"cdp-timing-stat-value",children:[R,(0,C.jsx)("span",{className:"cdp-timing-stat-unit",children:"km/h"})]}),(0,C.jsx)("div",{className:"cdp-timing-stat-label",children:"Avg speed"})]})]}),(0,C.jsxs)("div",{className:"cdp-timing-stat-viz cdp-speed-gauge","aria-hidden":"true",children:[(0,C.jsx)("div",{className:"cdp-speed-gauge-track",children:(0,C.jsx)("div",{className:"cdp-speed-gauge-fill",style:{width:"".concat(Math.min(100,parseFloat(R)/60*100),"%")}})}),(0,C.jsxs)("div",{className:"cdp-speed-gauge-scale",children:[(0,C.jsx)("span",{children:"0"}),(0,C.jsx)("span",{children:"30"}),(0,C.jsx)("span",{children:"60 km/h"})]})]})]})]})]}),(T||H)&&(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.SeC,{})}),(0,C.jsx)("span",{className:"cdp-section-title",children:"Highlights"})]}),(0,C.jsxs)("div",{className:"cdp-highlights",children:[T&&(0,C.jsxs)("div",{className:"cdp-highlight is-best",onClick:()=>j(T.sequenceStep),role:"button",title:"Focus this step",children:[(0,C.jsx)("span",{className:"cdp-highlight-rail","aria-hidden":"true"}),(0,C.jsxs)("div",{className:"cdp-highlight-content",children:[(0,C.jsxs)("div",{className:"cdp-highlight-top",children:[(0,C.jsxs)("span",{className:"cdp-highlight-label",children:[(0,C.jsx)("span",{className:"cdp-highlight-chip",children:(0,C.jsx)(S.mU9,{})}),"Fastest stop"]}),(0,C.jsxs)("span",{className:"cdp-highlight-step-chip",style:{background:(0,w.gM)(T.sequenceStep-1)},children:["Step ",T.sequenceStep]})]}),(0,C.jsx)("div",{className:"cdp-highlight-title",children:T.deliverycustomer||"Step ".concat(T.sequenceStep)}),(0,C.jsx)("div",{className:"cdp-highlight-meta",children:(0,C.jsx)("span",{className:"cdp-highlight-pill is-good",children:null!=T.timeDeltaMin?0===T.timeDeltaMin?"On schedule":"".concat(T.timeDeltaMin>0?"+":"").concat(T.timeDeltaMin," min vs plan"):"On schedule"})})]})]}),H&&(0,C.jsxs)("div",{className:"cdp-highlight is-worst",onClick:()=>j(H.sequenceStep),role:"button",title:"Focus this step",children:[(0,C.jsx)("span",{className:"cdp-highlight-rail","aria-hidden":"true"}),(0,C.jsxs)("div",{className:"cdp-highlight-content",children:[(0,C.jsxs)("div",{className:"cdp-highlight-top",children:[(0,C.jsxs)("span",{className:"cdp-highlight-label",children:[(0,C.jsx)("span",{className:"cdp-highlight-chip",children:(0,C.jsx)(S.Wux,{})}),"Biggest deviation"]}),(0,C.jsxs)("span",{className:"cdp-highlight-step-chip",style:{background:(0,w.gM)(H.sequenceStep-1)},children:["Step ",H.sequenceStep]})]}),(0,C.jsx)("div",{className:"cdp-highlight-title",children:H.deliverycustomer||"Step ".concat(H.sequenceStep)}),(0,C.jsxs)("div",{className:"cdp-highlight-meta",children:[null!=H.kmDeltaPct&&(0,C.jsxs)("span",{className:"cdp-highlight-pill is-bad",children:[H.kmDeltaPct>0?"+":"",H.kmDeltaPct.toFixed(0),"% route"]}),null!=H.timeDeltaMin&&H.timeDeltaMin>0&&(0,C.jsxs)("span",{className:"cdp-highlight-pill is-bad",children:["+",H.timeDeltaMin,"m late"]})]})]})]})]})]}),K.length>1&&(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.$G1,{})}),(0,C.jsxs)("span",{className:"cdp-section-title",children:["Trips (",K.length,")"]})]}),(0,C.jsx)("div",{className:"cdp-trips",children:K.map((e=>{const s=e.profit<0;return(0,C.jsxs)("div",{className:"cdp-trip",children:[(0,C.jsxs)("div",{className:"cdp-trip-head",children:[(0,C.jsxs)("span",{className:"cdp-trip-badge",children:["Trip ",e.tNum]}),(0,C.jsxs)("span",{className:"cdp-trip-meta",children:[e.delivered,"/",e.count," delivered"]})]}),(0,C.jsxs)("div",{className:"cdp-trip-stats",children:[(0,C.jsxs)("span",{title:"Distance",children:[(0,C.jsx)(S.xI$,{}),e.actualKm.toFixed(1),"km",(0,C.jsxs)("small",{children:[" / ",e.plannedKm.toFixed(1)]})]}),(0,C.jsxs)("span",{className:s?"is-over":"",title:s?"Loss":"Profit",children:[(0,C.jsx)(S.ohY,{}),s?"-":"","\u20b9",Math.abs(e.profit).toFixed(0)]})]})]},"trip-".concat(e.tNum))}))})]}),v&&(e=>{const s=(0,w.gM)(v.sequenceStep-1),a=v.kmDelta>=0?"+":"",t=v.anomaly?"is-over":v.kmDelta<-.1?"is-under":"",i=null!=v.timeDeltaMin?v.timeDeltaMin>10?"is-over":v.timeDeltaMin<-2?"is-under":"":"",r=(0,w.Cx)(v.orderstatus),n=parseFloat((null===(e=v.order)||void 0===e?void 0:e.profit)||0);return(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.$G1,{})}),(0,C.jsxs)("span",{className:"cdp-section-title",children:["Step ",v.sequenceStep," details"]}),(0,C.jsx)("button",{type:"button",className:"cdp-section-clear",onClick:()=>l(null),title:"Clear step focus",children:"Show all"})]}),(0,C.jsxs)("div",{className:"compare-delta".concat(v.anomaly?" is-anomaly":""),children:[(0,C.jsxs)("div",{className:"compare-delta-title",children:[(0,C.jsx)("span",{className:"compare-delta-step-badge",style:{background:s},children:v.sequenceStep}),(0,C.jsxs)("div",{className:"compare-delta-title-text",children:[(0,C.jsx)("div",{className:"compare-delta-title-main",children:v.deliverycustomer||"Step ".concat(v.sequenceStep)}),(0,C.jsxs)("div",{className:"compare-delta-title-sub",children:[v.pickupcustomer?"from ".concat(v.pickupcustomer," \xb7 "):"","Order #",v.orderid]})]}),v.orderstatus&&(0,C.jsx)("span",{className:"compare-delta-status",style:{background:r.bg,color:r.fg},children:r.label})]}),(0,C.jsxs)("div",{className:"compare-delta-grid",children:[(0,C.jsxs)("div",{className:"compare-delta-cell".concat(v.anomaly?" is-anomaly":""),children:[(0,C.jsx)("span",{className:"compare-delta-cell-label",children:"Distance"}),(0,C.jsxs)("span",{className:"compare-delta-cell-val",children:[v.actualKm.toFixed(2)," ",(0,C.jsx)("span",{className:"compare-delta-cell-unit",children:"km"})]}),(0,C.jsxs)("span",{className:"compare-delta-cell-sub",children:["planned ",v.plannedKm.toFixed(2)," km"]})]}),(0,C.jsxs)("div",{className:"compare-delta-cell",children:[(0,C.jsx)("span",{className:"compare-delta-cell-label",children:"\u0394 Route"}),(0,C.jsxs)("span",{className:"compare-delta-cell-val ".concat(t),children:[a,v.kmDelta.toFixed(2)," km"]}),(0,C.jsx)("span",{className:"compare-delta-cell-sub",children:null!=v.kmDeltaPct?"".concat(a).concat(v.kmDeltaPct.toFixed(0),"% vs plan"):"no planned km"})]}),(0,C.jsxs)("div",{className:"compare-delta-cell",children:[(0,C.jsx)("span",{className:"compare-delta-cell-label",children:"Time"}),(0,C.jsx)("span",{className:"compare-delta-cell-val ".concat(i),children:null!=v.timeDeltaMin?"".concat(v.timeDeltaMin>0?"+":"").concat(v.timeDeltaMin," min"):"\u2014"}),(0,C.jsx)("span",{className:"compare-delta-cell-sub",children:v.actualTs&&v.expectedTs?"".concat(v.actualTs.format("HH:mm")," vs ").concat(v.expectedTs.format("HH:mm")):v.actualTs?"delivered ".concat(v.actualTs.format("HH:mm")):"in flight"})]}),!Number.isNaN(n)&&0!==n&&(0,C.jsxs)("div",{className:"compare-delta-cell".concat(n<0?" is-anomaly":""),children:[(0,C.jsx)("span",{className:"compare-delta-cell-label",children:n<0?"Loss":"Profit"}),(0,C.jsxs)("span",{className:"compare-delta-cell-val ".concat(n<0?"is-over":"is-under"),children:[n<0?"-":"","\u20b9",Math.abs(n).toFixed(0)]}),(0,C.jsx)("span",{className:"compare-delta-cell-sub",children:"order revenue"})]})]})]})]})})(),k.length>0&&(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon cdp-icon-warn",children:(0,C.jsx)(S.ItP,{})}),(0,C.jsxs)("span",{className:"cdp-section-title",children:["Deviations (",k.length,")"]})]}),(0,C.jsx)("ul",{className:"cdp-dev-list",children:k.map((e=>{const s=(0,w.gM)(e.sequenceStep-1),a=e.kmDelta>=0?"+":"";return(0,C.jsxs)("li",{className:"cdp-dev-item".concat(n===e.sequenceStep?" is-focused":""),onClick:()=>j(e.sequenceStep),children:[(0,C.jsx)("span",{className:"cdp-dev-num",style:{background:s},children:e.sequenceStep}),(0,C.jsxs)("div",{className:"cdp-dev-body",children:[(0,C.jsx)("div",{className:"cdp-dev-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),(0,C.jsxs)("div",{className:"cdp-dev-meta",children:[null!=e.kmDeltaPct&&(0,C.jsxs)("span",{className:"cdp-dev-chip is-over",children:[a,e.kmDeltaPct.toFixed(0),"% route"]}),null!=e.timeDeltaMin&&e.timeDeltaMin>10&&(0,C.jsxs)("span",{className:"cdp-dev-chip is-over",children:["+",e.timeDeltaMin,"m late"]})]})]})]},"dev-".concat(e.sequenceStep))}))})]}),(0,C.jsxs)("section",{className:"cdp-section",children:[(0,C.jsxs)("div",{className:"cdp-section-head",children:[(0,C.jsx)("span",{className:"cdp-section-icon",children:(0,C.jsx)(S.EgJ,{})}),(0,C.jsxs)("span",{className:"cdp-section-title",children:["Steps (",a.length,")"]}),(0,C.jsxs)("span",{className:"cdp-section-sub",children:[_,"/",a.length," delivered"]})]}),(0,C.jsx)("ul",{className:"cdp-step-list",children:a.map((e=>{var s;const a=(0,w.gM)(e.sequenceStep-1),t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),r=w.yP.has(t),l=i&&!e.anomaly,c=n===e.sequenceStep,d=(0,w.Cx)(e.orderstatus),o=parseFloat((null===(s=e.order)||void 0===s?void 0:s.profit)||0),u=e.kmDelta>=0?"+":"",m=null!=e.timeDeltaMin?e.timeDeltaMin>10?"is-over":e.timeDeltaMin<-2?"is-under":"":"",p=["cdp-step",c?"is-focused":"",e.anomaly?"is-anomaly":"",l?"is-correct":"",r?"is-skipped":"",e.isLoading?"is-loading":""].filter(Boolean).join(" ");return(0,C.jsxs)("li",{className:p,onClick:()=>j(e.sequenceStep),children:[(0,C.jsxs)("span",{className:"cdp-step-num",style:{background:a},children:[e.sequenceStep,l&&(0,C.jsx)("span",{className:"cdp-step-check",children:(0,C.jsx)(S.mU9,{})}),e.anomaly&&(0,C.jsx)("span",{className:"cdp-step-flag",children:(0,C.jsx)(S.ItP,{})})]}),(0,C.jsxs)("div",{className:"cdp-step-body",children:[(0,C.jsxs)("div",{className:"cdp-step-title-row",children:[(0,C.jsx)("span",{className:"cdp-step-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),e.orderstatus&&(0,C.jsx)("span",{className:"cdp-step-status",style:{background:d.bg,color:d.fg},children:d.label})]}),(0,C.jsxs)("div",{className:"cdp-step-sub",children:[e.pickupcustomer?"from ".concat(e.pickupcustomer," \xb7 "):"","Order #",e.orderid]}),(0,C.jsxs)("div",{className:"cdp-step-deltas",children:[(0,C.jsxs)("span",{className:"cdp-step-delta",title:"Distance",children:[(0,C.jsx)(S.xI$,{}),e.actualKm.toFixed(1),"km",e.plannedKm>0&&(0,C.jsxs)("small",{className:e.anomaly?"is-over":"",children:[" ",u,e.kmDelta.toFixed(1)]})]}),(0,C.jsxs)("span",{className:"cdp-step-delta ".concat(m),title:"Delivery time",children:[(0,C.jsx)(S.VP9,{}),e.actualTs?e.actualTs.format("HH:mm"):"\u2014",null!=e.timeDeltaMin&&(0,C.jsxs)("small",{children:[" ",e.timeDeltaMin>0?"+":"",e.timeDeltaMin,"m"]})]}),!Number.isNaN(o)&&0!==o&&(0,C.jsxs)("span",{className:"cdp-step-delta".concat(o<0?" is-over":""),title:o<0?"Loss":"Profit",children:[(0,C.jsx)(S.ohY,{}),o<0?"-":"","\u20b9",Math.abs(o).toFixed(0)]})]})]})]},"step-".concat(e.sequenceStep))}))})]})]})]})};var A=a(85571);const P=["_ts"],E="#6366f1",D="#10b981",L=e=>{const s=parseFloat(e);return Number.isFinite(s)?s:NaN},q=e=>{if(!e)return"";const s=String(e).trim();if(!s)return"";if(s.includes(",")){const e=s.split(",").map((e=>e.trim())).filter(Boolean);return 0===e.length?s:e.length<=2?e.join(", "):e.slice(-2).join(", ")}const a=s.split(/\s+/).filter(Boolean),t=a.length>6?a.slice(-6).join(" "):s;return t.length>40?"".concat(t.slice(0,40).trim(),"\u2026"):t},I=e=>Number.isFinite(L(e.droplat||e.deliverylat))&&Number.isFinite(L(e.droplon||e.deliverylong)),O=e=>e.pickuplat||e.pickuplatitude||e.pickup_lat,R=e=>e.pickuplong||e.pickuplongitude||e.picklongitude||e.pickup_lon,T=e=>Number.isFinite(L(O(e)))&&Number.isFinite(L(R(e))),H=[{id:"morning",name:"Morning Batch",startHour:0,endHour:8},{id:"afternoon",name:"Afternoon Batch",startHour:9,endHour:12.5},{id:"evening",name:"Evening Batch",startHour:16,endHour:19}],Y="dispatch.slots.v9",V=["dispatch.slots.v1","dispatch.slots.v2","dispatch.slots.v3","dispatch.slots.v4","dispatch.slots.v5","dispatch.slots.v6","dispatch.slots.v7","dispatch.slots.v8"],K=(e,s)=>"Slot ".concat(e+1," \xb7 ").concat(B(s)),B=e=>{const s=Math.floor(e),a=Math.round(60*(e-s)),t=(s+11)%12+1,i=s>=12&&s<24?"PM":"AM";if(0===a)return"".concat(t," ").concat(i);const r=String(a).padStart(2,"0");return"".concat(t,":").concat(r," ").concat(i)},U=(e,s)=>s>=24?"After ".concat(B(e)):"".concat(B(e),"\u2013").concat(B(s)),G=H.map(((e,s)=>(0,i.A)((0,i.A)({},e),{},{label:e.name||K(s,e.startHour),range:U(e.startHour,e.endHour)}))),J=(e,s)=>{for(const a of s)if(e>=a.startHour&&e2&&void 0!==arguments[2]?arguments[2]:G;const a=((e,s)=>{const a=W.find((e=>e.id===s))||W[0];for(const t of a.keys)if(null!==e&&void 0!==e&&e[t])return e[t];return null})(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all");if(!a)return null;const t=String(a).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(t))return null;const i=g()(a);return i.isValid()?J(i.hour()+i.minute()/60,s):null};function Z(e){let{targetRef:s}=e;const a=(0,n.ko)();return(0,r.useEffect)((()=>(s.current=a,()=>{s.current=null})),[a]),null}function X(e,s){const a=e=>e*Math.PI/180,t=a(e[0]),i=a(s[0]),r=a(s[0]-e[0]),n=a(s[1]-e[1]),l=Math.sin(r/2)**2+Math.cos(t)*Math.cos(i)*Math.sin(n/2)**2;return 12742*Math.asin(Math.min(1,Math.sqrt(l)))}function Q(e){if(!Array.isArray(e)||e.length<2)return 0;let s=0;for(let a=1;a{let a=0,t=1/0;for(let i=0;i{const a=Math.max(s,i);t.push(e.slice(i,a+1)),i=a})),t}const se=e=>{if(!e)return null;const s=g()(e);return s.isValid()?s.format("HH:mm:ss"):String(e)},ae=[{key:"assigntime",label:"Assigned"},{key:"acceptedtime",label:"Accepted"},{key:"arrivaltime",label:"Arrived"},{key:"pickuptime",label:"Pickup"},{key:"starttime",label:"Started"},{key:"deliverytime",label:"Delivered",final:!0}],te=e=>{const s=e.filter(I);if(!s.length)return[];const a=e.find(T),t=[];return a&&t.push([L(O(a)),L(R(a))]),s.forEach((e=>t.push([L(e.droplat||e.deliverylat),L(e.droplon||e.deliverylong)]))),t},ie=(e,s,a)=>{if(!a||0===a.length)return"".concat(e,"-").concat(s);const t=a.map((e=>"".concat(e[0].toFixed(5),",").concat(e[1].toFixed(5)))).join("|");return"".concat(e,"-").concat(s,"-").concat(t)};delete x().Icon.Default.prototype._getIconUrl,x().Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const re=["#0055FF","#00D82C","#FF6B00","#9D00FF","#FF00A8","#00C2B2","#FF9900","#FF0000"],ne=e=>{const s=String(null!==e&&void 0!==e?e:"");if(!s)return re[0];let a=0;for(let t=0;t>>0;return re[a%re.length]},le=e=>{let{focusedItem:s,viewMode:a,orders:t,kitchens:i,locationKey:l}=e;const c=(0,n.ko)(),d=(0,r.useRef)(""),o=(0,r.useMemo)((()=>{const e=null!=l?"loc:".concat(l,"|"):"",r=e=>{let s=0,a=0,t=0;for(const i of e)Number.isFinite(i[0])&&Number.isFinite(i[1])&&(s+=i[0],a+=i[1],t+=1);return 0===t?"0":"".concat((s/t).toFixed(1),",").concat((a/t).toFixed(1))};if(s){var n,c,d;const a=null!==(n=null!==(c=null!==(d=s.id)&&void 0!==d?d:s.kitchenName)&&void 0!==c?c:s.name)&&void 0!==n?n:null!=s.lat?"".concat(s.lat,",").concat(s.lon):"item",t=s.orders?s.orders.length:0;return"".concat(e,"f|").concat(a,"|").concat(t)}const o=(i||[]).map((e=>[e.lat,e.lon])),u=r(o);if("kitchens"===a){const s=o.filter((e=>Number.isFinite(e[0])&&Number.isFinite(e[1]))).length;return"".concat(e,"k|").concat(s,"|").concat(u)}if("all"===a){const s=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]));return"".concat(e,"a|").concat(s.length,"|").concat(r(s))}return"".concat(e,"m|").concat(a||"","|").concat(o.length,"|").concat(u)}),[s,a,t,i,l]);return(0,r.useEffect)((()=>{if(d.current===o)return;let e=[];s?s.orders?(e=s.orders.map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])),s.orders.forEach((s=>e.push([L(O(s)),L(R(s))])))):e=[[s.lat,s.lon]]:"kitchens"===a?(e=(i||[]).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).map((e=>[e.lat,e.lon])),0===e.length&&(e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])))):"all"===a?e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])):(e=(i||[]).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).map((e=>[e.lat,e.lon])),0===e.length&&(e=(t||[]).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]))));const r=e.filter((e=>Number.isFinite(e[0])&&Number.isFinite(e[1])));if(r.length>0){const e=x().latLngBounds(r);if(e.isValid()){1===r.length||e.getNorthEast().equals(e.getSouthWest())?c.setView(r[0],15,{animate:!0,duration:.6}):c.flyToBounds(e,{padding:[60,60],duration:.6,maxZoom:16}),d.current=o}}else;}),[o,s,a,t,i,c]),null},ce=e=>{let{children:s}=e;return(0,C.jsx)("span",{className:"ico-inline",style:{display:"inline-flex",alignItems:"center",verticalAlign:"-2px",marginRight:4},children:s})},de=[{key:"morning",label:"Morning",timeRange:"12:00 AM \u2013 8:00 AM",sub:"Early shift orders",color:"#f59e0b",bg:"#fffbeb",border:"#fde68a"},{key:"afternoon",label:"Noon",timeRange:"9:00 AM \u2013 12:30 PM",sub:"Lunch rush window",color:"#10b981",bg:"#ecfdf5",border:"#a7f3d0"},{key:"evening",label:"Evening",timeRange:"4:00 PM \u2013 7:00 PM",sub:"Dinner & end-of-day",color:"#6366f1",bg:"#eef2ff",border:"#c7d2fe"}],oe=e=>{if(null==e)return"\u2014";if("number"===typeof e)return e.toLocaleString("en-IN");const s=parseFloat(e);return Number.isFinite(s)?s.toLocaleString("en-IN"):String(e)},ue=e=>{if(!e||"string"!==typeof e)return null;const s=e.split(":").map(Number);if(s.length<2||s.some((e=>!Number.isFinite(e))))return null;const[a,t,i=0]=s;return 3600*a+60*t+i},me=e=>{let{data:s,embedded:a=!1,selectedRiderId:n,onRiderSelect:h,pulseOrderId:v,onChangeRider:j}=e;const F=null!==s&&void 0!==s&&s.zones&&s.zones.length>0?"zones":"riders",[M,B]=(0,r.useState)(F),[W,me]=(0,r.useState)("live"),[pe,he]=(0,r.useState)({}),[xe,ve]=(0,r.useState)(null),[je,ge]=(0,r.useState)(null),[fe,Ne]=(0,r.useState)(null);(0,r.useEffect)((()=>{if(!fe)return;const e=e=>{"Escape"===e.key&&Ne(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[fe]);const be=(0,f.n)({mutationFn:_.W0,onMutate:e=>ve(e.batch),onSuccess:(e,s)=>{he((a=>(0,i.A)((0,i.A)({},a),{},{[s.batch]:{data:e,fetchedAt:g()().format("HH:mm:ss")}})))},onSettled:()=>ve(null)}),ye=e=>{ge(e);const s=pe[e];s&&s.data&&!1!==s.data.success||be.mutate({batch:e,tenantId:916})},ke=15e3,Se=(0,r.useRef)(null);(0,r.useEffect)((()=>{Se.current=xe}),[xe]),(0,r.useEffect)((()=>{if("analysis"!==W)return;if(!je)return;const e=setInterval((()=>{Se.current||"undefined"!==typeof document&&document.hidden||be.mutate({batch:je,tenantId:916})}),ke);return()=>clearInterval(e)}),[W,je]);const[_e,we]=(0,r.useState)(new Set),[Fe,Me]=(0,r.useState)(null),[Ce,ze]=(0,r.useState)(null),[Ae,Pe]=(0,r.useState)(null),[Ee,De]=(0,r.useState)(null),[Le,qe]=(0,r.useState)("planned"),Ie=(0,r.useRef)({}),Oe=(0,r.useRef)(new Set),Re=(0,r.useRef)(new Set),Te=((0,r.useRef)(null),(0,r.useRef)(null)),[He,Ye]=(0,r.useState)(null),Ve=void 0!==n,[Ke,Be]=(0,r.useState)(""),{data:Ue}=(0,N.I)({queryKey:["appLocations"],queryFn:_.aL,staleTime:3e5}),Ge="undefined"!==typeof window?localStorage.getItem("applocationid"):null,[Je,We]=(0,r.useState)(null!=Ge?Number(Ge):0),[$e,Ze]=(0,r.useState)(!1),Xe=(0,r.useRef)(null),[Qe,es]=(0,r.useState)("assigned"),[ss,as]=(0,r.useState)(!1),ts=(0,r.useRef)(null),[is,rs]=(0,r.useState)((()=>{if("undefined"===typeof window)return G;try{const e=window.localStorage.getItem(Y);if(!e)return G;const s=JSON.parse(e);return Array.isArray(s)&&s.length===H.length?s.map(((e,s)=>{const a=e.id||"slot-".concat(s+1),t=Number(e.startHour)||0,i=Number(e.endHour)||24,r=G.find((e=>e.id===a));return{id:a,startHour:t,endHour:i,label:(null===r||void 0===r?void 0:r.name)||K(s,t),range:U(t,i)}})):G}catch(e){return G}})),ns=is,[ls,cs]=(0,r.useState)(!1),ds=(0,r.useRef)(null);(0,r.useEffect)((()=>{if("undefined"!==typeof window)try{V.forEach((e=>window.localStorage.removeItem(e)))}catch(e){}}),[]);const os=(0,r.useRef)(!1);(0,r.useEffect)((()=>{if(os.current){if("undefined"!==typeof window)try{window.localStorage.setItem(Y,JSON.stringify(is.map((e=>{let{id:s,startHour:a,endHour:t}=e;return{id:s,startHour:a,endHour:t}}))))}catch(e){}}else os.current=!0}),[is]),(0,r.useEffect)((()=>{if(!$e)return;const e=e=>{Xe.current&&!Xe.current.contains(e.target)&&Ze(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[$e]),(0,r.useEffect)((()=>{if(!ss)return;const e=e=>{ts.current&&!ts.current.contains(e.target)&&as(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[ss]),(0,r.useEffect)((()=>{if(!ls)return;const e=e=>{ds.current&&!ds.current.contains(e.target)&&cs(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[ls]);const[us,ms]=(0,r.useState)(null),[ps,hs]=(0,r.useState)(""),{data:xs,isFetching:vs,isError:js,error:gs}=(0,N.I)({queryKey:["riderPeriodicLog",us],queryFn:()=>(0,_.ne)(us),enabled:"rider-info"===M&&null!=us,refetchInterval:"rider-info"===M&&null!=us&&15e3,refetchIntervalInBackground:!1,staleTime:5e3,refetchOnWindowFocus:!1}),fs=(0,r.useMemo)((()=>{const e=parseFloat(null===xs||void 0===xs?void 0:xs.latitude),s=parseFloat(null===xs||void 0===xs?void 0:xs.longitude);return Number.isFinite(e)&&Number.isFinite(s)?{lat:e.toFixed(4),lon:s.toFixed(4)}:null}),[null===xs||void 0===xs?void 0:xs.latitude,null===xs||void 0===xs?void 0:xs.longitude]),{data:Ns}=(0,N.I)({queryKey:["reverseGeocode",null===fs||void 0===fs?void 0:fs.lat,null===fs||void 0===fs?void 0:fs.lon],queryFn:async()=>{const e=await fetch("https://nominatim.openstreetmap.org/reverse?lat=".concat(fs.lat,"&lon=").concat(fs.lon,"&format=json&zoom=16&addressdetails=1"),{headers:{Accept:"application/json"}});if(!e.ok)return null;const s=await e.json(),a=(null===s||void 0===s?void 0:s.address)||{};return{area:a.suburb||a.neighbourhood||a.village||a.hamlet||a.city_district||a.town||a.city||a.county||a.state||"",display:(null===s||void 0===s?void 0:s.display_name)||""}},enabled:"rider-info"===M&&!!fs,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}),bs=(0,r.useMemo)((()=>{if(!Ue)return null;const e=Ue.find((e=>String(e.applocationid)===String(Je)));return(null===e||void 0===e?void 0:e.locationname)||null}),[Ue,Je]),[ys,ks]=(0,r.useState)({}),Ss=(0,r.useRef)({}),[_s,ws]=(0,r.useState)({}),Fs=(0,r.useRef)({}),[Ms,Cs]=(0,r.useState)(!1),[zs,As]=(0,r.useState)([]),[Ps,Es]=(0,r.useState)({}),Ds=(0,r.useRef)(!1),[Ls,qs]=(0,r.useState)(g()().format("YYYY-MM-DD")),[Is,Os]=(0,r.useState)(!1),[Rs,Ts]=(0,r.useState)((()=>g()(Ls).isValid()?g()(Ls).startOf("month"):g()().startOf("month"))),Hs=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(!Is)return;const e=e=>{Hs.current&&(Hs.current.contains(e.target)||Os(!1))},s=e=>{"Escape"===e.key&&Os(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",s),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",s)}}),[Is]),(0,r.useEffect)((()=>{if(Is){const e=g()(Ls);e.isValid()&&Ts(e.startOf("month"))}}),[Is,Ls]);const[Ys,Vs]=(0,r.useState)(!1),[Ks,Bs]=(0,r.useState)("combined"),[Us,Gs]=(0,r.useState)(!0),[Js,Ws]=(0,r.useState)(!0),[$s,Zs]=(0,r.useState)((()=>new Set)),Xs=(0,r.useRef)(!1),[Qs,ea]=(0,r.useState)(!1),sa=(0,r.useRef)(!1),aa=(0,r.useRef)(!1),[ta,ia]=(0,r.useState)(!1),[ra,na]=(0,r.useState)(null),la=(0,r.useRef)(null),ca=(0,r.useRef)(null);ca.current||(ca.current=x().canvas({padding:1.5,tolerance:5}));const{data:da}=(0,N.I)({queryKey:[Je,Ls,""],queryFn:_.zb,refetchInterval:15e3,refetchIntervalInBackground:!1,staleTime:5e3,refetchOnWindowFocus:!1}),oa=(0,r.useMemo)((()=>(da||[]).map((e=>{var s;const a=parseFloat(null===e||void 0===e?void 0:e.latitude),t=parseFloat(null===e||void 0===e?void 0:e.longitude);return Number.isFinite(a)&&Number.isFinite(t)?{id:String(null!==(s=e.userid)&&void 0!==s?s:""),userid:e.userid,username:e.username||"Rider #".concat(e.userid),status:String(e.status||"").toLowerCase(),contactno:e.contactno,orderid:e.orderid,logdate:e.logdate,lat:a,lon:t}:null})).filter(Boolean)),[da]),[ua,ma]=(0,r.useState)((()=>{const e=g()();return J(e.hour()+e.minute()/60,G)||G[0].id}));(0,r.useEffect)((()=>{var e;"all"!==ua&&(ns.some((e=>e.id===ua))||ma((null===(e=ns[0])||void 0===e?void 0:e.id)||"all"))}),[ns,ua]);const pa=(0,r.useRef)(null),ha=!s,xa="undefined"!==typeof window&&localStorage.getItem("userid")||0,{data:va,isFetching:ja,isError:ga,fetchNextPage:fa,hasNextPage:Na,isFetchingNextPage:ba}=(0,b.q)({queryKey:["dispatchDeliveries",Je,xa,"all",Ls,Ls,50,"",0,0,0],queryFn:_.tL,getNextPageParam:e=>{var s;return null!==(s=e.nextPage)&&void 0!==s?s:void 0},enabled:ha});(0,r.useEffect)((()=>{ha&&Na&&!ba&&fa()}),[ha,Na,ba,fa]);const ya=(0,r.useMemo)((()=>{const e=((null===va||void 0===va?void 0:va.pages)||[]).flatMap((e=>e.rows||[])),s=new Set,a=[];for(const t of e){const e=null!=t.orderid?String(t.orderid):null;e&&s.has(e)||(e&&s.add(e),a.push(t))}return a}),[va]),ka=(0,r.useMemo)((()=>{const e=new Map;return ya.forEach((s=>{const a=String(s.userid||s.rider_id||"");a&&"unassigned"!==a&&"0"!==a&&(e.has(a)||e.set(a,{id:a,riderName:s.ridername||s.rider_name||s.username||"Rider ".concat(a)}))})),Array.from(e.values()).sort(((e,s)=>String(e.riderName).localeCompare(String(s.riderName))))}),[ya]),Sa=(0,r.useMemo)((()=>{const e={all:ya.length};return ns.forEach((s=>{e[s.id]=0})),ya.forEach((s=>{const a=$(s,Qe,ns);a&&(e[a]=(e[a]||0)+1)})),e}),[ya,Qe,ns]),_a=(0,r.useMemo)((()=>"all"===ua?ya:ya.filter((e=>$(e,Qe,ns)===ua))),[ya,ua,Qe,ns]),wa=(0,r.useMemo)((()=>{if(!ha)return null;if(!_a.length)return{code:200,zone_summary:[],zones:[]};const e=e=>String(e||"").trim(),s={};_a.forEach((a=>{const t=e(a.deliverysuburb)||e(a.locationsuburb)||e(a.zone_name)||"Unzoned",i=t.toLowerCase(),r=String(a.userid||a.rider_id||"unassigned"),n=a.ridername||a.rider_name||a.username||("unassigned"===r?"Unassigned":"Rider ".concat(r));s[i]||(s[i]={zone_name:t,riders:{}}),s[i].riders[r]||(s[i].riders[r]={rider_id:r,rider_name:n,orders:[]}),s[i].riders[r].orders.push(a)}));const a=Object.values(s).map((e=>{const s=Object.values(e.riders).map((e=>{const s=[...e.orders].sort(((e,s)=>g()(e.deliverydate||e.assigntime||0).valueOf()-g()(s.deliverydate||s.assigntime||0).valueOf()));return(0,i.A)((0,i.A)({},e),{},{orders:s.map(((e,s)=>(0,i.A)((0,i.A)({},e),{},{trip_number:e.trip_number||1,step:e.step||s+1})))})}));return{zone_name:e.zone_name,riders:s}}));return{code:200,zone_summary:a.map((e=>{const s=e.riders.flatMap((e=>e.orders)),a=s.filter((e=>e.userid||e.rider_id)).length;return{zone_name:e.zone_name,total_orders:s.length,assigned_orders:a,unassigned_orders_count:s.length-a,active_riders_count:e.riders.filter((e=>"unassigned"!==e.rider_id)).length,total_delivery_kms:s.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),total_profit:s.reduce(((e,s)=>e+parseFloat(s.profit||0)),0)}})),zones:a}}),[ha,_a]),Fa=(0,r.useMemo)((()=>{const e=s||wa||{zones:[],zone_summary:[]},a=e.zones||[],t={};(e.zone_summary||[]).forEach((e=>{t[e.zone_name]=e}));const i=(e,s)=>{const a={};return e.forEach((e=>{const t=s(e);t&&(a[t]=(a[t]||0)+1)})),Object.entries(a).map((e=>{let[s,a]=e;return{name:s,count:a}})).sort(((e,s)=>s.count-e.count))};return a.map((e=>{var s,a,r,n;const l=t[e.zone_name]||{},c=(e.riders||[]).flatMap((e=>e.orders||[])),d=(e.riders||[]).filter((e=>e.rider_id&&"unassigned"!==e.rider_id)).length,o=i(c,(e=>e.deliverysuburb||e.locationsuburb)),u=i(c,(e=>e.pickupcustomer||e.kitchen_key)),m={};return c.forEach((e=>{const s=String(e.orderstatus||"unknown").toLowerCase();m[s]=(m[s]||0)+1})),{id:e.zone_name,name:e.zone_name,riders:e.riders||[],orders:c,totalOrders:null!==(s=l.total_orders)&&void 0!==s?s:c.length,activeRidersCount:null!==(a=l.active_riders_count)&&void 0!==a?a:d,totalKms:null!==(r=l.total_delivery_kms)&&void 0!==r?r:c.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),totalProfit:null!==(n=l.total_profit)&&void 0!==n?n:c.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),suburbs:o,kitchens:u,statusCounts:m}}))}),[s,wa]),{riders:Ma,kitchens:Ca,allOrders:za,stats:Aa}=(0,r.useMemo)((()=>{const e=[];((s||wa||{zones:[],zone_summary:[]}).zones||[]).forEach((s=>{(s.riders||[]).forEach((a=>{a.orders.forEach((t=>{e.push((0,i.A)((0,i.A)({},t),{},{zone_name:s.zone_name,rider_name:a.rider_name,rider_id:a.rider_id}))}))}))}));const a={};e.forEach((e=>{const s=e.rider_id||e.userid||"unknown";a[s]||(a[s]={id:s,riderName:e.rider_name||e.username||e.rider||s,orders:[],color:re[Object.keys(a).length%re.length]}),a[s].orders.push(e)}));const t={};e.forEach((e=>{const s=e.pickupcustomer||e.kitchen_key||"Unknown",a=s.toLowerCase().trim();t[a]?!Number.isFinite(t[a].lat)&&T(e)&&(t[a].lat=L(O(e)),t[a].lon=L(R(e))):t[a]={id:a,kitchenName:s,lat:L(O(e)),lon:L(R(e)),orders:[],riders:new Set},t[a].orders.push(e),e.rider_id&&t[a].riders.add(e.rider_id)}));const r=e.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),n=e.reduce(((e,s)=>e+parseFloat(s.profit||0)),0);return{riders:Object.values(a).map((e=>(0,i.A)((0,i.A)({},e),{},{orders:[...e.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)}))}))).sort(((e,s)=>s.orders.length-e.orders.length)),kitchens:Object.values(t).sort(((e,s)=>s.orders.length-e.orders.length)),allOrders:e,stats:{totalOrders:e.length,totalKms:r,totalProfit:n,totalRiders:Object.keys(a).length}}}),[s,wa]),Pa=Ve?n&&Ma.find((e=>e.id===n))||null:Fe,Ea=(0,r.useCallback)((e=>{h&&h(e?e.id:null),Ve||Me(e),De(null)}),[Ve,h]),Da=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=Pa?Pa.id:null;e!==Da.current&&(Pa?A.A.info("Focused rider changed to: ".concat(Pa.riderName," (").concat(Pa.orders.length," orders)")):A.A.info("Focused rider reset to: None"),Da.current=e)}),[Pa]),(0,r.useEffect)((()=>{Ee?A.A.info("Focused order updated: ID ".concat(Ee.orderid)):A.A.debug("Focused order selection cleared")}),[Ee]);const La=(0,r.useRef)(0);(0,r.useEffect)((()=>{za&&za.length!==La.current&&(A.A.info("Orders database updated: ".concat(za.length," orders actively tracked")),La.current=za.length)}),[za]);const qa=(0,r.useRef)(0);(0,r.useEffect)((()=>{oa&&oa.length!==qa.current&&(A.A.info("Live riders list updated: ".concat(oa.length," active riders mapped")),qa.current=oa.length)}),[oa]);const Ia=(0,r.useMemo)((()=>Pa?{orders:Pa.orders.length,riders:1,km:Pa.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:Pa.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),label:"Focused Rider"}:Ce?{orders:Ce.orders.length,riders:Ce.riders.size,km:Ce.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),profit:Ce.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),label:"Focused Kitchen"}:{orders:Aa.totalOrders,riders:Aa.totalRiders,km:Aa.totalKms,profit:Aa.totalProfit,label:"Total Fleet"}),[Pa,Ce,Aa]),Oa=(0,r.useMemo)((()=>{if(!Pa)return[];const e=new Set;return Pa.orders.forEach((s=>{null!=s.deliveryid&&""!==s.deliveryid&&0!==s.deliveryid&&e.add(String(s.deliveryid))})),Array.from(e)}),[Pa]),Ra=(0,y.E)({queries:Oa.map((e=>({queryKey:["deliveryLogs",e],queryFn:async()=>{var s,a;const i=await k.A.get("".concat("https://jupiter.nearle.app/live/api/v3","/deliveries/getdeliverylogs/?deliveryid=").concat(e));return function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e)||0===e.length)return[];const a=e.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&(Math.abs(e.lat)>.1||Math.abs(e.lng)>.1)));if(0===a.length)return[];if(1===a.length)return[{lat:a[0].lat,lng:a[0].lng,logdate:a[0].logdate,_ts:a[0]._ts}];const t=null!=s.processNoise?s.processNoise:1e-10,i=null!=s.measurementNoise?s.measurementNoise:2e-9,r=null!=s.outlierGate?s.outlierGate:9,n=null!=s.maxSpeedKmh?s.maxSpeedKmh:120,l=e=>e._ts||(e.logdate?new Date(e.logdate).getTime():0);let c=0;for(;cn||(d.push(e),o=s)}if(d.length<2)return d.map((e=>({lat:e.lat,lng:e.lng,logdate:e.logdate,_ts:e._ts})));const u=e=>{const s=d.length,a=new Array(s),n=new Array(s),c=new Array(s),o=new Array(s),u=new Array(s),m=l(d[0]),p=l(d[1]),h=Math.max(.1,(p-m)/1e3),x=(d[1][e]-d[0][e])/h;a[0]=[d[0][e],x],n[0]=[i,0,0,1],c[0]=a[0].slice(),o[0]=n[0].slice(),u[0]=0;let v=m;for(let g=1;gr){a[g]=[x,j],n[g]=[_,w,F,M];continue}const A=_/z,P=F/z,E=x+A*C,D=j+P*C;a[g]=[E,D],n[g]=[(1-A)*_,(1-A)*w,F-P*_,M-P*w]}const j=new Array(s);j[s-1]=a[s-1].slice();for(let t=s-2;t>=0;t--){const e=u[t+1],[s,i,r,l]=n[t],d=s+e*i,m=i,p=r+e*l,h=l,[x,v,g,f]=o[t+1],N=x*f-v*g;if(!Number.isFinite(N)||Math.abs(N)<1e-30){j[t]=a[t].slice();continue}const b=f/N,y=-v/N,k=-g/N,S=x/N,_=d*b+m*k,w=d*y+m*S,F=p*b+h*k,M=p*y+h*S,C=j[t+1][0]-c[t+1][0],z=j[t+1][1]-c[t+1][1];j[t]=[a[t][0]+_*C+w*z,a[t][1]+F*C+M*z]}return j.map((e=>e[0]))},m=u("lat"),p=u("lng");return d.map(((e,s)=>({lat:m[s],lng:p[s],logdate:e.logdate,_ts:e._ts})))}(([null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.details,null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.data,null===i||void 0===i?void 0:i.data,i].find((e=>Array.isArray(e)))||[]).map((e=>{var s,a,t;const i=null!==e&&void 0!==e&&e.logdate?g()(e.logdate):null;return{lat:parseFloat(null!==(s=null===e||void 0===e?void 0:e.latitude)&&void 0!==s?s:null===e||void 0===e?void 0:e.lat),lng:parseFloat(null!==(a=null!==(t=null===e||void 0===e?void 0:e.longitude)&&void 0!==t?t:null===e||void 0===e?void 0:e.lng)&&void 0!==a?a:null===e||void 0===e?void 0:e.lon),logdate:null===e||void 0===e?void 0:e.logdate,_ts:i&&i.isValid()?i.valueOf():Number.MAX_SAFE_INTEGER}})).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng))).sort(((e,s)=>e._ts-s._ts))).map((e=>{let{_ts:s}=e;return(0,t.A)(e,P)}))},enabled:Ys&&null!=Pa,staleTime:3e5,refetchOnWindowFocus:!1,retry:1})))}),Ta=(0,r.useMemo)((()=>{if(!Pa)return[];const e=e=>{const s=e.deliverytime||e.expecteddeliverytime;if(!s)return Number.MAX_SAFE_INTEGER;const a=g()(s);return a.isValid()?a.valueOf():Number.MAX_SAFE_INTEGER};return Pa.orders.filter((e=>null!=e.deliveryid&&""!==e.deliveryid&&0!==e.deliveryid)).sort(((s,a)=>{const t=e(s)-e(a);return 0!==t?t:(s.step||0)-(a.step||0)})).map(((e,s)=>{const a=Oa.indexOf(String(e.deliveryid)),t=a>=0?Ra[a]:null;return{sequenceStep:s+1,orderid:e.orderid,deliveryid:e.deliveryid,deliverycustomer:e.deliverycustomer,pickupcustomer:e.pickupcustomer,step:e.step,tripNumber:e.trip_number||1,deliverytime:e.deliverytime||e.expecteddeliverytime,kms:parseFloat(e.actualkms||e.kms||0)||0,profit:parseFloat(e.profit||0)||0,orderstatus:e.orderstatus,isLoading:(null===t||void 0===t?void 0:t.isLoading)||(null===t||void 0===t?void 0:t.isFetching),isError:null===t||void 0===t?void 0:t.isError,coords:(null===t||void 0===t?void 0:t.data)||[]}}))}),[Pa,Oa,Ra]),Ha=(0,r.useMemo)((()=>Pa?Ta.map((e=>{const s=Pa.orders.find((s=>String(s.deliveryid)===String(e.deliveryid))),a=parseFloat((null===s||void 0===s?void 0:s.kms)||0)||0,t=_s[e.deliveryid];let i=0;Array.isArray(t)&&t.length>=2?i=Q(t):null!=(null===s||void 0===s?void 0:s.actualkms)&&""!==s.actualkms?i=parseFloat(s.actualkms)||0:e.coords.length>=2&&(i=Q(e.coords.map((e=>[e.lat,e.lng]))));const r=i-a,n=a>0?r/a*100:null,l=null!==s&&void 0!==s&&s.expecteddeliverytime?g()(s.expecteddeliverytime):null,c=null!==s&&void 0!==s&&s.deliverytime?g()(s.deliverytime):null,d=null!==l&&void 0!==l&&l.isValid()&&null!==c&&void 0!==c&&c.isValid()?c.diff(l,"minute"):null,o=a>0&&i>1.25*a||null!=d&&d>15;return{sequenceStep:e.sequenceStep,deliveryid:e.deliveryid,orderid:e.orderid,order:s,plannedKm:a,actualKm:i,kmDelta:r,kmDeltaPct:n,expectedTs:null!==l&&void 0!==l&&l.isValid()?l:null,actualTs:null!==c&&void 0!==c&&c.isValid()?c:null,timeDeltaMin:d,anomaly:o,orderstatus:e.orderstatus,deliverycustomer:e.deliverycustomer,pickupcustomer:null===s||void 0===s?void 0:s.pickupcustomer,isLoading:e.isLoading,coordsCount:e.coords.length}})):[]),[Ta,Pa,_s]),Ya=(0,r.useMemo)((()=>{if(0===Ha.length)return{plannedKm:0,actualKm:0,kmDeltaPct:null,anomalies:0,late:0,onTime:0};const e=Ha.filter((e=>!e.isLoading&&e.coordsCount>0)),s=e.reduce(((e,s)=>e+s.plannedKm),0),a=e.reduce(((e,s)=>e+s.actualKm),0);return{plannedKm:s,actualKm:a,kmDeltaPct:s>0?(a-s)/s*100:null,anomalies:e.filter((e=>e.anomaly)).length,late:e.filter((e=>null!=e.timeDeltaMin&&e.timeDeltaMin>5)).length,onTime:e.filter((e=>null!=e.timeDeltaMin&&e.timeDeltaMin<=5)).length}}),[Ha]),Va=(0,r.useMemo)((()=>[...Ha].sort(((e,s)=>{var a,t;return((null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep)-((null===(t=s.order)||void 0===t?void 0:t.step)||s.sequenceStep)}))),[Ha]),Ka=(0,r.useMemo)((()=>[...Ha].sort(((e,s)=>e.sequenceStep-s.sequenceStep))),[Ha]),Ba=(0,r.useMemo)((()=>{if(!Ys||!ra||!Pa)return null;const e=Ta.find((e=>e.sequenceStep===ra));if(!e)return null;const s=Pa.orders.find((s=>String(s.deliveryid)===String(e.deliveryid)));return s?{orders:[s],id:"cmp-step-".concat(ra,"-").concat(s.orderid)}:null}),[Ys,ra,Pa,Ta]);(0,r.useEffect)((()=>{na(null),Zs(new Set),Bs("combined")}),[Ys,null===Pa||void 0===Pa?void 0:Pa.id]),(0,r.useEffect)((()=>{!Pa&&Ys&&Vs(!1)}),[Pa,Ys]),(0,r.useEffect)((()=>{Xs.current&&Pa&&(Xs.current=!1,Vs(!0))}),[Pa]),(0,r.useEffect)((()=>{Ys&&!aa.current?(sa.current=Qs,ea(!0),ia(!1)):!Ys&&aa.current&&ea(sa.current),aa.current=Ys}),[Ys]);const Ua=(0,r.useCallback)((async(e,s,a)=>{if(a.length<2)return;const t=ie(e,s,a);if(void 0!==Ss.current[t])return;Ss.current[t]=null,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:null})));const r=a.map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),n="https://router.project-osrm.org/route/v1/driving/".concat(r,"?overview=full&geometries=geojson");try{const e=await fetch(n),s=await e.json();if(s.routes&&s.routes[0]){const e=s.routes[0].geometry.coordinates.map((e=>[e[1],e[0]]));Ss.current[t]=e,ks((s=>(0,i.A)((0,i.A)({},s),{},{[t]:e})))}else Ss.current[t]=!1,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:!1})))}catch(l){console.error("OSRM Fetch error:",l),Ss.current[t]=!1,ks((e=>(0,i.A)((0,i.A)({},e),{},{[t]:!1})))}}),[]);(0,r.useEffect)((()=>{Ss.current={},ks({}),Fs.current={},ws({})}),[Ls,ua]);const Ga=(0,r.useCallback)((async(e,s)=>{if(void 0!==Fs.current[e])return;if(!Array.isArray(s)||s.length<2)return;Fs.current[e]=null,ws((s=>(0,i.A)((0,i.A)({},s),{},{[e]:null})));const a=s=>{Fs.current[e]=s,ws((a=>(0,i.A)((0,i.A)({},a),{},{[e]:s})))},t=()=>{Fs.current[e]=!1,ws((s=>(0,i.A)((0,i.A)({},s),{},{[e]:!1})))},r=(e,s)=>{if(e.length<=s)return e;const a=Math.ceil(e.length/s),t=e.filter(((e,s)=>s%a===0)),i=e[e.length-1];return t[t.length-1]!==i&&t.push(i),t};try{const e=r(s,90).map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),t="https://router.project-osrm.org/match/v1/driving/".concat(e,"?overview=full&geometries=geojson&gaps=ignore&tidy=true"),i=await fetch(t),n=await i.json();if(n.matchings&&n.matchings.length>0){const e=n.matchings.flatMap((e=>{var s;return((null===(s=e.geometry)||void 0===s?void 0:s.coordinates)||[]).map((e=>[e[1],e[0]]))}));if(e.length>=2)return void a(e)}}catch(n){console.warn("OSRM Match error, trying route fallback:",n)}try{const e=r(s,25).map((e=>"".concat(e[1],",").concat(e[0]))).join(";"),i="https://router.project-osrm.org/route/v1/driving/".concat(e,"?overview=full&geometries=geojson"),n=await fetch(i),l=await n.json();if(l.routes&&l.routes[0]){const e=l.routes[0].geometry.coordinates.map((e=>[e[1],e[0]]));if(e.length>=2)return void a(e)}t()}catch(n){console.error("OSRM Route fallback error:",n),t()}}),[]);(0,r.useEffect)((()=>{Ys&&Pa&&Ta.forEach((e=>{if(!e.deliveryid||e.coords.length<2)return;const s=e.coords.map((e=>[e.lat,e.lng]));Ga(e.deliveryid,s)}))}),[Ta,Ys,Pa,Ga]),(0,r.useEffect)((()=>{Ds.current=Ms}),[Ms]),(0,r.useEffect)((()=>{if(a)return;const e=()=>{const e=new Date;Be([e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>String(e).padStart(2,"0"))).join(":"))},s=setInterval(e,1e3);return e(),()=>clearInterval(s)}),[a]),(0,r.useEffect)((()=>{we(new Set(Ma.map((e=>e.id))))}),[Ma]),(0,r.useEffect)((()=>{Ma.forEach((e=>{if(!_e.has(e.id))return;if(Pa&&Pa.id!==e.id)return;const s={};e.orders.forEach((e=>{const a=e.trip_number||1;s[a]||(s[a]=[]),s[a].push(e)})),Object.entries(s).forEach((s=>{let[a,t]=s;const i=[...t].sort(((e,s)=>(e.step||0)-(s.step||0))),r=te(i);r.length>=2&&Ua(e.id,a,r)}))}))}),[Ma,_e,Pa,Ua]);const Ja=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(!ha)return;const e=()=>{const e=g()();return e.hour()+e.minute()/60};null===Ja.current&&(Ja.current=e());const s=setInterval((()=>{const s=e(),a=J(Ja.current,ns),t=J(s,ns);Ja.current=s,t&&t!==a&&ma((e=>e===a?t:e))}),3e4);return()=>clearInterval(s)}),[ha,ns]),(0,r.useEffect)((()=>{De(null)}),[null===Ce||void 0===Ce?void 0:Ce.id]),(0,r.useEffect)((()=>{const e=pa.current;e&&"function"===typeof e.scrollIntoView&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}),[ua]),(0,r.useEffect)((()=>{if(!Ee)return;const e=setTimeout((()=>{var e;const s=null===za||void 0===za||null===(e=za.find)||void 0===e?void 0:e.call(za,(e=>String(e.orderid)===String(Ee.orderid)));s&&Ye(s)}),350);return()=>clearTimeout(e)}),[Ee,za]);const Wa=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return x().divIcon({className:"",iconSize:s?[56,56]:[46,46],iconAnchor:s?[28,28]:[23,23],popupAnchor:[0,s?-30:-24],html:'
').concat((e||"K").charAt(0).toUpperCase(),"
")})},$a=e=>{var s;return(null===(s=Ma.find((s=>s.id===e)))||void 0===s?void 0:s.color)||"#475569"},Za=(e,s)=>{if(!e||!s||!I(s))return null;const a=oa.find((s=>String(s.id)===String(e)));if(!a)return null;const t=L(s.droplat||s.deliverylat),i=L(s.droplon||s.deliverylong);if(!Number.isFinite(t)||!Number.isFinite(i))return null;const r=X([a.lat,a.lon],[t,i]);return Math.round(1e3*r)},Xa=e=>null===e||void 0===e?"":e>=1e3?"".concat((e/1e3).toFixed(1)," km"):"".concat(e," m");return(0,C.jsxs)("div",{className:"dispatch-container".concat(a?" embedded":"").concat(Ys?" compare-open":""),children:[!a&&(0,C.jsxs)("div",{id:"hdr",children:[(0,C.jsxs)("div",{className:"logo",children:[(0,C.jsx)("div",{className:"logo-badge",children:"D"}),(0,C.jsx)("div",{className:"logo-name",children:"Dispatch"}),Ue&&Ue.length>0&&(0,C.jsxs)("div",{className:"logo-city-wrap",ref:Xe,children:[(0,C.jsxs)("button",{type:"button",className:"logo-city ".concat($e?"open":""),onClick:()=>Ze((e=>!e)),"aria-haspopup":"listbox","aria-expanded":$e,title:"Switch hub",children:[(0,C.jsx)(S.JFD,{}),(0,C.jsx)("span",{className:"logo-city-text",children:bs||"All locations"}),(0,C.jsx)(S.j1Q,{className:"logo-city-caret"})]}),$e&&(0,C.jsx)("div",{className:"logo-city-menu",role:"listbox",children:Ue.map((e=>{const s=String(e.applocationid)===String(Je);return(0,C.jsxs)("button",{type:"button",role:"option","aria-selected":s,className:"logo-city-option ".concat(s?"active":""),onClick:()=>(e=>{if(A.A.info("Switching hub/location ID:",e),We(Number(e)),Ze(!1),"undefined"!==typeof window)try{localStorage.setItem("applocationid",String(e))}catch(s){}Ea(null),ze(null),Pe(null)})(e.applocationid),children:[(0,C.jsx)(S.JFD,{className:"logo-city-option-icon"}),(0,C.jsx)("span",{children:e.locationname}),s&&(0,C.jsx)("span",{className:"logo-city-option-check",children:"\u2713"})]},e.applocationid)}))})]}),(0,C.jsxs)("div",{id:"dispatch-top-tabs",className:"dtt-inline",children:[(0,C.jsxs)("button",{type:"button",className:"dtt-tab ".concat("live"===W?"active":""),onClick:()=>me("live"),children:[(0,C.jsx)("span",{className:"dtt-icon",children:(0,C.jsx)(S.Cd7,{})}),"Live"]}),(0,C.jsxs)("button",{type:"button",className:"dtt-tab ".concat("analysis"===W?"active":""),onClick:()=>me("analysis"),children:[(0,C.jsx)("span",{className:"dtt-icon",children:(0,C.jsx)(S.DX0,{})}),"Analysis"]})]})]}),(0,C.jsxs)("div",{className:"hdr-stats",children:[(()=>{const e=Ia.profit<0,s=Math.abs(Ia.profit);return(0,C.jsxs)("span",{className:"strat-stat ".concat(e?"strat-stat-loss":"strat-stat-profit"),title:"".concat(e?"Loss":"Profit"," (").concat(Ia.label,")"),children:[(0,C.jsx)("span",{className:"strat-stat-icon",children:e?(0,C.jsx)(S.Rod,{}):(0,C.jsx)(S.imn,{})}),(0,C.jsx)("span",{className:"strat-stat-label",children:e?"Loss":"Profit"}),(0,C.jsxs)("span",{className:"strat-stat-value",children:[e?"-":"","\u20b9",s.toFixed(0)]})]})})(),ha&&(0,C.jsxs)(C.Fragment,{children:[ja&&(0,C.jsxs)("span",{className:"live-status",children:[(0,C.jsx)("span",{className:"live-dot"})," Loading ",ya.length?"\xb7 ".concat(ya.length," loaded"):""]}),!ja&&!ga&&(0,C.jsxs)("span",{className:"live-status live-status-ready",children:[(0,C.jsx)("span",{className:"live-dot ready"})," ",_a.length," orders",(0,C.jsxs)("span",{className:"live-status-sub",children:[" / ",ya.length," total"]})]}),ga&&(0,C.jsxs)("span",{className:"live-status live-status-error",children:[(0,C.jsx)("span",{className:"live-dot error"})," Failed to load"]}),(()=>{const e=g()().startOf("day"),s=e.format("YYYY-MM-DD"),a=g()(Ls),t=Ls===s,i=a.isAfter(e,"day"),r=s=>{if(!s)return;const a=s.format("YYYY-MM-DD");a!==Ls?s.isAfter(e,"day")||(qs(a),Ea(null),ze(null),Pe(null),Os(!1)):Os(!1)},n=Rs.startOf("month"),l=n.subtract(n.day(),"day"),c=Array.from({length:42},((e,s)=>l.add(s,"day"))),d=!Rs.add(1,"month").startOf("month").isAfter(e,"month");return(0,C.jsxs)("div",{className:"date-chip".concat(t?" is-today":"").concat(Is?" is-open":""),ref:Hs,children:[(0,C.jsx)("button",{type:"button",className:"date-chip-nav",onClick:()=>r(a.subtract(1,"day")),"aria-label":"Previous day",title:"Previous day",children:(0,C.jsx)(S.E_E,{})}),(0,C.jsxs)("button",{type:"button",className:"date-chip-main",onClick:()=>Os((e=>!e)),"aria-haspopup":"dialog","aria-expanded":Is,children:[(0,C.jsx)("span",{className:"date-chip-icon","aria-hidden":"true",children:(0,C.jsx)(S.dDC,{})}),(0,C.jsxs)("span",{className:"date-chip-text",children:[(0,C.jsxs)("span",{className:"date-chip-label",children:["Date",t&&(0,C.jsx)("span",{className:"date-chip-today-pill",children:"Today"})]}),(0,C.jsx)("span",{className:"date-chip-value",children:a.isValid()?a.format("ddd, MMM D, YYYY"):"\u2014"})]}),(0,C.jsx)("span",{className:"date-chip-chevron".concat(Is?" is-open":""),"aria-hidden":"true",children:(0,C.jsx)(S.j1Q,{})})]}),(0,C.jsx)("button",{type:"button",className:"date-chip-nav",onClick:()=>{t||i||r(a.add(1,"day"))},disabled:t||i,"aria-label":"Next day",title:t?"You're viewing today":"Next day",children:(0,C.jsx)(S.xVu,{})}),Is&&(0,C.jsxs)("div",{className:"date-cal-popover",role:"dialog","aria-label":"Pick a date",children:[(0,C.jsxs)("div",{className:"date-cal-header",children:[(0,C.jsx)("button",{type:"button",className:"date-cal-nav",onClick:()=>Ts((e=>e.subtract(1,"month"))),"aria-label":"Previous month",children:(0,C.jsx)(S.E_E,{})}),(0,C.jsx)("div",{className:"date-cal-title",children:Rs.format("MMMM YYYY")}),(0,C.jsx)("button",{type:"button",className:"date-cal-nav",onClick:()=>{const s=Rs.add(1,"month");s.startOf("month").isAfter(e,"month")||Ts(s)},disabled:!d,"aria-label":"Next month",children:(0,C.jsx)(S.xVu,{})})]}),(0,C.jsx)("div",{className:"date-cal-weekdays",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((e=>(0,C.jsx)("div",{className:"date-cal-weekday",children:e},e)))}),(0,C.jsx)("div",{className:"date-cal-grid",children:c.map((a=>{const t=a.month()===Rs.month(),i=a.format("YYYY-MM-DD")===Ls,n=a.format("YYYY-MM-DD")===s,l=a.isAfter(e,"day"),c=["date-cal-day",!t&&"is-other-month",i&&"is-selected",n&&"is-today",l&&"is-disabled"].filter(Boolean).join(" ");return(0,C.jsx)("button",{type:"button",className:c,disabled:l,onClick:()=>r(a),"aria-current":n?"date":void 0,"aria-pressed":i,children:a.date()},a.format("YYYY-MM-DD"))}))}),(0,C.jsxs)("div",{className:"date-cal-presets",children:[(0,C.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e),children:"Today"}),(0,C.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e.subtract(1,"day")),children:"Yesterday"}),(0,C.jsx)("button",{type:"button",className:"date-cal-preset",onClick:()=>r(e.subtract(7,"day")),children:"\u22127 days"})]})]})]})})()]})]}),(0,C.jsx)("div",{id:"clock",children:Ke})]}),(a||"live"===W)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{id:"strat-row",children:[(0,C.jsxs)("button",{className:"sbt ".concat("kitchens"===M?"active":""),onClick:()=>{A.A.info("View mode changed: By Location"),B("kitchens"),Ea(null),ze(null),Pe(null)},children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.JFD,{})})," By Location"]}),(0,C.jsxs)("button",{className:"sbt ".concat("zones"===M?"active":""),onClick:()=>{A.A.info("View mode changed: By Zone"),B("zones"),Ea(null),ze(null),Pe(null)},children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.Cd7,{})})," By Zone"]}),(0,C.jsxs)("button",{className:"sbt ".concat("riders"===M?"active":""),onClick:()=>{A.A.info("View mode changed: By Rider"),B("riders"),Ea(null),ze(null),Pe(null)},children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.bsz,{})})," By Rider"]}),(0,C.jsxs)("button",{className:"sbt ".concat("all"===M?"active":""),onClick:()=>{A.A.info("View mode changed: All Routes"),B("all"),Ea(null),ze(null),Pe(null)},children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.Zs6,{})})," All Routes"]}),(0,C.jsxs)("button",{type:"button",className:"sbt sbt-rider-info ".concat("rider-info"===M?"active":""),onClick:()=>{B("rider-info"),Ea(null),ze(null),Pe(null)},title:"Live GPS / battery / status snapshot for a rider",children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.k4P,{})})," Rider Info"]})]}),ha&&"rider-info"!==M&&(0,C.jsxs)("div",{id:"batch-row",children:[(0,C.jsx)("span",{className:"batch-label",children:"Batch"}),(0,C.jsx)("div",{className:"batch-scroll",children:ns.map((e=>{var s;const a=ua===e.id;return(0,C.jsxs)("button",{ref:a?pa:null,className:"batch-btn batch-slot ".concat(a?"active":""),onClick:()=>{ma(e.id),Ea(null),ze(null),Pe(null)},title:"".concat(e.label," (").concat(e.range,")"),children:[(0,C.jsx)("span",{className:"batch-btn-label",children:e.label}),(0,C.jsx)("span",{className:"batch-btn-count",children:null!==(s=Sa[e.id])&&void 0!==s?s:0})]},e.id)}))})]}),"rider-info"===M?(0,C.jsxs)("div",{className:"rider-info-mode",children:[(0,C.jsxs)("div",{className:"ri-sidebar",children:[(0,C.jsxs)("div",{className:"ri-sb-head",children:[(0,C.jsx)("div",{className:"ri-sb-title",children:"Riders"}),(0,C.jsxs)("div",{className:"ri-sb-sub",children:[ka.length," ",1===ka.length?"rider":"riders"," today"]})]}),(0,C.jsxs)("div",{className:"ri-search",children:[(0,C.jsx)(S.gZ7,{className:"ri-search-icon"}),(0,C.jsx)("input",{type:"text",className:"ri-search-input",placeholder:"Search by name or ID",value:ps,onChange:e=>hs(e.target.value)})]}),(()=>{const e=ps.trim().toLowerCase(),s=ka.filter((s=>!e||(String(s.riderName||"").toLowerCase().includes(e)||String(s.id).includes(e))));return 0===s.length?(0,C.jsx)("div",{className:"ri-empty",children:ps?'No riders match "'.concat(ps,'"'):"No riders have orders today"}):(0,C.jsx)("div",{className:"ri-rider-list",children:s.map((e=>{const s=String(us)===String(e.id);return(0,C.jsxs)("button",{type:"button",className:"ri-rider-item ".concat(s?"active":""),onClick:()=>ms(e.id),children:[(0,C.jsx)("span",{className:"ri-rider-dot",style:{background:ne(e.id)}}),(0,C.jsxs)("span",{className:"ri-rider-info-block",children:[(0,C.jsx)("span",{className:"ri-rider-name",children:e.riderName}),(0,C.jsxs)("span",{className:"ri-rider-meta",children:["#",e.id]})]}),(0,C.jsx)("span",{className:"ri-rider-arrow",children:"\u2192"})]},e.id)}))})})()]}),(0,C.jsx)("div",{className:"ri-main",children:null==us?(0,C.jsxs)("div",{className:"ri-placeholder",children:[(0,C.jsx)("div",{className:"ri-placeholder-icon",children:(0,C.jsx)(S.k4P,{})}),(0,C.jsx)("div",{className:"ri-placeholder-title",children:"Pick a rider"}),(0,C.jsx)("div",{className:"ri-placeholder-sub",children:"Select a rider from the list on the left to see their live GPS, battery, connection, and current order snapshot."})]}):(0,C.jsxs)(C.Fragment,{children:[vs&&!xs&&(0,C.jsx)("div",{className:"ri-loading",children:"Loading rider snapshot\u2026"}),js&&(0,C.jsxs)("div",{className:"ri-error",children:["Couldn't load this rider's log. ",(null===gs||void 0===gs?void 0:gs.message)||""]}),xs&&(()=>{const e=xs,s=parseFloat(e.latitude),a=parseFloat(e.longitude),t=Number.isFinite(s)&&Number.isFinite(a),i=parseInt(String(e.battery||"").replace("%",""),10),r=Number.isFinite(i)&&i<=20,n=parseFloat(e.speed),c=String(e.status||"").toLowerCase();return(0,C.jsxs)("div",{className:"ri-snapshot",children:[(0,C.jsxs)("div",{className:"ri-snap-head",children:[(0,C.jsx)("div",{className:"ri-snap-name",children:e.username||"Rider #".concat(e.userid)}),(0,C.jsxs)("div",{className:"ri-snap-meta",children:[(0,C.jsxs)("span",{children:["#",e.userid]}),e.status&&(0,C.jsx)("span",{className:"ri-status ri-status-".concat(c),children:e.status}),(0,C.jsxs)("span",{className:"ri-live ".concat(vs?"is-refetching":""),children:[(0,C.jsx)("span",{className:"ri-live-dot"}),vs?"Updating\u2026":"Live"]})]}),e.logdate&&(0,C.jsxs)("div",{className:"ri-snap-time",children:[(0,C.jsx)(S.VP9,{})," Last seen ",e.logdate]})]}),(0,C.jsxs)("div",{className:"ri-snap-grid",children:[(0,C.jsxs)("div",{className:"ri-stat ".concat(r?"ri-stat-warn":""),children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.wZm,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Battery"}),(0,C.jsxs)("div",{className:"ri-stat-value",children:[e.battery||"\u2014",e.is_charging&&(0,C.jsx)("span",{className:"ri-stat-tag",children:"Charging"})]})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.Xh5,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Connection"}),(0,C.jsx)("div",{className:"ri-stat-value",children:e.connection||"\u2014"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.HPi,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"GPS Accuracy"}),(0,C.jsx)("div",{className:"ri-stat-value",children:e.accuracy?"".concat(e.accuracy," m"):"\u2014"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.o8z,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Location Service"}),(0,C.jsx)("div",{className:"ri-stat-value",children:e.location_service||"\u2014"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.BJM,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Speed"}),(0,C.jsx)("div",{className:"ri-stat-value",children:Number.isFinite(n)?"".concat(n.toFixed(2)," km/h"):"\u2014"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.bqQ,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Heading"}),(0,C.jsx)("div",{className:"ri-stat-value",children:null!=e.heading?"".concat(e.heading,"\xb0"):"\u2014"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.pSF,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"App State"}),(0,C.jsx)("div",{className:"ri-stat-value",children:e.is_background?"Background":"Foreground"})]})]}),(0,C.jsxs)("div",{className:"ri-stat",children:[(0,C.jsx)("div",{className:"ri-stat-icon",children:(0,C.jsx)(S.gsJ,{})}),(0,C.jsxs)("div",{className:"ri-stat-body",children:[(0,C.jsx)("div",{className:"ri-stat-label",children:"Current Order"}),(0,C.jsx)("div",{className:"ri-stat-value",children:e.orderid||"\u2014"})]})]})]}),t&&(0,C.jsxs)("div",{className:"ri-map-section",children:[(0,C.jsxs)("div",{className:"ri-coords-label",children:[(0,C.jsx)(S.gwi,{})," ",s.toFixed(6),", ",a.toFixed(6)]}),(0,C.jsx)("div",{className:"ri-map",children:(0,C.jsxs)(d.W,{center:[s,a],zoom:13,scrollWheelZoom:!1,style:{height:"100%",width:"100%"},children:[(0,C.jsx)(o.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),(0,C.jsxs)(l.p,{position:[s,a],children:[(0,C.jsx)(u.m,{direction:"top",offset:[0,-10],permanent:!0,className:"ri-area-banner",children:(null===Ns||void 0===Ns?void 0:Ns.area)||"Locating area\u2026"}),(0,C.jsxs)(m.z,{children:[(0,C.jsx)("div",{style:{fontWeight:700,marginBottom:2},children:e.username||"Rider #".concat(e.userid)}),(null===Ns||void 0===Ns?void 0:Ns.area)&&(0,C.jsx)("div",{style:{fontSize:12,color:"#0f172a",marginBottom:4},children:Ns.area}),(0,C.jsx)("div",{style:{fontSize:11,color:"#64748b"},children:e.logdate?"Last seen ".concat(e.logdate):"".concat(s.toFixed(6),", ").concat(a.toFixed(6))})]})]})]},"".concat(e.userid,"-").concat(s,"-").concat(a))})]})]})})()]})})]}):(0,C.jsxs)("div",{id:"body",className:"".concat(Qs?"sidebar-collapsed":""," ").concat(Ys?"compare-mode":""," ").concat(Ys&&ta?"compare-data-collapsed":"").trim(),children:[(0,C.jsx)("button",{type:"button",className:"sidebar-toggle-tab".concat(Qs?" is-collapsed":""),onClick:()=>ea((e=>!e)),title:Qs?"Show sidebar":"Hide sidebar","aria-label":Qs?"Show sidebar":"Hide sidebar",children:Qs?(0,C.jsx)(S.xVu,{}):(0,C.jsx)(S.E_E,{})}),Ys&&Pa&&(0,C.jsx)("button",{type:"button",className:"compare-data-toggle-tab".concat(ta?" is-collapsed":""),onClick:()=>ia((e=>!e)),title:ta?"Show details panel":"Hide details panel","aria-label":ta?"Show details panel":"Hide details panel",children:ta?(0,C.jsx)(S.E_E,{}):(0,C.jsx)(S.xVu,{})}),(0,C.jsxs)("div",{id:"sidebar",children:[!Pa&&(0,C.jsxs)("div",{className:"sb-header",children:[(0,C.jsxs)("div",{className:"sb-header-top",children:[(0,C.jsxs)("div",{className:"sb-header-title",children:[(0,C.jsx)("span",{className:"sb-title-bar","aria-hidden":"true"}),(0,C.jsx)("span",{className:"sb-title-text",children:"RIDER DISPATCH"})]}),(0,C.jsxs)("span",{className:"sb-header-scope",title:Ia.label,children:[(0,C.jsx)("span",{className:"sb-scope-dot"}),Ia.label]})]}),(0,C.jsxs)("div",{className:"sb-header-tiles",children:[(0,C.jsxs)("div",{className:"sb-tile sb-tile-orders",children:[(0,C.jsx)("span",{className:"sb-tile-icon",children:(0,C.jsx)(S.gsJ,{})}),(0,C.jsxs)("div",{className:"sb-tile-body",children:[(0,C.jsx)("div",{className:"sb-tile-value",children:Ia.orders}),(0,C.jsx)("div",{className:"sb-tile-label",children:1===Ia.orders?"Order":"Orders"})]})]}),(0,C.jsxs)("div",{className:"sb-tile sb-tile-riders",children:[(0,C.jsx)("span",{className:"sb-tile-icon",children:(0,C.jsx)(S.aVM,{})}),(0,C.jsxs)("div",{className:"sb-tile-body",children:[(0,C.jsx)("div",{className:"sb-tile-value",children:Ia.riders}),(0,C.jsx)("div",{className:"sb-tile-label",children:1===Ia.riders?"Rider":"Riders"})]})]})]})]}),Pa||Ce?(0,C.jsxs)("div",{id:"route-detail",children:[(0,C.jsxs)("button",{className:"rd-back",onClick:()=>{Ea(null),ze(null)},children:["\u2190 Back to ",Ae?Ae.name:"list"]}),Pa?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"rd-rider-name",style:{color:Pa.color},children:Pa.riderName}),(()=>{const e=Pa.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0),s=Pa.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0),a=s<0;return(0,C.jsxs)("div",{className:"rd-stats-grid",children:[(0,C.jsxs)("div",{className:"rd-stat rd-stat-orders",children:[(0,C.jsx)("div",{className:"rd-stat-icon",children:(0,C.jsx)(S.gsJ,{})}),(0,C.jsx)("div",{className:"rd-stat-value",children:Pa.orders.length}),(0,C.jsx)("div",{className:"rd-stat-label",children:"Orders"})]}),(0,C.jsxs)("div",{className:"rd-stat rd-stat-distance",children:[(0,C.jsx)("div",{className:"rd-stat-icon",children:(0,C.jsx)(S.xI$,{})}),(0,C.jsxs)("div",{className:"rd-stat-value",children:[e.toFixed(1),(0,C.jsx)("span",{className:"rd-stat-unit",children:"km"})]}),(0,C.jsx)("div",{className:"rd-stat-label",children:"Distance"})]}),(0,C.jsxs)("div",{className:"rd-stat rd-stat-profit ".concat(a?"is-loss":"is-gain"),children:[(0,C.jsx)("div",{className:"rd-stat-icon",children:a?(0,C.jsx)(S.Rod,{}):(0,C.jsx)(S.imn,{})}),(0,C.jsxs)("div",{className:"rd-stat-value",children:[a?"-":"","\u20b9",Math.abs(s).toFixed(0)]}),(0,C.jsx)("div",{className:"rd-stat-label",children:a?"Loss":"Profit"})]})]})})(),(()=>{const e={};Pa.orders.forEach((s=>{const a=s.trip_number||1;e[a]||(e[a]=[]),e[a].push(s)}));const s=[...Pa.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),a=s?s.orderid:null,t=e=>{const s=e.deliverytime||e.expecteddeliverytime;if(!s)return Number.MAX_SAFE_INTEGER;const a=g()(s);return a.isValid()?a.valueOf():Number.MAX_SAFE_INTEGER},i="time"===Le;let n=null;return Object.entries(e).sort(((e,s)=>{let[a]=e,[t]=s;return Number(a)-Number(t)})).map((e=>{let[s,l]=e;const c=i?[...l].sort(((e,s)=>{const a=t(e)-t(s);return 0!==a?a:(e.step||0)-(s.step||0)})):l;return(0,C.jsxs)("div",{className:"trip-block",children:[(0,C.jsxs)("div",{className:"trip-header",style:{background:"".concat(Pa.color,"12"),borderColor:"".concat(Pa.color,"30")},children:[(0,C.jsxs)("span",{className:"th-badge",style:{background:Pa.color},children:["Trip ",s]}),(0,C.jsxs)("span",{className:"trip-stats",children:[(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gwi,{})}),l.length," stops"]}),(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),l.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]})]}),(0,C.jsxs)("div",{className:"trip-sort-toggle",role:"group","aria-label":"Sort stops by","data-mode":i?"time":"planned",children:[(0,C.jsxs)("button",{type:"button",className:"trip-sort-pill ".concat(i?"":"is-active"),"aria-pressed":!i,onClick:()=>qe("planned"),title:"Sort stops by planned step (dispatched order)",children:[(0,C.jsx)(S.EgJ,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:"Planned"})]}),(0,C.jsxs)("button",{type:"button",className:"trip-sort-pill ".concat(i?"is-active":""),"aria-pressed":i,onClick:()=>qe("time"),title:"Sort stops by completion time (which delivery was done first)",children:[(0,C.jsx)(S.VP9,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:"By time"})]})]})]}),(0,C.jsx)("div",{className:"zone-order-grid",children:c.map(((e,t)=>{const l=(e.kitchen_key||e.pickupcustomer||"Unknown").toLowerCase().trim(),c=null!==n&&l!==n;n=l;const d=Ee&&Ee.orderid===e.orderid,o=a&&e.orderid===a,u=parseFloat(e.droplat||e.deliverylat),m=parseFloat(e.droplon||e.deliverylong),p=Number.isFinite(u)&&Number.isFinite(m),h=(0,w.Cx)(e.orderstatus),x=parseFloat(e.profit||0),v=x<0,g=Za(Pa.id,e),f=e.step||t+1,N=i&&!e.deliverytime;return(0,C.jsxs)(r.Fragment,{children:[c&&(0,C.jsxs)("div",{className:"kitchen-transition",children:[(0,C.jsx)("span",{className:"kt-ico",children:(0,C.jsx)(S.$G1,{})})," Switch to ",(0,C.jsx)("strong",{children:e.pickupcustomer})]}),(0,C.jsxs)("div",{className:"zone-order-card ".concat(p?"clickable":""," ").concat(d?"active":""," ").concat(o?"going-on":""," ").concat(N?"is-pending-time":""),role:p?"button":void 0,tabIndex:p?0:void 0,onClick:p?()=>De(d?null:{orderid:e.orderid,lat:u,lon:m}):void 0,onKeyDown:p?s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),De(d?null:{orderid:e.orderid,lat:u,lon:m}))}:void 0,title:p?d?"Click to show full trip":"Show ".concat(e.deliverycustomer||"order #".concat(e.orderid)," on map"):void 0,children:[(0,C.jsxs)("div",{className:"zone-order-card-head",children:[(0,C.jsx)("div",{className:"zone-order-num",title:"Planned step ".concat(e.step||t+1),children:f}),(0,C.jsx)("div",{className:"zone-order-id-block",children:(0,C.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]})}),(()=>{const s=se(e.deliverytime),a=se(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==g;return e.orderstatus||s||a||t?(0,C.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,C.jsx)("span",{className:"zone-order-status",style:{background:h.bg,color:h.fg},children:h.label}),(s||a)&&(0,C.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,C.jsx)(S.VP9,{}),s||a]}),t&&(0,C.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,C.jsx)(S.HPi,{}),Xa(g)]})]}):null})(),j&&(0,C.jsx)("button",{type:"button",className:"zone-order-change-rider",title:"Change rider",onClick:s=>{s.stopPropagation(),j(e,Pa)},children:(0,C.jsx)(S.$G1,{})})]}),(0,C.jsxs)("div",{className:"zone-order-customer",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,C.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,C.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gwi,{})}),e.deliverysuburb||q(e.deliveryaddress)]}),e.ordernotes&&(0,C.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.dKO,{})}),e.ordernotes]}),(0,C.jsxs)("div",{className:"zone-order-stats",children:[(0,C.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,C.jsxs)("span",{className:"zone-order-chip ".concat(v?"is-loss":"is-profit"),title:"Profit",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.ohY,{})}),v?"-":"","\u20b9",Math.abs(x).toFixed(0)]}),null!=e.deliverycharge&&(0,C.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,C.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,C.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||s," \xb7 S",e.step||t+1]})]})]})]},e.orderid)}))})]},s)}))})()]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"rd-rider-name",style:{color:"#f59e0b"},children:Ce.kitchenName}),(0,C.jsxs)("div",{className:"rd-rider-sub",children:[(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gsJ,{})}),Ce.orders.length," orders"]}),(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.aVM,{})}),Ce.riders.size," riders"]})]}),(0,C.jsxs)("div",{className:"zone-detail-section",children:[(0,C.jsxs)("div",{className:"zone-section-label",children:["Orders ",(0,C.jsxs)("span",{className:"section-count",children:["(",Ce.orders.length,")"]})]}),0===Ce.orders.length?(0,C.jsx)("div",{className:"zone-suburb-panel-empty",children:"No orders for this kitchen."}):(0,C.jsx)("div",{className:"zone-order-grid",children:Ce.orders.map(((e,s)=>{const a=parseFloat(e.droplat||e.deliverylat),t=parseFloat(e.droplon||e.deliverylong),i=Number.isFinite(a)&&Number.isFinite(t),r=Ee&&Ee.orderid===e.orderid,n=(0,w.Cx)(e.orderstatus),l=parseFloat(e.profit||0),c=l<0,d=e.rider_id||e.userid,o=d?Ma.find((e=>String(e.id)===String(d))):null,u=(()=>{if(!o)return null;const e=[...o.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)}));return e?e.orderid:null})(),m=u&&e.orderid===u,p=d?Za(d,e):null;return(0,C.jsxs)("div",{className:"zone-order-card ".concat(i?"clickable":""," ").concat(r?"active":""," ").concat(m?"going-on":""),role:i?"button":void 0,tabIndex:i?0:void 0,onClick:i?()=>De(r?null:{orderid:e.orderid,lat:a,lon:t}):void 0,children:[(0,C.jsxs)("div",{className:"zone-order-card-head",children:[(0,C.jsx)("div",{className:"zone-order-num",children:e.step||s+1}),(0,C.jsxs)("div",{className:"zone-order-id-block",children:[(0,C.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]}),(0,C.jsxs)("div",{className:"zone-order-rider",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.aVM,{})}),e.rider_name||e.ridername||"Unassigned"]})]}),(()=>{const s=se(e.deliverytime),a=se(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==p;return e.orderstatus||s||a||t?(0,C.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,C.jsx)("span",{className:"zone-order-status",style:{background:n.bg,color:n.fg},children:n.label}),(s||a)&&(0,C.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,C.jsx)(S.VP9,{}),s||a]}),t&&(0,C.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,C.jsx)(S.HPi,{}),Xa(p)]})]}):null})()]}),(0,C.jsxs)("div",{className:"zone-order-customer",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,C.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,C.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gwi,{})}),e.deliverysuburb||q(e.deliveryaddress)]}),e.ordernotes&&(0,C.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.dKO,{})}),e.ordernotes]}),(0,C.jsxs)("div",{className:"zone-order-stats",children:[(0,C.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,C.jsxs)("span",{className:"zone-order-chip ".concat(c?"is-loss":"is-profit"),title:"Profit",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.ohY,{})}),c?"-":"","\u20b9",Math.abs(l).toFixed(0)]}),null!=e.deliverycharge&&(0,C.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,C.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,C.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||"-"," \xb7 S",e.step||s+1]})]})]},e.orderid)}))})]})]})]}):Ae?(0,C.jsxs)("div",{id:"route-detail",children:[(0,C.jsx)("button",{className:"rd-back",onClick:()=>Pe(null),children:"\u2190 Back to zones"}),(0,C.jsx)("div",{className:"rd-rider-name",style:{color:"#3b82f6"},children:Ae.name}),(0,C.jsx)("div",{className:"rd-rider-sub",children:(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gsJ,{})}),Ae.totalOrders," ",1===Ae.totalOrders?"order":"orders"]})}),(0,C.jsxs)("div",{className:"zone-detail-section",children:[(0,C.jsxs)("div",{className:"zone-section-label",children:["Orders ",(0,C.jsxs)("span",{className:"section-count",children:["(",Ae.orders.length,")"]})]}),0===Ae.orders.length?(0,C.jsx)("div",{className:"zone-suburb-panel-empty",children:"No orders in this zone."}):(0,C.jsx)("div",{className:"zone-order-grid",children:Ae.orders.map(((e,s)=>{const a=parseFloat(e.droplat||e.deliverylat),t=parseFloat(e.droplon||e.deliverylong),i=Number.isFinite(a)&&Number.isFinite(t),r=Ee&&Ee.orderid===e.orderid,n=(0,w.Cx)(e.orderstatus),l=parseFloat(e.profit||0),c=l<0,d=e.rider_id||e.userid,o=d?Ma.find((e=>String(e.id)===String(d))):null,u=(()=>{if(!o)return null;const e=[...o.orders].sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)}));return e?e.orderid:null})(),m=u&&e.orderid===u,p=d?Za(d,e):null;return(0,C.jsxs)("div",{className:"zone-order-card ".concat(i?"clickable":""," ").concat(r?"active":""," ").concat(m?"going-on":""),role:i?"button":void 0,tabIndex:i?0:void 0,onClick:i?()=>De(r?null:{orderid:e.orderid,lat:a,lon:t}):void 0,children:[(0,C.jsxs)("div",{className:"zone-order-card-head",children:[(0,C.jsx)("div",{className:"zone-order-num",children:e.step||s+1}),(0,C.jsxs)("div",{className:"zone-order-id-block",children:[(0,C.jsxs)("div",{className:"zone-order-id",children:["Order #",e.orderid]}),(0,C.jsxs)("div",{className:"zone-order-rider",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.aVM,{})}),e.rider_name||e.ridername||"Unassigned"]})]}),(()=>{const s=se(e.deliverytime),a=se(e.expecteddeliverytime),t=!w.Ys.has(String(e.orderstatus||"").toLowerCase())&&null!==p;return e.orderstatus||s||a||t?(0,C.jsxs)("div",{className:"zone-order-status-stack",children:[e.orderstatus&&(0,C.jsx)("span",{className:"zone-order-status",style:{background:n.bg,color:n.fg},children:n.label}),(s||a)&&(0,C.jsxs)("span",{className:"zone-order-time ".concat(s?"":"is-expected"),title:s?"Delivered at ".concat(s):"Expected at ".concat(a),children:[(0,C.jsx)(S.VP9,{}),s||a]}),t&&(0,C.jsxs)("span",{className:"zone-order-est-drop",title:"Estimated distance to drop location",children:[(0,C.jsx)(S.HPi,{}),Xa(p)]})]}):null})()]}),(0,C.jsxs)("div",{className:"zone-order-customer",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.u9F,{})}),e.deliverycustomer||"\u2014"]}),e.pickupcustomer&&(0,C.jsxs)("div",{className:"zone-order-line",title:"Kitchen: ".concat(e.pickupcustomer),children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.NtI,{})}),e.pickupcustomer]}),(e.deliverysuburb||e.deliveryaddress)&&(0,C.jsxs)("div",{className:"zone-order-line",title:e.deliveryaddress||e.deliverysuburb,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.gwi,{})}),e.deliverysuburb||q(e.deliveryaddress)]}),e.ordernotes&&(0,C.jsxs)("div",{className:"zone-order-line zone-order-notes",title:e.ordernotes,children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.dKO,{})}),e.ordernotes]}),(0,C.jsxs)("div",{className:"zone-order-stats",children:[(0,C.jsxs)("span",{className:"zone-order-chip",title:"Distance",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),e.actualkms||e.kms||0," km"]}),(0,C.jsxs)("span",{className:"zone-order-chip ".concat(c?"is-loss":"is-profit"),title:"Profit",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.ohY,{})}),c?"-":"","\u20b9",Math.abs(l).toFixed(0)]}),null!=e.deliverycharge&&(0,C.jsxs)("span",{className:"zone-order-chip",title:"Delivery charge",children:["\u20b9",parseFloat(e.deliverycharge).toFixed(0)," chg"]}),e.ordertype&&(0,C.jsx)("span",{className:"zone-order-chip zone-order-type type-".concat(String(e.ordertype).toLowerCase()),children:e.ordertype}),(0,C.jsxs)("span",{className:"zone-order-chip zone-order-trip",children:["T",e.trip_number||"-"," \xb7 S",e.step||s+1]})]})]},e.orderid)}))})]})]}):(0,C.jsxs)("div",{id:"riders-panel",children:[(0,C.jsx)("div",{className:"ph",children:"zones"===M?"Zone dispatch":"kitchens"===M?"Kitchen dispatch":"Rider dispatch"}),(0,C.jsx)("div",{id:"rider-cards",children:0!==za.length||ja?"zones"===M?Fa.map(((e,s)=>{const a=e.statusCounts.delivered||0,t=e.totalProfit<0;return(0,C.jsxs)("div",{className:"rcard zone-card",onClick:()=>Pe(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,C.jsxs)("div",{className:"zone-card-header",children:[(0,C.jsx)("div",{className:"zone-card-emoji",children:(0,C.jsx)(S.Cd7,{})}),(0,C.jsxs)("div",{className:"zone-card-titles",children:[(0,C.jsx)("div",{className:"zone-card-name",children:e.name}),(0,C.jsxs)("div",{className:"zone-card-sub",children:[e.activeRidersCount," ",1===e.activeRidersCount?"rider":"riders"," \xb7 ",e.totalOrders," ",1===e.totalOrders?"order":"orders"]})]}),(0,C.jsx)("span",{className:"zone-card-arrow","aria-hidden":"true",children:"\u2192"})]}),e.totalOrders>0&&(0,C.jsxs)("div",{className:"zone-progress-row",children:[(0,C.jsx)("div",{className:"zone-status-bar",title:Object.entries(e.statusCounts).map((e=>{let[s,a]=e;return"".concat((0,w.Cx)(s).label,": ").concat(a)})).join(" \xb7 "),children:Object.entries(e.statusCounts).map((s=>{let[a,t]=s;const i=(0,w.Cx)(a),r=t/e.totalOrders*100;return(0,C.jsx)("div",{className:"zone-status-seg",style:{width:"".concat(r,"%"),background:i.bg}},a)}))}),(0,C.jsxs)("div",{className:"zone-progress-label",children:[a,"/",e.totalOrders]})]}),(0,C.jsxs)("div",{className:"zone-stat-pills",children:[(0,C.jsxs)("span",{className:"zone-stat-pill",title:"Areas covered",children:[(0,C.jsx)("span",{className:"zone-stat-icon",children:(0,C.jsx)(S.gwi,{})}),(0,C.jsx)("span",{className:"zone-stat-value",children:e.suburbs.length}),(0,C.jsx)("span",{className:"zone-stat-label",children:1===e.suburbs.length?"area":"areas"})]}),(0,C.jsxs)("span",{className:"zone-stat-pill",title:"Total distance",children:[(0,C.jsx)("span",{className:"zone-stat-icon",children:(0,C.jsx)(S.xI$,{})}),(0,C.jsx)("span",{className:"zone-stat-value",children:e.totalKms.toFixed(1)}),(0,C.jsx)("span",{className:"zone-stat-label",children:"km"})]}),(0,C.jsxs)("span",{className:"zone-stat-pill",title:"Kitchens",children:[(0,C.jsx)("span",{className:"zone-stat-icon",children:(0,C.jsx)(S.NtI,{})}),(0,C.jsx)("span",{className:"zone-stat-value",children:e.kitchens.length}),(0,C.jsx)("span",{className:"zone-stat-label",children:1===e.kitchens.length?"kitchen":"kitchens"})]}),(0,C.jsxs)("span",{className:"zone-stat-pill ".concat(t?"profit-negative":"profit-positive"),title:"Total profit",children:[(0,C.jsx)("span",{className:"zone-stat-icon",children:(0,C.jsx)(S.ohY,{})}),(0,C.jsx)("span",{className:"zone-stat-value",children:t?"-\u20b9".concat(Math.abs(e.totalProfit).toFixed(0)):"\u20b9".concat(e.totalProfit.toFixed(0))})]})]}),e.suburbs.length>0&&(0,C.jsxs)("div",{className:"zone-card-suburbs",children:[(0,C.jsx)("span",{className:"zone-card-suburbs-text",children:e.suburbs.slice(0,3).map((e=>e.name)).join(" \xb7 ")}),e.suburbs.length>3&&(0,C.jsxs)("span",{className:"zone-card-suburbs-more",children:["+",e.suburbs.length-3]})]})]},e.id)})):"kitchens"===M?Ca.map(((e,s)=>(0,C.jsxs)("div",{className:"rcard",onClick:()=>ze(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,C.jsxs)("div",{className:"rcard-top",children:[(0,C.jsx)("div",{className:"rcard-emo",style:{background:"#f59e0b18",borderColor:"#f59e0b50",color:"#f59e0b"},children:(0,C.jsx)(S.NtI,{})}),(0,C.jsxs)("div",{className:"rcard-info",children:[(0,C.jsx)("div",{className:"rcard-name",children:e.kitchenName}),(0,C.jsxs)("div",{className:"rcard-zone",children:[e.riders.size," riders \xb7 ",(0,C.jsx)(ce,{children:(0,C.jsx)(S.ohY,{})}),"\u20b9",e.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0).toFixed(0)]})]}),(0,C.jsx)("div",{className:"rcard-badge",style:{background:"#f59e0b18",color:"#f59e0b"},children:e.orders.length})]}),(0,C.jsx)("div",{className:"bar-bg",children:(0,C.jsx)("div",{className:"bar-fg",style:{width:"".concat(Math.min(100,e.orders.length/20*100),"%"),background:"#f59e0b"}})}),(0,C.jsxs)("div",{className:"rcard-meta",children:[(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),e.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]}),(0,C.jsxs)("span",{children:[e.riders.size," riders"]})]}),(0,C.jsx)("div",{className:"step-ids",children:Array.from(e.riders).slice(0,10).map((e=>{var s;return(0,C.jsx)("span",{className:"step-id",style:{color:$a(e)},children:null===(s=Ma.find((s=>s.id===e)))||void 0===s?void 0:s.riderName.split(" ")[0]},e)}))})]},e.id))):Ma.map(((e,s)=>{var a;const t=e.orders.length,i=e.orders.filter((e=>w.Ys.has(String(e.orderstatus||"").toLowerCase()))).length,r=t>0&&i>=t,n=e.orders.find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),l=n?Za(e.id,n):null;return(0,C.jsxs)("div",{className:"rcard",onClick:()=>Ea(e),style:{animationDelay:"".concat(.05*s,"s")},children:[(0,C.jsxs)("div",{className:"rcard-top",children:[(0,C.jsx)("div",{className:"rcard-emo",style:{background:"".concat(e.color,"18"),borderColor:"".concat(e.color,"50"),color:e.color},children:(0,C.jsx)(S.aVM,{})}),(0,C.jsxs)("div",{className:"rcard-info",children:[(0,C.jsx)("div",{className:"rcard-name",children:e.riderName}),(0,C.jsxs)("div",{className:"rcard-zone",children:[(null===(a=e.orders[0])||void 0===a?void 0:a.zone_name)||bs||"Local"," \xb7 ",new Set(e.orders.map((e=>e.trip_number||1))).size," trips"]})]}),(0,C.jsxs)("div",{className:"rcard-badge ".concat(r?"is-done":""),style:r?void 0:{background:"".concat(e.color,"18"),color:e.color},title:"".concat(i," delivered of ").concat(t," total"),children:[i,"/",t]})]}),(0,C.jsx)("div",{className:"bar-bg",children:(0,C.jsx)("div",{className:"bar-fg",style:{width:"".concat(Math.min(100,t/15*100),"%"),background:e.color}})}),(0,C.jsxs)("div",{className:"rcard-meta",children:[(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.xI$,{})}),e.orders.reduce(((e,s)=>e+parseFloat(s.actualkms||s.kms||0)),0).toFixed(1)," km"]}),null!==l&&(0,C.jsxs)("span",{className:"rcard-est-meters",title:"Estimated distance to next drop location",children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.HPi,{})}),Xa(l)," to drop"]}),(0,C.jsxs)("span",{children:[(0,C.jsx)(ce,{children:(0,C.jsx)(S.ohY,{})}),"\u20b9",e.orders.reduce(((e,s)=>e+parseFloat(s.profit||0)),0).toFixed(0)]})]}),(0,C.jsx)("div",{className:"step-ids",children:e.orders.slice(0,15).map((e=>(0,C.jsxs)("span",{className:"step-id",children:["S",e.step]},e.orderid)))})]},e.id)})):(e=>{const s=null===(e=ns.find((e=>e.id===ua)))||void 0===e?void 0:e.label,a=ha&&ya.length>0;return(0,C.jsxs)("div",{className:"empty-slot",children:[(0,C.jsx)("div",{className:"empty-slot-icon",children:(0,C.jsx)(S.gsJ,{})}),(0,C.jsx)("div",{className:"empty-slot-title",children:s?"No orders in ".concat(s):"No orders"}),(0,C.jsx)("div",{className:"empty-slot-sub",children:a?"".concat(ya.length," order").concat(1===ya.length?"":"s"," exist in other slots today"):"No deliveries found for this date"})]})})()})]})]}),(0,C.jsxs)("div",{id:"map-wrap",className:"".concat("kitchens"===M?"view-mode-kitchens":""," ").concat(Ys?"compare-split":"").trim(),children:[(0,C.jsxs)(d.W,{center:[11.022,76.982],zoom:12,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},zoomControl:!1,renderer:ca.current,inertia:!0,inertiaDeceleration:2400,inertiaMaxSpeed:2e3,wheelDebounceTime:20,wheelPxPerZoomLevel:80,zoomSnap:.25,children:[(0,C.jsx)(o.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),(0,C.jsx)(p.p,{position:"bottomright"}),Ys&&(0,C.jsx)(Z,{targetRef:la}),(0,C.jsx)(le,{focusedItem:Ba||(Pa||Ce)&&Ee||Pa||Ce||Ae,viewMode:M,orders:za,kitchens:Ca,locationKey:Je}),Ca.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lon))).filter((e=>!Pa||e.riders.has(Pa.id))).map(((e,s)=>(0,C.jsx)(l.p,{position:[e.lat,e.lon],icon:Wa(e.kitchenName,(null===Ce||void 0===Ce?void 0:Ce.id)===e.id),zIndexOffset:(null===Ce||void 0===Ce?void 0:Ce.id)===e.id?4e3:2e3,eventHandlers:{click:()=>ze(e),mouseover:e=>e.target.openPopup(),mouseout:e=>e.target.closePopup()},children:(0,C.jsxs)(m.z,{className:"kitchen-popup",maxWidth:220,minWidth:200,autoPan:!0,autoPanPadding:[20,20],children:[(0,C.jsx)("div",{className:"kp-header",children:"KITCHEN"}),(0,C.jsx)("div",{className:"kp-name",children:e.kitchenName}),(0,C.jsxs)("div",{className:"kp-stat",children:[(0,C.jsx)("span",{className:"kp-stat-lbl",children:"Orders"}),(0,C.jsx)("span",{className:"kp-stat-val",children:e.orders.length})]})]})},"k-".concat(s)))),(()=>{if(Ys&&Pa&&"actual"===Ks)return null;let e=za;Ae&&(e=Ae.orders),Ce&&(e=Ce.orders),Pa&&(e=Pa.orders),e=e.filter(I);const s=Ys&&Pa?new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))):null;return e.map(((a,t)=>{const i=a.rider_id,r=!i||_e.has(i);let n,c=$a(i);if(s&&i===Pa.id&&null!=a.deliveryid){const e=s.get(String(a.deliveryid));e&&(c=(0,w.gM)(e-1),n=e)}const d=!!Pa||!!Ce,o=(0,w.Cx)(a.orderstatus),u="delivered"===String(a.orderstatus||"").toLowerCase(),m=v&&String(v)===String(a.orderid),p=a.orderstatus?'\n \n \n ').concat(u?'':"","\n "):"",h=d?(()=>{const s=n||a.step||e.indexOf(a)+1,t=32;return x().divIcon({className:"",iconSize:[t,t],iconAnchor:[16,16],popupAnchor:[0,-28],html:'
9?12:14,"px;opacity:").concat(r?1:.75,'">').concat(s>0?s:"").concat(p,"
")})})():x().divIcon({className:"",iconSize:[24,30],iconAnchor:[2,30],popupAnchor:[10,-25],html:'
').concat(p,"
")});return(0,C.jsx)(l.p,{position:[parseFloat(a.droplat||a.deliverylat),parseFloat(a.droplon||a.deliverylong)],icon:h,zIndexOffset:i?100:0,ref:e=>{e?Ie.current[String(a.orderid)]=e:delete Ie.current[String(a.orderid)]},eventHandlers:{click:()=>{const e=String(a.orderid);Oe.current.has(e)?(Oe.current.delete(e),Ye(null)):(Oe.current.add(e),Ye(a))}}},"".concat(a.orderid,"-").concat(d?"num":"flag"))}))})(),(()=>{const e=Ys&&Pa&&"actual"===Ks;if(Ms)return e?[]:zs.map(((e,s)=>(0,C.jsx)(c.R,{positions:[e.from,e.to],pathOptions:{color:e.color,weight:6,opacity:.9,lineJoin:"round",lineCap:"round"}},s)));const s=[],a=Ae?new Set(Ae.riders.map((e=>String(e.rider_id)))):null;return e||Ma.forEach((e=>{const t=_e.has(e.id);if(Pa&&Pa.id!==e.id)return;if(Ce&&!Ce.riders.has(e.id))return;if(a&&!a.has(String(e.id)))return;const i=e.orders,n={};i.forEach((e=>{const s=e.trip_number||1;n[s]||(n[s]=[]),n[s].push(e)})),Object.entries(n).forEach((a=>{let[i,n]=a;const l=Ce?n.filter((e=>(e.pickupcustomer||e.kitchen_key||"Unknown").toLowerCase().trim()===Ce.id)):n;if(0===l.length)return;const d=[...n].sort(((e,s)=>(e.step||0)-(s.step||0))),o=te(d),u=ie(e.id,i,o),m=ys[u],p=[...l].sort(((e,s)=>(e.step||0)-(s.step||0))),h=Array.isArray(m)&&m.length>=2,x=!1===m;if(!h&&!x)return;const v=h?m:te(p);if(!v||v.length<2)return;const j=t?1:.1,g="kitchens"===M||Ce?7:6,f=Ys&&Pa&&e.id===Pa.id,N=x?"8 6":f&&"combined"===Ks?"6 5":void 0;if(Ys&&Pa&&e.id===Pa.id){const a=new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))),t=p.filter(I),r=t.map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)]));let n;if(h)n=ee(v,r);else{const e=v.length>r.length;n=[];for(let s=0;s=v.length||t>=v.length?n.push([]):n.push([v[a],v[t]])}}const l="combined"===Ks?5:0;return s.push((0,C.jsx)(c.R,{positions:v,pathOptions:{color:"#ffffff",weight:g+4,opacity:.5*j,lineJoin:"round",lineCap:"round",offset:l}},"".concat(e.id,"-").concat(i,"-halo"))),void n.forEach(((r,n)=>{if(!r||r.length<2)return;const d=t[n],o=d?a.get(String(d.deliveryid)):null,u="combined"===Ks?E:o?(0,w.gM)(o-1):e.color,m=null!=ra&&ra===o,p=m?g+1.5:g,h=m?1:ra?.5*j:j;s.push((0,C.jsx)(c.R,{positions:r,pathOptions:{color:u,weight:p,opacity:h,lineJoin:"round",lineCap:"round",dashArray:N,offset:l}},"".concat(e.id,"-").concat(i,"-step-").concat(n,"-").concat((null===d||void 0===d?void 0:d.deliveryid)||n)))}))}s.push((0,C.jsxs)(r.Fragment,{children:[(0,C.jsx)(c.R,{positions:v,pathOptions:{color:"#ffffff",weight:g+4,opacity:.5*j,lineJoin:"round",lineCap:"round"}}),(0,C.jsx)(c.R,{positions:v,pathOptions:{color:e.color,weight:g,opacity:j,lineJoin:"round",lineCap:"round",dashArray:N}})]},"".concat(e.id,"-").concat(i)))}))})),s})(),oa.filter((e=>Ma.some((s=>String(s.id)===String(e.id))))).filter((e=>!Pa||String(Pa.id)===String(e.id))).map((e=>{var s;const a="active"===e.status?"#16a34a":"#dc2626",t=Ma.find((s=>String(s.id)===String(e.id))),i=null===t||void 0===t||null===(s=t.orders)||void 0===s?void 0:s.slice().sort(((e,s)=>{const a=e.trip_number||1,t=s.trip_number||1;return a!==t?a-t:(e.step||0)-(s.step||0)})).find((e=>{const s=String(e.orderstatus||"").toLowerCase();return!w.Ys.has(s)&&!w.yP.has(s)})),r=i?i.deliverysuburb||q(i.deliveryaddress):null,n=x().divIcon({className:"",iconSize:[140,56],iconAnchor:[12,41],popupAnchor:[58,-40],html:'
\n
\n
').concat((e.username||"").replace(/[<>&"']/g,"")).concat(e.orderid?" #".concat(String(e.orderid).replace(/[<>&"']/g,""),""):"","
\n
")});return(0,C.jsx)(l.p,{position:[e.lat,e.lon],icon:n,zIndexOffset:2500,eventHandlers:{click:s=>{const a=String(e.id);Re.current.has(a)?(Re.current.delete(a),s.target.closePopup()):(Re.current.add(a),s.target.openPopup());const t=Ma.find((e=>String(e.id)===a));t&&Ea(t)},popupclose:()=>{Re.current.delete(String(e.id))}},children:(0,C.jsxs)(m.z,{maxWidth:260,autoPan:!0,autoPanPadding:[20,20],className:"dispatch-popup live-rider-popup",children:[(0,C.jsx)("div",{className:"pu-hdr-live",children:(0,C.jsxs)("div",{className:"pu-hdr-left",children:[(0,C.jsx)("span",{className:"pu-live-indicator",style:{"--pulse-color":a},children:(0,C.jsx)("span",{className:"pu-live-dot"})}),(0,C.jsx)("span",{className:"pu-hdr-title",children:"LIVE GPS"})]})}),(0,C.jsxs)("div",{className:"pu-rider-profile",children:[(0,C.jsx)("div",{className:"pu-avatar",style:{backgroundColor:"".concat(a,"12"),color:a},children:(0,C.jsx)(S.bsz,{})}),(0,C.jsxs)("div",{className:"pu-rider-info-text",children:[(0,C.jsxs)("div",{className:"pu-rider-name-row",children:[(0,C.jsx)("span",{className:"pu-rider-name",children:e.username||"Rider #".concat(e.id)}),e.status&&(0,C.jsx)("span",{className:"pu-status-badge ".concat("active"===e.status.toLowerCase()?"active":"idle"),children:e.status})]}),(0,C.jsxs)("div",{className:"pu-rider-meta",children:["Rider ID: #",e.id]})]})]}),(0,C.jsxs)("div",{className:"pu-body-content",children:[e.orderid&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Active Order"}),(0,C.jsxs)("span",{className:"pu-info-value pu-order-badge",children:["#",e.orderid]})]}),i&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Next Stop"}),(0,C.jsxs)("span",{className:"pu-info-value",style:{color:"#4f46e5"},children:["#",i.step||"?"," \xb7 ",i.deliverycustomer||"\u2014"]})]}),r&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Next Location"}),(0,C.jsx)("span",{className:"pu-info-value",title:i.deliveryaddress||r,children:r})]}),(null===i||void 0===i?void 0:i.pickupcustomer)&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Pickup"}),(0,C.jsx)("span",{className:"pu-info-value",title:i.pickupcustomer,children:i.pickupcustomer})]}),e.contactno&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Phone"}),(0,C.jsx)("a",{href:"tel:".concat(e.contactno),className:"pu-info-value pu-phone-link",children:e.contactno})]}),e.logdate&&(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Last Seen"}),(0,C.jsxs)("span",{className:"pu-info-value pu-time-stamp",children:[(0,C.jsx)(S.VP9,{className:"inline-icon"})," ",g()(e.logdate).isValid()?g()(e.logdate).format("hh:mm:ss A"):e.logdate]})]}),(0,C.jsxs)("div",{className:"pu-info-row",children:[(0,C.jsx)("span",{className:"pu-info-label",children:"Position"}),(0,C.jsxs)("span",{className:"pu-info-value pu-coordinates",children:[e.lat.toFixed(5),", ",e.lon.toFixed(5)]})]})]})]})},"live-".concat(e.id))})),Ys&&Pa&&"planned"!==Ks&&Ta.map(((e,s)=>{var a,t;if(0===e.coords.length)return null;const i=(0,w.gM)(s),n="combined"===Ks?D:i,d=[e.coords[0].lat,e.coords[0].lng],o=[e.coords[e.coords.length-1].lat,e.coords[e.coords.length-1].lng],m=_s[e.deliveryid],p=Array.isArray(m)&&m.length>=2?m:e.coords.map((e=>[e.lat,e.lng]));let h=p,v=!0;if(Ms){const s=Ps[e.sequenceStep]||0;s<2?v=!1:h=p.slice(0,Math.min(s,p.length))}const j=ra===e.sequenceStep,f=String(e.orderstatus||"").toLowerCase(),N=w.Ys.has(f),b=w.yP.has(f),y=Ha.find((s=>s.sequenceStep===e.sequenceStep)),k=!(null===y||void 0===y||!y.anomaly),_=null===Pa||void 0===Pa||null===(a=Pa.orders)||void 0===a?void 0:a.find((s=>null!=s.deliveryid&&String(s.deliveryid)===String(e.deliveryid))),F=(0,w.Cx)(e.orderstatus),M=(e.orderstatus&&'\n \n \n ').concat(N?'':"","\n "),["compare-step-pin"]);j&&M.push("is-focused"),N&&M.push("is-delivered"),b&&M.push("is-skipped"),k&&M.push("is-anomaly");const z='
')+''.concat(e.sequenceStep,"")+(N?'':"")+"
",A=x().divIcon({className:"",iconSize:[36,36],iconAnchor:[18,18],popupAnchor:[0,-22],html:z}),P=1===e.sequenceStep,E=P?x().divIcon({className:"",iconSize:[40,40],iconAnchor:[20,20],html:'
')+'
'}):null,L="combined"===Ks?-5:0;return(0,C.jsxs)(r.Fragment,{children:[v&&(0,C.jsx)(c.R,{positions:h,pathOptions:{color:"#ffffff",weight:j?11:9,opacity:j?.75:.55,lineJoin:"round",lineCap:"round",offset:L}}),v&&(0,C.jsx)(c.R,{positions:h,pathOptions:{color:n,weight:j?6.5:5,opacity:j?1:ra?.55:.95,lineJoin:"round",lineCap:"round",offset:L}}),P&&(0,C.jsx)(l.p,{position:d,icon:E,zIndexOffset:j?900:100,eventHandlers:{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep))}},children:(0,C.jsx)(u.m,{direction:"top",offset:[0,-12],opacity:1,className:"compare-tooltip",children:(0,C.jsxs)("div",{className:"cmp-tip",children:[(0,C.jsxs)("div",{className:"cmp-tip-header",children:[(0,C.jsx)("span",{className:"cmp-tip-step",style:{background:i},children:(0,C.jsx)(S.zPd,{})}),(0,C.jsxs)("div",{className:"cmp-tip-title-stack",children:[(0,C.jsx)("div",{className:"cmp-tip-title",children:e.pickupcustomer||"Pickup"}),(0,C.jsx)("div",{className:"cmp-tip-sub",children:null!==(t=e.coords[0])&&void 0!==t&&t.logdate?"Picked up \xb7 ".concat(g()(e.coords[0].logdate).format("hh:mm A")):"Rider trip origin"})]})]}),(0,C.jsx)("div",{className:"cmp-tip-action",children:"Click for step 1 details"})]})})}),(0,C.jsx)(l.p,{position:o,icon:A,zIndexOffset:j?1e3:200,eventHandlers:_?{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep)),Te.current&&(clearTimeout(Te.current),Te.current=null);const a=String(_.orderid);Oe.current.has(a)?(Oe.current.delete(a),Ye(null)):(Oe.current.add(a),Ye(_))}}:{click:s=>{s.originalEvent&&s.originalEvent.stopPropagation(),na((s=>s===e.sequenceStep?null:e.sequenceStep)),_&&s.target&&"function"===typeof s.target.openPopup&&s.target.openPopup()}},children:!_&&(0,C.jsx)(u.m,{direction:"top",offset:[0,-20],opacity:1,className:"compare-tooltip",children:(()=>{const s=(0,w.Cx)(e.orderstatus);return(0,C.jsxs)("div",{className:"cmp-tip",children:[(0,C.jsxs)("div",{className:"cmp-tip-header",children:[(0,C.jsx)("span",{className:"cmp-tip-step",style:{background:i},children:e.sequenceStep}),(0,C.jsxs)("div",{className:"cmp-tip-title-stack",children:[(0,C.jsx)("div",{className:"cmp-tip-title",children:e.deliverycustomer||"Step ".concat(e.sequenceStep)}),(0,C.jsx)("div",{className:"cmp-tip-sub",children:e.deliverytime?"Delivered ".concat(g()(e.deliverytime).format("hh:mm A")):"".concat(e.coords.length," GPS pings")})]}),e.orderstatus&&(0,C.jsx)("span",{className:"cmp-tip-tag",style:{background:s.bg,color:s.fg},children:s.label})]}),k&&(0,C.jsx)("div",{className:"cmp-tip-anomaly",children:"Deviation flagged \u2014 see details below"}),(0,C.jsx)("div",{className:"cmp-tip-action",children:j?"Click to deselect":"Click for details"})]})})()})})]},"actual-".concat(e.deliveryid))}))]}),Ys&&Pa&&(0,C.jsxs)("div",{className:"compare-view-switcher",role:"group","aria-label":"Compare view layer",children:[(0,C.jsx)("button",{type:"button",className:"actual"===Ks?"is-active":"",onClick:()=>Bs("actual"),title:"Show only the rider's actual GPS trail",children:"Actual"}),(0,C.jsx)("button",{type:"button",className:"planned"===Ks?"is-active":"",onClick:()=>Bs("planned"),title:"Show only the dispatched planned route",children:"Planned"}),(0,C.jsx)("button",{type:"button",className:"combined"===Ks?"is-active":"",onClick:()=>Bs("combined"),title:"Overlay planned (dashed) and actual (solid) on one map",children:"Combined"})]}),(0,C.jsx)("div",{id:"ov-tl"}),(0,C.jsxs)("div",{id:"ov-br",children:[(0,C.jsxs)("button",{className:"sbt ".concat(Ms?"active":""),onClick:()=>{if(Ms)return Cs(!1),As([]),void Es({});Cs(!0),As([]),Es({});const e=Ys&&Pa,s=e?new Map(Ta.map((e=>[String(e.deliveryid),e.sequenceStep]))):null,a=[];if(Ma.forEach((t=>{if(!_e.has(t.id))return;if(Pa&&Pa.id!==t.id)return;if(Ce&&!Ce.riders.has(t.id))return;const i={};t.orders.forEach((e=>{const s=e.trip_number||1;i[s]||(i[s]=[]),i[s].push(e)})),Object.entries(i).forEach((i=>{let[r,n]=i;const l=Ce?n.filter((e=>(e.pickupcustomer||e.kitchen_key||"Unknown").toLowerCase().trim()===Ce.id)):n;if(0===l.length)return;const c=[...n].sort(((e,s)=>(e.step||0)-(s.step||0))),d=te(c),o=ie(t.id,r,d),u=ys[o],m=[...l].sort(((e,s)=>(e.step||0)-(s.step||0))),p=te(m),h="kitchens"===M||Ce,x=u||p;if(x.length<2)return;let v=()=>t.color;if(e&&t.id===Pa.id){const e=m.filter(I).map((e=>[parseFloat(e.droplat||e.deliverylat),parseFloat(e.droplon||e.deliverylong)])),a=u?ee(u,e):(()=>{const s=p.length>e.length,a=[];for(let t=0;t=p.length||i>=p.length?a.push([]):a.push([p[e],p[i]])}return a})(),i=[];let r=0;a.forEach(((e,s)=>{const a=Math.max(0,((null===e||void 0===e?void 0:e.length)||0)-1);for(let t=0;t{const a=i[e];if(null==a)return t.color;const r=m.filter(I)[a],n=r?s.get(String(r.deliveryid)):null;return n?(0,w.gM)(n-1):t.color}}for(let e=0;ee.delay-s.delay)),a.forEach(((e,s)=>{setTimeout((()=>{As((s=>[...s,e])),s===a.length-1&&setTimeout((()=>{Cs(!1),Es({})}),1e3)}),e.delay)})),e&&Ta.length>0){const e=[...Ta],s=e.map((e=>{const s=_s[e.deliveryid];return Array.isArray(s)&&s.length>=2?s:e.coords.map((e=>[e.lat,e.lng]))})),t=a.length>0?a[a.length-1].delay:800*e.length,i=Math.max(t,600*e.length),r=i/Math.max(1,e.length),n=Date.now(),l=()=>{if(!Ds.current)return;const a=Date.now()-n,t={};e.forEach(((e,i)=>{const n=s[i];if(!n||n.length<2)return;const l=i*r;if(a>=l+r)t[e.sequenceStep]=n.length;else if(a>=l){const s=(a-l)/r;t[e.sequenceStep]=Math.max(2,Math.ceil(s*n.length))}})),Es(t),a{if(Ys)Vs(!1);else{if(!Pa){const e=Ma.find((e=>(e.orders||[]).some((e=>null!=e.deliveryid&&""!==e.deliveryid&&0!==e.deliveryid)))),s=Ma.find((e=>e.orders&&e.orders.length>0)),a=e||s;if(a&&(Ea(a),Ve))return void(Xs.current=!0)}Vs(!0)}},title:Pa?"Compare planned vs. actual route for ".concat(Pa.riderName):"Compare planned vs. actual route (will focus the first rider)",style:{boxShadow:"var(--shadow-lg)",background:Ys?"linear-gradient(135deg, #6366f1, #3b82f6)":"#fff",marginLeft:8,color:Ys?"#fff":void 0},children:[(0,C.jsx)("span",{className:"sbt-icon",children:(0,C.jsx)(S.$G1,{})}),Ys?"Exit Compare":"Compare"]})]})]}),Ys&&Pa&&(0,C.jsx)("div",{id:"compare-map-wrap",children:(()=>{const e=Ta.length,s=Ta.filter((e=>e.coords.length>0)).length,a=Ta.filter((e=>e.isLoading)).length,t=e>0?Math.round(s/e*100):0,i=e>0&&s===e&&0===a,n=null!=ra?Ha.find((e=>e.sequenceStep===ra)):null;return(0,C.jsxs)("div",{className:"compare-header-v2",children:[(0,C.jsxs)("div",{className:"compare-header-row",children:[(0,C.jsxs)("div",{className:"compare-title",children:[(0,C.jsx)("span",{className:"compare-title-dot",style:{background:Pa.color}}),(0,C.jsx)("span",{className:"compare-title-name",children:Pa.riderName}),(0,C.jsx)("span",{className:"compare-title-badge",children:"ACTUAL vs PLANNED"})]}),(0,C.jsxs)("div",{className:"compare-header-tools",children:[null!=ra&&(0,C.jsxs)("button",{type:"button",className:"compare-overall-btn",onClick:()=>na(null),title:"Zoom out to the whole day",children:[(0,C.jsx)(S.Zs6,{})," Overall"]}),(0,C.jsx)("button",{type:"button",className:"compare-timeline-toggle".concat(Js?" is-open":""),onClick:()=>Ws((e=>!e)),title:Js?"Hide planned/actual timeline":"Show planned/actual timeline","aria-expanded":Js,children:(0,C.jsx)(S.j1Q,{})})]})]}),Js&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"compare-timeline-wrap",children:[(0,C.jsxs)("div",{className:"compare-timeline-container",children:[(0,C.jsxs)("div",{className:"compare-timeline-labels",children:[(0,C.jsx)("div",{className:"compare-timeline-label",children:"Planned"}),(0,C.jsx)("div",{className:"compare-timeline-label",children:"Actual"})]}),(0,C.jsxs)("div",{className:"compare-timeline-scrollable",children:[(0,C.jsx)("div",{className:"compare-timeline-track is-planned",children:Va.map(((e,s)=>{var a;const t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),n=w.yP.has(t),l=ra===e.sequenceStep,c=e.isLoading&&0===e.coordsCount,d=!e.isLoading&&0===e.coordsCount,o=(null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep,u=(0,w.gM)(o-1),m=["compare-step",l&&"is-focused",i&&"is-delivered",n&&"is-skipped",!i&&!n&&"is-pending",c&&"is-loading",d&&"is-no-data",e.anomaly&&"is-anomaly"].filter(Boolean).join(" ");return(0,C.jsxs)(r.Fragment,{children:[s>0&&(0,C.jsx)("span",{className:"compare-step-spacer"}),(0,C.jsxs)("button",{type:"button",className:m,style:{"--step-color":u},onClick:()=>na((s=>s===e.sequenceStep?null:e.sequenceStep)),title:"Planned Step ".concat(o)+(e.deliverycustomer?" \xb7 ".concat(e.deliverycustomer):"")+(e.expectedTs?" \xb7 ".concat(e.expectedTs.format("hh:mm A")):"")+(e.anomaly?" \xb7 deviation flagged":""),children:[(0,C.jsx)("span",{className:"compare-step-circle",children:c?(0,C.jsx)("span",{className:"compare-step-spin"}):o}),e.expectedTs&&(0,C.jsx)("span",{className:"compare-step-tick",children:e.expectedTs.format("HH:mm")})]})]},"step-p-".concat(e.deliveryid))}))}),(0,C.jsx)("div",{className:"compare-timeline-track is-actual",children:Ka.map(((e,s)=>{var a;const t=String(e.orderstatus||"").toLowerCase(),i=w.Ys.has(t),n=w.yP.has(t),l=ra===e.sequenceStep,c=e.isLoading&&0===e.coordsCount,d=!e.isLoading&&0===e.coordsCount,o=(null===(a=e.order)||void 0===a?void 0:a.step)||e.sequenceStep,u=(0,w.gM)(o-1),m=["compare-step",l&&"is-focused",i&&"is-delivered",n&&"is-skipped",!i&&!n&&"is-pending",c&&"is-loading",d&&"is-no-data",e.anomaly&&"is-anomaly"].filter(Boolean).join(" ");return(0,C.jsxs)(r.Fragment,{children:[s>0&&(0,C.jsx)("span",{className:"compare-step-spacer"}),(0,C.jsxs)("button",{type:"button",className:m,style:{"--step-color":u},onClick:()=>na((s=>s===e.sequenceStep?null:e.sequenceStep)),title:"Actual Visit ".concat(s+1," (Planned Step ").concat(o,")")+(e.deliverycustomer?" \xb7 ".concat(e.deliverycustomer):"")+(e.actualTs?" \xb7 ".concat(e.actualTs.format("hh:mm A")):"")+(e.anomaly?" \xb7 deviation flagged":""),children:[(0,C.jsx)("span",{className:"compare-step-circle",children:c?(0,C.jsx)("span",{className:"compare-step-spin"}):o}),e.actualTs&&(0,C.jsx)("span",{className:"compare-step-tick",children:e.actualTs.format("HH:mm")}),e.anomaly&&(0,C.jsx)("span",{className:"compare-step-flag",title:"Deviation flagged"})]})]},"step-a-".concat(e.deliveryid))}))})]})]}),(0,C.jsxs)("div",{className:"compare-progress-strip",children:[(0,C.jsx)("div",{className:"compare-progress-bar-wrap",children:(0,C.jsx)("div",{className:"compare-progress-bar-fill".concat(i?" is-done":""),style:{width:"".concat(t,"%")}})}),(0,C.jsx)("span",{className:"compare-progress-text",children:a>0?"Loading GPS\u2026 ".concat(s,"/").concat(e):"".concat(s,"/").concat(e," tracks")})]})]}),(()=>{const e="combined"===Ks,s=n?(0,w.gM)(n.sequenceStep-1):"linear-gradient(90deg, ".concat(w.Z3.slice(0,6).join(", "),")"),a=e?E:s,t=e?D:s;return(0,C.jsxs)("div",{className:"compare-legend",children:[(0,C.jsxs)("span",{className:"compare-legend-item",children:[(0,C.jsx)("span",{className:"compare-legend-swatch is-step-color is-dashed",style:{background:a}}),"Planned (dashed)"]}),(0,C.jsxs)("span",{className:"compare-legend-item",children:[(0,C.jsx)("span",{className:"compare-legend-swatch is-step-color",style:{background:t}}),"Actual GPS (solid)"]}),(0,C.jsx)("span",{className:"compare-legend-note",children:"Kalman-smoothed GPS \xb7 OSRM road-snapped"})]})})()]})]})})()}),Ys&&Pa&&(0,C.jsx)(z,{focusedRider:Pa,compareDeltas:Ha,compareSummary:Ya,actualOrdered:Ka,focusedCompareStep:ra,setFocusedCompareStep:na,sequenceOpen:Us,setSequenceOpen:Gs,expandedSeqGroups:$s,setExpandedSeqGroups:Zs,onClose:()=>Vs(!1)})]}),He&&(0,C.jsx)("div",{className:"dispatch-popup-center",role:"dialog","aria-label":"Order ".concat(He.orderid," details"),onMouseEnter:()=>{Te.current&&(clearTimeout(Te.current),Te.current=null)},onMouseLeave:()=>{(e=>{if(!e)return!1;if(Oe.current.has(String(e.orderid)))return!0;if(Ys&&Pa&&null!=e.deliveryid){const s=Ta.find((s=>String(s.deliveryid)===String(e.deliveryid)));if(s&&ra===s.sequenceStep)return!0}return!1})(He)||(Te.current&&clearTimeout(Te.current),Te.current=setTimeout((()=>{Ye(null),Te.current=null}),200))},children:(0,C.jsxs)("div",{className:"dispatch-popup-card dispatch-popup",children:[(0,C.jsx)("button",{type:"button",className:"dispatch-popup-center-close","aria-label":"Close order details",onClick:()=>{Oe.current.delete(String(He.orderid)),Ye(null)},children:"\xd7"}),(e=>{const s=(0,w.Cx)(e.orderstatus),a=e.rider_id||e.userid,t=w.Ys.has(String(e.orderstatus||"").toLowerCase()),i=t?null:Za(a,e);return(0,C.jsxs)("div",{style:{height:"100%",width:"100%"},children:[(0,C.jsxs)("div",{className:"pu-header",children:[(0,C.jsxs)("div",{className:"pu-header-top",children:[(0,C.jsxs)("div",{className:"pu-id",children:["ORDER #",e.orderid]}),e.orderstatus&&(0,C.jsx)("span",{className:"pu-status-chip",style:{background:s.bg,color:s.fg},children:s.label})]}),(0,C.jsxs)("div",{className:"pu-rider",children:[(0,C.jsx)(S.aVM,{})," ",(0,C.jsx)("span",{children:e.rider_name||e.ridername||"Unassigned"})]}),(e.deliverycustomer||e.customername)&&(0,C.jsxs)("div",{className:"pu-customer",title:e.deliverycustomer||e.customername,children:[(0,C.jsx)(S.u9F,{}),(0,C.jsx)("span",{children:e.deliverycustomer||e.customername})]}),null!=e.deliveryid&&(0,C.jsxs)("div",{className:"pu-delivery-id",children:["Delivery #",e.deliveryid]})]}),(0,C.jsxs)("div",{className:"pu-body",children:[ae.some((s=>e[s.key]))&&(0,C.jsxs)("div",{className:"pu-section",children:[(0,C.jsx)("div",{className:"pu-section-label",children:"Timeline"}),(0,C.jsx)("div",{className:"pu-timeline",children:ae.map((s=>{const a=se(e[s.key]);return a?(0,C.jsxs)("div",{className:"pu-tl-row ".concat(s.final?"delivered":""),children:[(0,C.jsx)("span",{className:"pu-tl-dot"}),(0,C.jsx)("span",{className:"pu-tl-label",children:s.label}),(0,C.jsx)("span",{className:"pu-tl-time",children:a})]},s.key):null}))})]}),(0,C.jsxs)("div",{className:"pu-section",children:[(0,C.jsx)("div",{className:"pu-section-label",children:"Details"}),(0,C.jsxs)("div",{className:"pu-details-grid",children:[(e.pickupcustomer||e.locationname||e.pickuplocation)&&(0,C.jsxs)("div",{className:"pu-detail",children:[(0,C.jsx)("div",{className:"pu-detail-icon",children:(0,C.jsx)(S.NtI,{})}),(0,C.jsxs)("div",{className:"pu-detail-body",children:[(0,C.jsx)("div",{className:"pu-detail-label",children:"Pickup"}),(0,C.jsx)("div",{className:"pu-detail-value",title:e.pickupcustomer||e.locationname||e.pickuplocation,children:e.pickupcustomer||e.locationname||e.pickuplocation})]})]}),(e.deliverysuburb||e.deliveryaddress)&&(0,C.jsxs)("div",{className:"pu-detail",children:[(0,C.jsx)("div",{className:"pu-detail-icon",children:(0,C.jsx)(S.JFD,{})}),(0,C.jsxs)("div",{className:"pu-detail-body",children:[(0,C.jsx)("div",{className:"pu-detail-label",children:"Drop"}),(0,C.jsx)("div",{className:"pu-detail-value",title:e.deliveryaddress||e.deliverysuburb,children:e.deliverysuburb||q(e.deliveryaddress)})]})]}),e.zone_name&&(0,C.jsxs)("div",{className:"pu-detail",children:[(0,C.jsx)("div",{className:"pu-detail-icon",children:(0,C.jsx)(S.Cd7,{})}),(0,C.jsxs)("div",{className:"pu-detail-body",children:[(0,C.jsx)("div",{className:"pu-detail-label",children:"Zone"}),(0,C.jsx)("div",{className:"pu-detail-value",title:e.zone_name,children:e.zone_name})]})]}),(e.rider_id||e.userid)&&(0,C.jsxs)("div",{className:"pu-detail",children:[(0,C.jsx)("div",{className:"pu-detail-icon",children:(0,C.jsx)(S.aVM,{})}),(0,C.jsxs)("div",{className:"pu-detail-body",children:[(0,C.jsx)("div",{className:"pu-detail-label",children:"Rider ID"}),(0,C.jsxs)("div",{className:"pu-detail-value",children:["#",e.rider_id||e.userid]})]})]})]}),(null!=e.kms||null!=e.actualkms||!t&&null!=e.riderkms||null!==i)&&(0,C.jsxs)("div",{className:"pu-distance-row",children:[null!=e.kms&&""!==e.kms&&(0,C.jsxs)("div",{className:"pu-distance-chip",children:[(0,C.jsx)("span",{className:"pu-distance-icon",children:(0,C.jsx)(S.xI$,{})}),(0,C.jsx)("span",{className:"pu-distance-label",children:"Planned"}),(0,C.jsxs)("span",{className:"pu-distance-value",children:[e.kms," km"]})]}),null!=e.actualkms&&""!==e.actualkms&&(0,C.jsxs)("div",{className:"pu-distance-chip",children:[(0,C.jsx)("span",{className:"pu-distance-icon",children:(0,C.jsx)(S.xI$,{})}),(0,C.jsx)("span",{className:"pu-distance-label",children:"Actual"}),(0,C.jsxs)("span",{className:"pu-distance-value",children:[e.actualkms," km"]})]}),!t&&null!=e.riderkms&&""!==e.riderkms&&(0,C.jsxs)("div",{className:"pu-distance-chip",children:[(0,C.jsx)("span",{className:"pu-distance-icon",children:(0,C.jsx)(S.bsz,{})}),(0,C.jsx)("span",{className:"pu-distance-label",children:"Rider"}),(0,C.jsxs)("span",{className:"pu-distance-value",children:[parseFloat(e.riderkms).toFixed(2)," km"]})]}),null!==i&&(0,C.jsxs)("div",{className:"pu-distance-chip pu-est-meters",title:"Estimated distance to drop location",children:[(0,C.jsx)("span",{className:"pu-distance-icon",children:(0,C.jsx)(S.HPi,{})}),(0,C.jsx)("span",{className:"pu-distance-label",children:"Est. to Drop"}),(0,C.jsx)("span",{className:"pu-distance-value",children:Xa(i)})]})]})]})]})]})})(He)]})})]}),!a&&"analysis"===W&&(0,C.jsxs)("div",{id:"dispatch-analysis",children:[(0,C.jsx)("div",{className:"da-picker-row",children:de.map((e=>{var s;const a=pe[e.key],t=xe===e.key,i=!1===(null===a||void 0===a||null===(s=a.data)||void 0===s?void 0:s.success),r=i?"#fee2e2":a?"".concat(e.color,"22"):"#f1f5f9",n=i?"#dc2626":a?e.color:"#64748b",l=t?"Loading\u2026":i?"! Failed":a?"\u2713 ".concat(a.fetchedAt):"Fetch",c=je===e.key;return(0,C.jsxs)("button",{type:"button",className:"da-picker ".concat(a?"has-data":""," ").concat(t?"is-loading":""," ").concat(c?"is-active":""),onClick:()=>!t&&ye(e.key),style:{borderColor:c?e.color:i?"#fecaca":a?e.border:"#e2e8f0",background:i?"#fef2f2":a?e.bg:"#ffffff",boxShadow:c?"0 0 0 2px ".concat(e.color,"33"):void 0},disabled:t,children:[(0,C.jsxs)("div",{className:"da-picker-head",children:[(0,C.jsx)("div",{className:"da-picker-badge",style:{background:"".concat(e.color,"22"),color:e.color},children:e.label[0]}),(0,C.jsxs)("div",{className:"da-picker-meta",children:[(0,C.jsx)("div",{className:"da-picker-name",children:e.label}),(0,C.jsx)("div",{className:"da-picker-range",children:e.timeRange})]}),(0,C.jsx)("span",{className:"da-picker-status",style:{background:r,color:n},children:l})]}),(0,C.jsx)("div",{className:"da-picker-sub",children:e.sub})]},e.key)}))}),((e,s,a)=>{if(!je)return(0,C.jsx)("div",{className:"da-empty",children:"Pick a batch above to view its efficiency analysis."});const t=de.find((e=>e.key===je)),r=pe[je],n=xe===je;if(n&&!r)return(0,C.jsxs)("div",{className:"da-empty",children:["Loading ",t.label," batch\u2026"]});if(!r)return null;const l=r.data||{};var c,d;if(!1===l.success)return(0,C.jsxs)("div",{className:"da-result-card da-result-card-error",style:{borderColor:"#fecaca",borderTopColor:"#ef4444"},children:[(0,C.jsxs)("div",{className:"da-result-head",children:[(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:"da-result-title",children:[t.label," Batch"]}),(0,C.jsxs)("div",{className:"da-result-sub",children:[t.timeRange," \xb7 Fetched at ",r.fetchedAt]})]}),(0,C.jsx)("button",{type:"button",className:"da-result-refresh",title:"Retry",onClick:()=>ye(je),disabled:n,style:{background:"#fee2e2",color:"#dc2626"},children:(0,C.jsx)(S.joZ,{})})]}),(0,C.jsxs)("div",{className:"da-error",children:[(0,C.jsxs)("div",{className:"da-error-title",children:[(0,C.jsx)(S.ItP,{}),(0,C.jsx)("span",{children:(null===l||void 0===l||null===(c=l.error)||void 0===c?void 0:c.code)||"Request failed"})]}),(0,C.jsx)("div",{className:"da-error-msg",children:(null===l||void 0===l||null===(d=l.error)||void 0===d?void 0:d.message)||"The server returned an error."}),(null===l||void 0===l?void 0:l.request_id)&&(0,C.jsxs)("div",{className:"da-error-meta",children:["request_id: ",l.request_id]})]})]});const o=l.fleet_summary||{},u=Array.isArray(l.rider_timelines)?l.rider_timelines:[],m=Array.isArray(l.substitution_opportunities)?l.substitution_opportunities:[],p=l.top_recommendation,h=!(!p||!p.idle_rider_name&&!p.idle_rider_id),x=!!(p&&p.action&&"none"!==p.action&&h),v=l.window||{},j=(e,s)=>{const a=String(null!==e&&void 0!==e?e:"").trim();if(!a)return s||"\u2014";const t="string"===typeof s&&/^Rider\s+\d+$/i.test(s.trim()),i=Array.isArray(Ma)?Ma.find((e=>String(e.id)===a)):null;if(i&&i.riderName)return i.riderName;const r=Array.isArray(ka)?ka.find((e=>String(e.id)===a)):null;return r&&r.riderName?r.riderName:!t&&s?s:"Rider ".concat(a)},g=ue(o.fleet_start),f=ue(o.fleet_done),N=null!=g&&null!=f&&f>g?f-g:null,b=parseFloat(o.avg_utilisation_pct),y=Number.isFinite(b)?b:null,k=null==y?"unknown":y>=85?"good":y>=70?"ok":"low",_="good"===k?"#10b981":"ok"===k?"#f59e0b":"low"===k?"#ef4444":"#94a3b8",w=(e=>{let{assessment:s,spreadMin:a,stdev:t}=e;const i=String(s||"").toLowerCase();return/high imbalance|severe|critical/.test(i)||/imbalance|recommend/.test(i)||null!=a&&a>30||null!=t&&t>1?"warn":/balanced|excellent|good/.test(i)?"success":"info"})({assessment:null===p||void 0===p?void 0:p.fleet_balance_assessment,spreadMin:parseFloat(o.finish_time_spread_minutes),stdev:parseFloat(o.load_balance_stdev)}),F=u.map((e=>{const s=ue(e.started_at),a=ue(e.finished_at);let t=0,r=100;null!=g&&N&&(null!=s&&(t=Math.max(0,Math.min(100,(s-g)/N*100))),null!=a&&(r=Math.max(0,Math.min(100,(a-g)/N*100))));const n=Math.max(0,r-t),l=parseFloat(e.active_minutes),c=parseFloat(e.idle_minutes),d=(Number.isFinite(l)?l:0)+(Number.isFinite(c)?c:0),o=d>0?l/d*100:y,u=null==o?"unknown":o>=85?"good":o>=70?"ok":"low",m="good"===u?"#10b981":"ok"===u?"#f59e0b":"low"===u?"#ef4444":"#94a3b8",p=j(e.userid,e.name);return(0,i.A)((0,i.A)({},e),{},{displayName:p,_startPct:t,_endPct:r,_activePct:n,_riderUtilPct:o,_riderColor:m})}));return F.sort(((e,s)=>(ue(s.finished_at)||0)-(ue(e.finished_at)||0))),(0,C.jsxs)("div",{className:"da-detail",children:[(0,C.jsxs)("div",{className:"da-detail-head",style:{borderTopColor:t.color,background:t.bg},children:[(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:"da-detail-title",children:[t.label," Batch",(0,C.jsxs)("span",{className:"da-detail-sub-inline",children:[l.date?" \xb7 ".concat(l.date):"",v.from&&v.to?" \xb7 ".concat(v.from," \u2013 ").concat(v.to):""]})]}),(0,C.jsxs)("div",{className:"da-detail-sub",children:["Fetched at ",r.fetchedAt," \xb7 Input deliveries: ",null!==(e=l.input_delivery_count)&&void 0!==e?e:"\u2014"]})]}),(0,C.jsxs)("div",{className:"da-detail-actions",children:[(0,C.jsxs)("span",{className:"da-live-tag ".concat(n?"is-active":""),title:"Auto-refreshing every ".concat(Math.round(15),"s"),children:[(0,C.jsx)("span",{className:"da-live-dot"}),"Live \xb7 ",Math.round(15),"s"]}),(0,C.jsx)("button",{type:"button",className:"da-result-refresh",title:"Refresh now",onClick:()=>{he((e=>{const s=(0,i.A)({},e);return delete s[je],s})),be.mutate({batch:je,tenantId:916})},disabled:n,style:{background:"".concat(t.color,"22"),color:t.color},children:(0,C.jsx)(S.joZ,{})})]})]}),(0,C.jsx)("div",{className:"da-section",children:(0,C.jsxs)("div",{className:"da-hero-row",children:[(0,C.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:t.color},children:[(0,C.jsx)("div",{className:"da-hero-icon",style:{background:"".concat(t.color,"22"),color:t.color},children:(0,C.jsx)(S.gsJ,{})}),(0,C.jsx)("div",{className:"da-hero-value",children:oe(o.total_orders)}),(0,C.jsx)("div",{className:"da-hero-label",children:"Total Orders"}),null!=l.input_delivery_count&&l.input_delivery_count!==o.total_orders&&(0,C.jsxs)("div",{className:"da-hero-sub",children:[l.input_delivery_count," input"]})]}),(0,C.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:"#0ea5e9"},children:[(0,C.jsx)("div",{className:"da-hero-icon",style:{background:"#0ea5e922",color:"#0ea5e9"},children:(0,C.jsx)(S.aVM,{})}),(0,C.jsx)("div",{className:"da-hero-value",children:oe(o.total_riders)}),(0,C.jsx)("div",{className:"da-hero-label",children:"Active Riders"}),null!=o.orders_per_rider_avg&&(0,C.jsxs)("div",{className:"da-hero-sub",children:[o.orders_per_rider_avg," avg orders / rider"]})]}),(0,C.jsxs)("div",{className:"da-hero-card",style:{borderTopColor:"#8b5cf6"},children:[(0,C.jsx)("div",{className:"da-hero-icon",style:{background:"#8b5cf622",color:"#8b5cf6"},children:(0,C.jsx)(S.VP9,{})}),(0,C.jsxs)("div",{className:"da-hero-value",children:[null!=o.total_duration_minutes?"".concat(o.total_duration_minutes):"\u2014",null!=o.total_duration_minutes&&(0,C.jsx)("span",{className:"da-hero-unit",children:" min"})]}),(0,C.jsx)("div",{className:"da-hero-label",children:"Fleet Window"}),o.fleet_start&&o.fleet_done&&(0,C.jsxs)("div",{className:"da-hero-sub",children:[o.fleet_start," \u2192 ",o.fleet_done]})]})]})}),(0,C.jsxs)("div",{className:"da-section",children:[(0,C.jsx)("div",{className:"da-section-label",children:"Fleet Health"}),(0,C.jsxs)("div",{className:"da-health-row",children:[(0,C.jsxs)("div",{className:"da-health-card",children:[(0,C.jsx)("div",{className:"da-ring",style:{"--ring-color":_,"--ring-pct":null!=y?Math.max(0,Math.min(100,y)):0},children:(0,C.jsxs)("span",{className:"da-ring-num",children:[null!=y?"".concat(y.toFixed(0)):"\u2014",null!=y&&(0,C.jsx)("span",{className:"da-ring-unit",children:"%"})]})}),(0,C.jsxs)("div",{className:"da-health-meta",children:[(0,C.jsx)("div",{className:"da-health-label",children:"Avg Utilisation"}),(0,C.jsx)("div",{className:"da-health-sub",style:{color:_},children:"good"===k?"Strong":"ok"===k?"Moderate":"low"===k?"Low":"\u2014"})]})]}),(0,C.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,C.jsx)("div",{className:"da-health-value",children:null!=o.load_balance_stdev?parseFloat(o.load_balance_stdev).toFixed(2):"\u2014"}),(0,C.jsx)("div",{className:"da-health-label",children:"Load Balance \u03c3"}),(0,C.jsx)("div",{className:"da-health-sub",children:null!=o.load_balance_stdev?parseFloat(o.load_balance_stdev)>1?"Uneven workload":"Workload balanced":"Stdev of orders / rider"})]}),(0,C.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,C.jsxs)("div",{className:"da-health-value",children:[null!=o.finish_time_spread_minutes?"".concat(o.finish_time_spread_minutes):"\u2014",null!=o.finish_time_spread_minutes&&(0,C.jsx)("span",{className:"da-health-unit",children:" min"})]}),(0,C.jsx)("div",{className:"da-health-label",children:"Finish Spread"}),(0,C.jsx)("div",{className:"da-health-sub",children:null!=o.finish_time_stdev_minutes?"\u03c3 ".concat(parseFloat(o.finish_time_stdev_minutes).toFixed(1)," min"):"First \u2192 last finish"})]}),(0,C.jsxs)("div",{className:"da-health-card da-health-card-stat",children:[(0,C.jsxs)("div",{className:"da-health-value",children:[null!=o.avg_active_minutes?"".concat(parseFloat(o.avg_active_minutes).toFixed(0)):"\u2014",null!=o.avg_active_minutes&&(0,C.jsx)("span",{className:"da-health-unit",children:" min"})]}),(0,C.jsx)("div",{className:"da-health-label",children:"Avg Active"}),(0,C.jsx)("div",{className:"da-health-sub",children:"Per rider, this batch"})]})]})]}),(0,C.jsxs)("div",{className:"da-section",children:[(0,C.jsx)("div",{className:"da-section-label",children:"Top Recommendation"}),x?(0,C.jsxs)("div",{className:"da-rec-banner is-action",children:[(0,C.jsx)("div",{className:"da-rec-banner-icon",children:(0,C.jsx)(S.DX0,{})}),(0,C.jsxs)("div",{className:"da-rec-banner-body",children:[(0,C.jsxs)("div",{className:"da-rec-head",children:[(0,C.jsx)("div",{className:"da-rec-action",children:(0,C.jsx)("span",{children:(p.action||"recommendation").replaceAll("_"," ")})}),null!=p.fleet_improvement_minutes&&(0,C.jsxs)("span",{className:"da-rec-improve",style:p.fleet_improvement_minutes>0?{background:"#dcfce7",color:"#166534"}:{background:"#f1f5f9",color:"#475569"},children:[p.fleet_improvement_minutes>0?"\u2191":"\u2022"," Fleet improves by ",p.fleet_improvement_minutes," min"]})]}),(0,C.jsxs)("div",{className:"da-rec-line",children:[(0,C.jsx)("strong",{children:j(p.idle_rider_id,p.idle_rider_name)}),p.primary_kitchen&&(0,C.jsxs)(C.Fragment,{children:[" \xb7 primary kitchen ",(0,C.jsx)("strong",{children:p.primary_kitchen})]}),p.second_kitchen&&(0,C.jsxs)(C.Fragment,{children:[" \u2192 also serve ",(0,C.jsx)("strong",{children:p.second_kitchen})," after ",p.second_kitchen_dispatch_after||"\u2014"]})]}),p.description&&(0,C.jsx)("div",{className:"da-rec-desc",children:p.description}),(null===p||void 0===p?void 0:p.fleet_balance_assessment)&&(0,C.jsx)("div",{className:"da-rec-assess",children:p.fleet_balance_assessment}),(null===(s=p.activate_when)||void 0===s||null===(a=s.rules)||void 0===a?void 0:a.length)>0&&(0,C.jsxs)("div",{className:"da-rec-rules",children:[(0,C.jsxs)("div",{className:"da-rec-rules-head",children:["Activate when (",p.activate_when.condition||"AND","):"]}),p.activate_when.rules.map(((e,s)=>(0,C.jsxs)("div",{className:"da-rec-rule",children:[(0,C.jsxs)("code",{children:[e.field," ",e.operator," ",e.value]}),e.reason&&(0,C.jsxs)("span",{className:"da-rec-rule-why",children:[" \u2014 ",e.reason]})]},s)))]})]})]}):(0,C.jsxs)("div",{className:"da-rec-banner is-".concat(w),children:[(0,C.jsx)("div",{className:"da-rec-banner-icon",children:"warn"===w?(0,C.jsx)(S.Wux,{}):"success"===w?(0,C.jsx)(S.mU9,{}):(0,C.jsx)(S.DX0,{})}),(0,C.jsxs)("div",{className:"da-rec-banner-body",children:[(0,C.jsx)("div",{className:"da-rec-action",children:(0,C.jsx)("span",{children:"warn"===w?"Fleet imbalance detected \u2014 no feasible substitution":"success"===w?"Fleet ran balanced \u2014 no reassignment needed":"No action recommended"})}),(null===p||void 0===p?void 0:p.reason)&&(0,C.jsx)("div",{className:"da-rec-desc",children:p.reason}),(null===p||void 0===p?void 0:p.fleet_balance_assessment)&&(0,C.jsx)("div",{className:"da-rec-assess",children:p.fleet_balance_assessment})]})]})]}),F.length>0&&(0,C.jsxs)("div",{className:"da-section",children:[(0,C.jsxs)("div",{className:"da-section-label",children:["Rider Timelines ",(0,C.jsxs)("span",{className:"da-section-count",children:["(",F.length,")"]}),(0,C.jsx)("span",{className:"da-section-hint",children:"Sorted by latest finish \u2014 bottleneck riders first"})]}),(0,C.jsxs)("div",{className:"da-gantt-axis",children:[(0,C.jsx)("span",{children:o.fleet_start||"\u2014"}),(0,C.jsx)("span",{className:"da-gantt-axis-mid",children:null!=o.total_duration_minutes?"".concat(o.total_duration_minutes," min batch"):"Batch window"}),(0,C.jsx)("span",{children:o.fleet_done||"\u2014"})]}),(0,C.jsx)("div",{className:"da-timeline-list",children:F.map((e=>{var s,a,t;const i="active"===String(e.status||"").toLowerCase(),r=null!==(s=e.completed_orders)&&void 0!==s?s:e.order_count,n=null!==(a=e.pending_orders)&&void 0!==a?a:0,l=null!=r&&e.order_count>0?Math.max(0,Math.min(100,r/e.order_count*100)):0,c=null!=e.idle_minutes&&e.idle_minutes>30,d=null!=e.kitchen_confidence&&e.kitchen_confidence<.7;return(0,C.jsxs)("div",{className:"da-timeline-card",children:[(0,C.jsxs)("div",{className:"da-timeline-top",children:[(0,C.jsxs)("div",{className:"da-timeline-name",children:[(0,C.jsx)(S.aVM,{style:{color:e._riderColor}}),(0,C.jsx)("span",{title:e.name&&e.name!==e.displayName?"API name: ".concat(e.name):void 0,children:e.displayName}),(0,C.jsxs)("span",{className:"da-timeline-id",children:["#",e.userid]})]}),(0,C.jsx)("span",{className:"da-pill ".concat(i?"is-active":"is-idle"),children:e.status})]}),(0,C.jsxs)("div",{className:"da-gantt-row",children:[(0,C.jsxs)("div",{className:"da-gantt-track",title:"".concat(e.started_at," \u2192 ").concat(e.finished_at),children:[(0,C.jsxs)("div",{className:"da-gantt-fill",style:{left:"".concat(e._startPct,"%"),width:"".concat(Math.max(2,e._activePct),"%"),background:e._riderColor},children:[(0,C.jsx)("span",{className:"da-gantt-fill-start",children:e.started_at}),(0,C.jsx)("span",{className:"da-gantt-fill-end",children:e.finished_at})]}),e._endPct<99&&(0,C.jsx)("div",{className:"da-gantt-idle",style:{left:"".concat(e._endPct,"%"),width:"".concat(100-e._endPct,"%")},title:"Idle ".concat(e.idle_minutes," min after finishing")})]}),(0,C.jsx)("span",{className:"da-gantt-util",style:{background:"".concat(e._riderColor,"22"),color:e._riderColor},title:"Per-rider utilisation: ".concat(null!=e._riderUtilPct?e._riderUtilPct.toFixed(0):"\u2014","%"),children:null!=e._riderUtilPct?"".concat(e._riderUtilPct.toFixed(0),"%"):"\u2014"})]}),(0,C.jsxs)("div",{className:"da-timeline-mid",children:[e.kitchen?(0,C.jsxs)("span",{className:"da-chip",title:null!=e.kitchen_confidence?"Kitchen confidence: ".concat((100*e.kitchen_confidence).toFixed(0),"%"):void 0,children:[(0,C.jsx)(S.NtI,{})," ",e.kitchen,null!=e.kitchen_confidence&&(0,C.jsx)("span",{className:"da-conf-dot ".concat(d?"is-low":"is-ok"),"aria-label":"Confidence ".concat((100*e.kitchen_confidence).toFixed(0),"%")})]}):(0,C.jsxs)("span",{className:"da-chip",style:{background:"#f8fafc",color:"#64748b",borderColor:"#e2e8f0",borderStyle:"dashed"},title:"Solver did not identify a primary kitchen for this rider",children:[(0,C.jsx)(S.NtI,{})," Unassigned"]}),(0,C.jsxs)("span",{className:"da-chip da-chip-orders",title:"Completed ".concat(r," of ").concat(e.order_count),children:[(0,C.jsx)(S.gsJ,{}),(0,C.jsxs)("span",{className:"da-orders-label",children:[r,"/",e.order_count]}),(0,C.jsx)("span",{className:"da-orders-bar",children:(0,C.jsx)("span",{className:"da-orders-bar-fill",style:{width:"".concat(l,"%")}})}),n>0&&(0,C.jsxs)("span",{className:"da-orders-pending",children:[n," pending"]})]}),null!=e.pace_orders_per_hour&&(0,C.jsxs)("span",{className:"da-chip",title:"Delivery pace this batch",children:[(0,C.jsx)(S.BJM,{})," ",parseFloat(e.pace_orders_per_hour).toFixed(1)," / hr"]}),null!=e.active_minutes&&(0,C.jsxs)("span",{className:"da-chip",title:"Time actively delivering",children:[(0,C.jsx)(S.pWE,{})," ",parseFloat(e.active_minutes).toFixed(0)," min active"]}),(0,C.jsxs)("span",{className:"da-chip",style:c?{background:"#fef3c7",color:"#92400e",borderColor:"#fde68a"}:void 0,title:"Idle time after this rider finished \u2014 fleet kept running",children:[(0,C.jsx)(S.VP9,{})," ",null!==(t=e.idle_minutes)&&void 0!==t?t:0," min idle"]}),null!=e.free_window_minutes&&(0,C.jsxs)("span",{className:"da-chip",style:e.free_window_minutes>=30?{background:"#ecfdf5",color:"#065f46",borderColor:"#a7f3d0"}:e.free_window_minutes>0?{background:"#fefce8",color:"#854d0e",borderColor:"#fde68a"}:{background:"#fef2f2",color:"#991b1b",borderColor:"#fecaca"},title:"Free window before the next batch \u2014 capacity available for a follow-up run",children:[(0,C.jsx)(S.pWE,{})," ",parseFloat(e.free_window_minutes).toFixed(0)," min free"]})]})]},e.userid)}))})]}),m.length>0&&(0,C.jsxs)("div",{className:"da-section",children:[(0,C.jsxs)("div",{className:"da-section-label",children:["Substitution Opportunities ",(0,C.jsxs)("span",{className:"da-section-count",children:["(",m.length,")"]})]}),(0,C.jsx)("div",{className:"da-sub-list",children:m.map(((e,s)=>{var a;const t=e.idle_rider||{},i=e.most_relieved_rider||{},r=null!==(a=e.fleet_improvement_minutes)&&void 0!==a?a:0;return(0,C.jsxs)("div",{className:"da-sub-card",children:[(0,C.jsxs)("div",{className:"da-sub-head",children:[(0,C.jsxs)("div",{className:"da-sub-title",children:[(0,C.jsx)("strong",{children:j(t.userid,t.name)})," ","covers ",(0,C.jsx)("strong",{children:e.target_kitchen})]}),(0,C.jsxs)("span",{className:"da-sub-improve",style:r>0?{background:"#dcfce7",color:"#166534"}:{background:"#f1f5f9",color:"#475569"},children:["Fleet ",r>0?"\u2191":"\u2022"," ",r," min"]})]}),(0,C.jsxs)("div",{className:"da-sub-meta",children:[(0,C.jsxs)("span",{className:"da-chip",children:[(0,C.jsx)(S.xI$,{})," ",e.travel_to_kitchen_km," km"]}),(0,C.jsxs)("span",{className:"da-chip",children:[(0,C.jsx)(S.pWE,{})," ",e.travel_to_kitchen_minutes," min travel"]}),(0,C.jsxs)("span",{className:"da-chip",children:[(0,C.jsx)(S.VP9,{})," arrives ",e.arrive_at_kitchen]}),(0,C.jsxs)("span",{className:"da-chip",children:[(0,C.jsx)(S.gsJ,{})," ",e.total_orders_transferred," orders"]}),(0,C.jsxs)("span",{className:"da-chip",children:[(0,C.jsx)(S.xI$,{})," +",e.extra_km_for_idle_rider," km for idle rider"]})]}),(i.name||null!=i.userid)&&(0,C.jsxs)("div",{className:"da-sub-relieved",children:[(0,C.jsx)(S.imn,{}),"Most relieved: ",(0,C.jsx)("strong",{children:j(i.userid,i.name)})," ","(",i.original_finish," \u2192 ",i.new_finish,", saves"," ",i.time_saved_minutes," min)"]}),Array.isArray(e.orders_to_transfer)&&e.orders_to_transfer.length>0&&(0,C.jsxs)("div",{className:"da-sub-transfers",children:[(0,C.jsx)("div",{className:"da-sub-transfers-head",children:"Orders transferred"}),e.orders_to_transfer.map((e=>{var s;const a=null!==(s=e.improvement_minutes)&&void 0!==s?s:0;return(0,C.jsxs)("div",{className:"da-transfer-row",children:[(0,C.jsxs)("span",{className:"da-transfer-id",children:["#",e.deliveryid]}),(0,C.jsxs)("span",{className:"da-transfer-from",children:["from ",j(e.from_rider_id||e.from_userid,e.from_rider_name)]}),(0,C.jsxs)("span",{className:"da-transfer-time",children:[e.original_delivery_time," \u2192 ",e.estimated_delivery_time]}),(0,C.jsxs)("span",{className:"da-transfer-imp",style:a>0?{background:"#dcfce7",color:"#166534"}:a<0?{background:"#fee2e2",color:"#991b1b"}:{background:"#f1f5f9",color:"#475569"},children:[a>0?"+":"",a," min"]})]},e.deliveryid)}))]})]},s)}))})]})]})})()]}),fe&&(0,C.jsx)("div",{className:"da-pos-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Last known position of ".concat(fe.name),onClick:e=>{e.target===e.currentTarget&&Ne(null)},children:(0,C.jsxs)("div",{className:"da-pos-modal-card",children:[(0,C.jsxs)("div",{className:"da-pos-modal-head",children:[(0,C.jsxs)("div",{className:"da-pos-modal-title-wrap",children:[(0,C.jsx)("div",{className:"da-pos-modal-avatar",style:{background:"".concat(fe.color||"#662582","22"),color:fe.color||"#662582"},children:(0,C.jsx)(S.aVM,{})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"da-pos-modal-title",children:fe.name}),(0,C.jsxs)("div",{className:"da-pos-modal-sub",children:["#",fe.userid,fe.kitchen&&(0,C.jsxs)(C.Fragment,{children:[" \xb7 ",fe.kitchen]}),fe.finished_at&&(0,C.jsxs)(C.Fragment,{children:[" \xb7 finished ",fe.finished_at]})]})]})]}),(0,C.jsxs)("div",{className:"da-pos-modal-actions",children:[(0,C.jsx)("span",{className:"da-pill ".concat("active"===String(fe.status||"").toLowerCase()?"is-active":"is-idle"),children:fe.status||"\u2014"}),(0,C.jsx)("button",{type:"button",className:"da-pos-modal-close","aria-label":"Close",onClick:()=>Ne(null),children:(0,C.jsx)(S.m6K,{})})]})]}),(0,C.jsx)("div",{className:"da-pos-modal-map",children:(0,C.jsxs)(d.W,{center:[fe.lat,fe.lon],zoom:13,scrollWheelZoom:!0,style:{width:"100%",height:"100%"},whenReady:e=>{const s=e.target;requestAnimationFrame((()=>s.invalidateSize())),setTimeout((()=>s.invalidateSize()),260)},children:[(0,C.jsx)(o.e,{attribution:'\xa9 OpenStreetMap',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,C.jsx)(l.p,{position:[fe.lat,fe.lon],children:(0,C.jsxs)(m.z,{children:[(0,C.jsx)("strong",{children:fe.name}),(0,C.jsx)("br",{}),fe.lat.toFixed(6),", ",fe.lon.toFixed(6)]})})]},"".concat(fe.userid,"-").concat(fe.lat,"-").concat(fe.lon))}),(0,C.jsxs)("div",{className:"da-pos-modal-foot",children:[(0,C.jsxs)("div",{className:"da-pos-modal-coord",children:[(0,C.jsx)(S.gwi,{}),(0,C.jsxs)("span",{children:[(0,C.jsx)("strong",{children:"Lat:"})," ",fe.lat.toFixed(6),(0,C.jsx)("span",{className:"da-pos-modal-sep",children:"\xb7"}),(0,C.jsx)("strong",{children:"Lon:"})," ",fe.lon.toFixed(6)]})]}),(0,C.jsx)("button",{type:"button",className:"da-pos-modal-copy",onClick:()=>{var e,s;const a="".concat(fe.lat.toFixed(6),", ").concat(fe.lon.toFixed(6));null!==(e=navigator)&&void 0!==e&&null!==(s=e.clipboard)&&void 0!==s&&s.writeText&&navigator.clipboard.writeText(a)},title:"Copy coordinates",children:"Copy"})]})]})})]})}},84702:(e,s,a)=>{a.d(s,{Cx:()=>i,IE:()=>d,Ys:()=>r,Z3:()=>l,gM:()=>c,yP:()=>n});const t={created:{label:"Created",bg:"#3b82f6",fg:"#fff"},pending:{label:"Pending",bg:"#f59e0b",fg:"#fff"},accepted:{label:"Accepted",bg:"#8b5cf6",fg:"#fff"},arrived:{label:"Arrived",bg:"#ea580c",fg:"#fff"},picked:{label:"Picked",bg:"#0ea5e9",fg:"#fff"},active:{label:"Active",bg:"#0ea5e9",fg:"#fff"},delivered:{label:"Delivered",bg:"#22c55e",fg:"#fff"},skipped:{label:"Skipped",bg:"#94a3b8",fg:"#fff"},cancelled:{label:"Cancelled",bg:"#ef4444",fg:"#fff"}},i=e=>t[String(e||"").toLowerCase()]||{label:e||"Unknown",bg:"#64748b",fg:"#fff"},r=new Set(["delivered"]),n=new Set(["cancelled","skipped"]),l=["#2563eb","#dc2626","#16a34a","#ea580c","#9333ea","#0891b2","#ca8a04","#db2777","#0f766e","#7c3aed","#65a30d","#0284c7","#b91c1c","#15803d","#a16207","#86198f"],c=e=>l[(e%l.length+l.length)%l.length],d=e=>{if(null==e)return"";const s=["th","st","nd","rd"],a=e%100;return e+(s[(a-20)%10]||s[a]||s[0])}}}]); \ No newline at end of file diff --git a/build/static/js/6849.9b9d612c.chunk.js b/build/static/js/6849.9b9d612c.chunk.js new file mode 100644 index 0000000..bca5ff2 --- /dev/null +++ b/build/static/js/6849.9b9d612c.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6849],{23787:(e,t,o)=>{o.d(t,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var r=o(89379),n=o(80045),i=o(93230),l=o(2235),a=o(16491),s=o(82053),c=o(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:o=!1,onScroll:l,sx:a}=e,s=(0,n.A)(e,d);return(0,c.jsx)(i.A,(0,r.A)((0,r.A)({spacing:1.25,onScroll:l,sx:(0,r.A)((0,r.A)({p:1.5},o&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),a)},s),{},{children:t}))},h=e=>{let{accent:t="#662582",header:o,footer:n,selected:i=!1,onClick:s,children:d,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:s,sx:(0,r.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?t:"#e2e8f0",background:i?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(a.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(a.A,{sx:{p:1.5,pl:2},children:[o,d,n]})]})},u=e=>{let{children:t,columns:o=2,sx:n}=e;return(0,c.jsx)(a.A,{sx:(0,r.A)({display:"grid",gridTemplateColumns:"repeat(".concat(o,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:t})},p=e=>{let{label:t,value:o,children:r,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(a.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(s.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(a.A,{sx:{mt:.25,minWidth:0},children:void 0!==r?r:(0,c.jsx)(s.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==o&&void 0!==o?o:"\u2014"})})]})}},35678:(e,t,o)=>{o.d(t,{A:()=>v});var r=o(9950),n=o(96583),i=o(40033),l=o(82053),a=o(28170),s=o(93230),c=o(82223),d=o(55916),x=o(4159),h=o.n(x),u=o(56712),p=o(81417),m=o(96600),g=o(53132),j=o(94289),b=o(57326),A=o(50624),f=o(44414);const v=e=>{let{open:t,onClose:o,onSelect:x}=e;const[v,w]=(0,r.useState)(null);return(0,f.jsxs)(n.A,{open:t,onClose:o,children:[(0,f.jsx)(i.A,{align:"left",children:(0,f.jsx)(l.A,{variant:"h4",children:"Select Filter Options"})}),(0,f.jsx)(a.A,{sx:{width:"100%"},className:"datedialog",children:(0,f.jsx)(d.U,{open:t,toggle:o,id:"daterange1",onChange:e=>{w({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,g.A)(new Date,-1)),endDate:(0,m.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,j.A)(new Date),endDate:(0,b.A)(new Date)},{label:"Last Month",startDate:(0,j.A)((0,A.A)(new Date,-1)),endDate:(0,b.A)((0,A.A)(new Date,-1))}]})}),(0,f.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,f.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),o()):o()},children:"OK"})})]})}},56311:(e,t,o)=>{o.d(t,{A:()=>u});var r=o(89379),n=o(9950),i=o(2660),l=o(2046),a=o(83274),s=o(25333),c=o(97125),d=o(7762),x=o(52097),h=o(44414);const u=e=>{let{value:t,onChange:o,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const j=(0,n.useRef)(null),[b]=(0,x.d7)(t,p);return(0,n.useEffect)((()=>{u&&u(b)}),[b,u]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=j.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===j.current&&j.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,r.A)({},g),inputRef:j,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(a.A,{title:"Clear",children:(0,h.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},56849:(e,t,o)=>{o.r(t),o.d(t,{default:()=>te});var r=o(89379),n=o(9950),i=o(26910),l=o(36150),a=o(2235),s=o(41413),c=o(83274),d=o(16491),x=o(82053),h=o(14857),u=o(47223),p=o(93230),m=o(60899),g=o(77922),j=o(29925),b=o(25333),A=o(33738),f=o(1320),v=o(15769),w=o(69780),S=o(9213),y=o(21671),C=o(34075),z=o(74745),k=o(25277),D=o(31222),W=o(4159),I=o.n(W),M=o(81425),Y=o(52351),P=o(35678),N=o(59212),T=o(56311),R=o(23787),F=o(96646),O=o(20466),L=o(44414),K=o(36220);I().extend(K);const B={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},H=(e,t)=>"".concat(e).concat(t),E=e=>H(e,"08"),Z=e=>H(e,"18"),X=e=>H(e,"26"),U=e=>H(e,"55"),q="#662582",$="#9255AB",V=e=>(0,L.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:B.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),G=e=>{let{color:t,selected:o,size:r=24,children:n}=e;return(0,L.jsx)(s.A,{sx:{width:r,height:r,bgcolor:o?t:Z(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},J=e=>{let{color:t,icon:o,label:r,tooltip:n,minWidth:i=80}=e;return(0,L.jsx)(c.A,{title:n||"",placement:"top",children:(0,L.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:E(t),border:"1px solid ".concat(U(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[o,r]})})},_=e=>{let{value:t,color:o="#ef4444",icon:r}=e;const n=Number(t)||0;return 0===n?(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textMuted,fontWeight:700},children:"0"}):(0,L.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:E(o),border:"1px solid ".concat(U(o)),color:o,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[r,n]})},Q=e=>({"& .MuiOutlinedInput-root":{borderRadius:B.radiusPill+"px",bgcolor:E(e),fontWeight:600,"& fieldset":{borderColor:U(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(X(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}});function ee(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function te(){const e=(0,h.A)(),t=(0,u.A)(e.breakpoints.down("md")),o=(0,n.useRef)(null),W=(0,n.useRef)(null),[K,H]=(0,n.useState)(0),[te,oe]=(0,n.useState)(I()().format("YYYY-MM-DD")),[re,ne]=(0,n.useState)(I()().format("YYYY-MM-DD")),[ie,le]=(0,n.useState)("All"),[ae,se]=(0,n.useState)(!1),[ce,de]=(0,n.useState)(null),[xe,he]=(0,n.useState)("Today"),[ue,pe]=(0,n.useState)([]),[me,ge]=(0,n.useState)(!1),[je,be]=(0,n.useState)(0),[Ae,fe]=(0,n.useState)(0),[ve,we]=(0,n.useState)(null),[Se,ye]=(0,n.useState)(null),[Ce,ze]=(0,n.useState)(""),[ke,De]=(0,n.useState)(""),[,We]=(0,n.useState)(0);(0,n.useEffect)((()=>{fe(0),we(null),be(0),ye(null),de(null)}),[K]),(0,n.useEffect)((()=>{be(0),ye(null),de(null)}),[Ae]);const{data:Ie,isLoading:Me,isError:Ye,error:Pe}=(0,l.I)({queryKey:[K,Ae,je,te,re],queryFn:Ae?M.U6:M.DK}),{data:Ne}=(0,l.I)({queryKey:["tenantlist",K],queryFn:()=>(0,M.Mn)(K),enabled:0!==K}),{data:Te}=(0,l.I)({queryKey:["gettenantlocations",Ae],queryFn:()=>(0,M.DL)(Ae),enabled:0!==Ae}),Re=(0,n.useMemo)((()=>Array.isArray(Ie)?Ie:[]),[Ie]),Fe=(0,n.useMemo)((()=>{if(!ke)return Re;const e=ke.toLowerCase().trim();return Re.filter((t=>[t.tenantname,t.locationname,String(t.tenantid||""),String(t.locationid||"")].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[Re,ke]),Oe=(0,n.useMemo)((()=>Fe.reduce(((e,t)=>(e.totalOrders+=Number(t.totalorders)||0,e.orderPend+=Number(t.Orderspending)||0,e.orderComplete+=Number(t.orderscompleted)||0,e.orderCancel+=Number(t.orderscancelled)||0,e.deliPend+=Number(t.deliveriespending)||0,e.deliComplete+=Number(t.deliveriescompleted)||0,e.deliCancel+=Number(t.deliveriescancelled)||0,e.collection+=Number(t.collectionamt)||0,e.kms+=Number(t.kms)||0,e.cumulativekms+=Number(t.cumulativekms)||0,e.amount+=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0),e)),{totalOrders:0,orderPend:0,orderComplete:0,orderCancel:0,deliPend:0,deliComplete:0,deliCancel:0,collection:0,kms:0,cumulativekms:0,amount:0})),[Fe]),Le=async e=>{ge(!0);try{var t;const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getuserreportsummary/?tenantid=").concat(e,"&fromdate=").concat(te,"&todate=").concat(re));pe(Array.isArray(null===(t=o.data)||void 0===t?void 0:t.details)?o.data.details:[])}catch(o){(0,O.k)((null===o||void 0===o?void 0:o.message)||"Failed to load rider breakdown","error",2e3),pe([])}finally{ge(!1)}},Ke=async e=>{ge(!0);try{var t;const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationsummary/?tenantid=").concat(Ae,"&locationid=").concat(e,"&fromdate=").concat(te,"&todate=").concat(re));pe(Array.isArray(null===(t=o.data)||void 0===t?void 0:t.details)?o.data.details:[])}catch(o){(0,O.k)((null===o||void 0===o?void 0:o.message)||"Failed to load rider breakdown","error",2e3),pe([])}finally{ge(!1)}};Ye&&console.warn("ordersSummary error:",null===Pe||void 0===Pe?void 0:Pe.message);const Be=[{key:"orders",label:"Total Orders",color:q,icon:D.F6S,value:Oe.totalOrders},{key:"pending",label:"Orders Pending",color:"#f59e0b",icon:D.tX0,value:Oe.orderPend},{key:"completed",label:"Orders Completed",color:"#10b981",icon:D.mU9,value:Oe.orderComplete},{key:"amount",label:"Total Amount",color:"#0ea5e9",icon:D.YHz,value:ee(Oe.amount)}],He=Boolean(Ae);return(0,L.jsxs)(L.Fragment,{children:[(me||Me)&&(0,L.jsx)(Y.A,{}),(0,L.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,background:"linear-gradient(135deg, ".concat(E(q)," 0%, ").concat(E($)," 100%)"),boxShadow:B.shadowMd},children:(0,L.jsxs)(p.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,L.jsx)(s.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:q,color:"#fff",boxShadow:"0 6px 18px ".concat(X(q))},children:(0,L.jsx)(D.GdF,{size:22})}),(0,L.jsxs)(p.A,{children:[(0,L.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:B.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders Summary"}),(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,L.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,L.jsxs)(x.A,{variant:"caption",sx:{color:B.textSecondary,fontWeight:600},children:["Live \xb7 ",ie||"All Zones"," \xb7 ",xe]})]})]})]}),(0,L.jsx)(N.A,{ref:o,locaName:ie,setAppId:H,setLocoName:le,setPage:We,pill:!0,accentColor:q,icon:(0,L.jsx)(D.HPi,{size:14}),placeholder:"Select Zone",paperComponent:V,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,L.jsx)(m.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Be.map((e=>{const t=e.icon;return(0,L.jsx)(m.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,L.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:B.shadowMd,borderColor:U(e.color)}},children:[(0,L.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Z(e.color)," 100%)")}}),(0,L.jsxs)(p.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,L.jsxs)(p.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,L.jsx)(x.A,{sx:{fontWeight:800,color:B.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,L.jsx)(s.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Z(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(U(e.color)),flexShrink:0},children:(0,L.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,L.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:B.radiusCard/8,borderTopRightRadius:B.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:B.borderSubtle,borderBottom:0,background:"#fff"},children:(0,L.jsxs)(p.A,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,L.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,L.jsxs)(d.A,{onClick:()=>se(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:E("#f59e0b"),border:"1.5px solid ".concat(U("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(X("#f59e0b"))}},children:[(0,L.jsx)(D.Ki0,{size:14}),"Orders \xb7 ",xe," \xb7 ",I()(te).format("DD/MM/YY")," \u2013 ",I()(re).format("DD/MM/YY")]})}),(0,L.jsx)(g.A,{options:Ne||[],value:ve,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||(null===e||void 0===e?void 0:e.label)||"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.tenantid)===(null===t||void 0===t?void 0:t.tenantid),PaperComponent:V,sx:(0,r.A)({minWidth:{xs:"100%",sm:220}},Q(q)),onOpen:e=>{K||(e.preventDefault(),(0,O.k)("Please select a Zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,o)=>{"clear"!==o&&t?(fe((null===t||void 0===t?void 0:t.tenantid)||0),we(t),be((null===t||void 0===t?void 0:t.locationid)||0),ye(null)):(fe(0),we(null),be(0),ye(null))},renderInput:e=>(0,L.jsx)(j.A,(0,r.A)((0,r.A)({},e),{},{inputRef:W,placeholder:"Select Tenant",size:"small",InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,L.jsx)(G,{color:q,size:24,selected:Boolean(ve),children:(0,L.jsx)(D.nZo,{size:14})}),e.InputProps.startAdornment]})})}))}),(0,L.jsx)(g.A,{options:Te||[],value:Se,getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname).concat(e.suburb?" (".concat(e.suburb,")"):""):"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.locationid)===(null===t||void 0===t?void 0:t.locationid),PaperComponent:V,sx:(0,r.A)({minWidth:{xs:"100%",sm:220}},Q("#0ea5e9")),onOpen:e=>{K||Ae?Ae||(e.preventDefault(),(0,O.k)("Please select a Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=W.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,O.k)("Please select Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,o)=>{"clear"!==o&&t?(be((null===t||void 0===t?void 0:t.locationid)||0),ye(t)):(be(0),ye(null))},renderInput:e=>(0,L.jsx)(j.A,(0,r.A)((0,r.A)({},e),{},{placeholder:"Select Location",size:"small",InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,L.jsx)(G,{color:"#0ea5e9",size:24,selected:Boolean(Se),children:(0,L.jsx)(D.gwi,{size:14})}),e.InputProps.startAdornment]})})}))})]}),(0,L.jsx)(d.A,{sx:{width:{xs:"100%",md:280,lg:320},flex:{xs:"1 1 100%",md:"0 0 auto"}},children:(0,L.jsx)(T.A,{value:Ce,onChange:ze,onDebouncedChange:De,placeholder:"Search ".concat(He?"locations":"tenants"," (ctrl+k)"),sx:{m:0,width:"100%",borderRadius:999,bgcolor:E(q),"& fieldset":{borderColor:U(q),borderWidth:1.5},"&:hover fieldset":{borderColor:q},"&.Mui-focused fieldset":{borderColor:q,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(X(q))}}})})]})}),(0,L.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:B.radiusCard/8,borderBottomRightRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,overflow:"hidden",background:"#fff"},children:[t?(0,L.jsxs)(L.Fragment,{children:[Me&&(0,L.jsx)(R.nV,{children:[0,1,2,3].map((e=>(0,L.jsx)(R.pg,{accent:B.borderSubtle,children:(0,L.jsx)(d.A,{sx:{height:96}})},e)))}),!Me&&0===Fe.length&&(0,L.jsxs)(p.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,L.jsx)(s.A,{sx:{width:64,height:64,bgcolor:Z("#94a3b8"),color:B.textMuted},children:(0,L.jsx)(D.Z2J,{size:28})}),(0,L.jsxs)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:B.textPrimary},children:["No ",He?"locations":"tenants"," to show"]}),(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary,textAlign:"center",maxWidth:360},children:ke?"Try a different keyword.":Ye?"Something went wrong fetching the summary. Try a different filter.":"Pick a zone, tenant, or date range to load the summary."})]}),!Me&&Fe.length>0&&(0,L.jsx)(R.nV,{children:Fe.map(((e,t)=>{const o=He?e.locationname:e.tenantname,r=ce===o,n=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0),i=He?"#0ea5e9":q;return(0,L.jsxs)(R.pg,{accent:i,selected:r,header:(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,L.jsx)(G,{color:i,size:36,children:He?(0,L.jsx)(D.gwi,{size:18}):(0,L.jsx)(D.nZo,{size:18})}),(0,L.jsxs)(p.A,{sx:{minWidth:0,flex:1},children:[(0,L.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary},noWrap:!0,children:(He?e.locationname:e.tenantname)||"\u2014"}),(0,L.jsxs)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:["ID #",He?e.locationid:e.tenantid]})]}),(0,L.jsx)(c.A,{title:r?"Hide rider breakdown":"View rider breakdown",placement:"top",children:(0,L.jsx)(b.A,{size:"small",onClick:()=>{const t=!r;de(t?o:null),t&&(pe([]),He?Ke(e.locationid):Le(e.tenantid))},sx:{flexShrink:0,bgcolor:r?q:Z(q),color:r?"#fff":q,border:"1px solid ".concat(U(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:r?(0,L.jsx)(D.Xbk,{size:16}):(0,L.jsx)(D.j1Q,{size:16})})})]}),children:[(0,L.jsxs)(R.FG,{columns:3,children:[(0,L.jsx)(R.pY,{label:"All",align:"center",children:(0,L.jsx)(_,{value:e.totalorders,color:q,icon:(0,L.jsx)(D.F6S,{size:11})})}),(0,L.jsx)(R.pY,{label:"Ord Pending",align:"center",children:(0,L.jsx)(_,{value:e.Orderspending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:11})})}),(0,L.jsx)(R.pY,{label:"Ord Cancelled",align:"center",children:(0,L.jsx)(_,{value:e.orderscancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:11})})}),(0,L.jsx)(R.pY,{label:"Ord Completed",align:"center",children:(0,L.jsx)(_,{value:e.orderscompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:11})})}),(0,L.jsx)(R.pY,{label:"Del Pending",align:"center",children:(0,L.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:11})})}),(0,L.jsx)(R.pY,{label:"Del Cancelled",align:"center",children:(0,L.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:11})})}),(0,L.jsx)(R.pY,{label:"Del Completed",align:"center",children:(0,L.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:11})})}),(0,L.jsx)(R.pY,{label:"Collection",align:"center",children:(0,L.jsx)(J,{color:"#f59e0b",icon:(0,L.jsx)(D.YHz,{size:11}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection Amount",minWidth:90})}),(0,L.jsx)(R.pY,{label:"Amount",align:"center",children:(0,L.jsx)(J,{color:q,icon:(0,L.jsx)(D.YHz,{size:11}),label:ee(n).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,L.jsx)(R.pY,{label:"KMS",align:"center",children:(0,L.jsx)(J,{color:"#ef4444",icon:(0,L.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,L.jsx)(R.pY,{label:"Actual KMS",align:"center",children:(0,L.jsx)(J,{color:"#10b981",icon:(0,L.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})})]}),(0,L.jsx)(A.A,{in:r,timeout:"auto",unmountOnExit:!0,children:(0,L.jsxs)(d.A,{sx:{mt:1.5},children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[(0,L.jsx)(G,{color:q,size:24,selected:!0,children:(0,L.jsx)(D.Itr,{size:12})}),(0,L.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:"Rider Breakdown"})]}),me||ue&&0!==ue.length?(0,L.jsx)(p.A,{spacing:1,children:ue.map(((e,t)=>{const o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,L.jsxs)(R.pg,{accent:q,children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,L.jsx)(G,{color:q,size:28,children:(0,L.jsx)(D.LTk,{size:14})}),(0,L.jsxs)(p.A,{sx:{minWidth:0},children:[(0,L.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary},noWrap:!0,children:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"\u2014"}),(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:e.ridercontact||"ID #".concat(e.userid)})]})]}),(0,L.jsxs)(R.FG,{columns:3,children:[(0,L.jsx)(R.pY,{label:"Orders",align:"center",children:(0,L.jsx)(_,{value:e.orderscreated,color:q,icon:(0,L.jsx)(D.F6S,{size:10})})}),(0,L.jsx)(R.pY,{label:"Deliveries",align:"center",children:(0,L.jsx)(_,{value:e.totalorders,color:"#0ea5e9",icon:(0,L.jsx)(D.F6S,{size:10})})}),(0,L.jsx)(R.pY,{label:"Pending",align:"center",children:(0,L.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:10})})}),(0,L.jsx)(R.pY,{label:"Cancelled",align:"center",children:(0,L.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:10})})}),(0,L.jsx)(R.pY,{label:"Completed",align:"center",children:(0,L.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:10})})}),(0,L.jsx)(R.pY,{label:"Collection",align:"center",children:(0,L.jsx)(J,{color:"#f59e0b",icon:(0,L.jsx)(D.YHz,{size:10}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection",minWidth:80})}),(0,L.jsx)(R.pY,{label:"KMS",align:"center",children:(0,L.jsx)(J,{color:"#ef4444",icon:(0,L.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,L.jsx)(R.pY,{label:"Actual KMS",align:"center",children:(0,L.jsx)(J,{color:"#10b981",icon:(0,L.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,L.jsx)(R.pY,{label:"Amount",align:"center",children:(0,L.jsx)(J,{color:q,icon:(0,L.jsx)(D.YHz,{size:10}),label:ee(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]})]},"".concat(e.userid,"-").concat(t))}))}):(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textMuted,display:"block",py:1,textAlign:"center"},children:"No rider activity for this row."})]})})]},"".concat(o,"-").concat(t))}))})]}):(0,L.jsx)(f.A,{sx:{maxHeight:{xs:"calc(100vh - 280px)",md:"calc(100vh - 240px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:U(q),borderRadius:8,"&:hover":{backgroundColor:q}},"&::-webkit-scrollbar-track":{backgroundColor:B.surfaceAlt}},children:(0,L.jsxs)(v.A,{stickyHeader:!0,sx:{minWidth:{xs:1080,md:1200}},children:[(0,L.jsxs)(w.A,{children:[(0,L.jsxs)(S.A,{sx:{"& th":{backgroundColor:B.surfaceAlt,color:B.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,L.jsx)(y.A,{rowSpan:2,children:"#"}),(0,L.jsx)(y.A,{rowSpan:2,children:He?"Location":"Tenant"}),(0,L.jsx)(y.A,{align:"center",rowSpan:2,children:"All"}),(0,L.jsx)(y.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(E("#ef4444")," !important"),color:"#ef4444 !important"},children:"Orders"}),(0,L.jsx)(y.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(E("#10b981")," !important"),color:"#10b981 !important"},children:"Deliveries"}),(0,L.jsx)(y.A,{align:"center",rowSpan:2,children:"Collection"}),(0,L.jsx)(y.A,{align:"center",rowSpan:2,children:"KMS / Actual"}),(0,L.jsx)(y.A,{align:"center",rowSpan:2,children:"Amount"}),(0,L.jsx)(y.A,{align:"right",rowSpan:2,children:"Action"})]}),(0,L.jsxs)(S.A,{sx:{"& th":{backgroundColor:B.surfaceAlt,color:B.textSecondary,fontSize:{xs:10,md:10.5},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B.borderSubtle),py:{xs:.75,md:1},px:{xs:1,md:1.5}}},children:[(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#ef4444")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#ef4444")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#ef4444")," !important"),color:"#10b981 !important"},children:"Completed"}),(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#10b981")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#10b981")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,L.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(E("#10b981")," !important"),color:"#10b981 !important"},children:"Completed"})]})]}),(0,L.jsxs)(C.A,{children:[Me&&(0,L.jsx)(F.r,{col:9}),!Me&&0===Fe.length&&(0,L.jsx)(S.A,{children:(0,L.jsx)(y.A,{colSpan:13,sx:{py:6},children:(0,L.jsxs)(p.A,{alignItems:"center",spacing:1.5,children:[(0,L.jsx)(s.A,{sx:{width:64,height:64,bgcolor:Z("#94a3b8"),color:B.textMuted},children:(0,L.jsx)(D.Z2J,{size:28})}),(0,L.jsxs)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:B.textPrimary},children:["No ",He?"locations":"tenants"," to show"]}),(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary,textAlign:"center",maxWidth:360},children:ke?"Try a different keyword.":Ye?"Something went wrong fetching the summary. Try a different filter.":"Pick a zone, tenant, or date range to load the summary."})]})})}),Fe.map(((e,t)=>{const o=He?e.locationname:e.tenantname,r=ce===o,i=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,L.jsxs)(n.Fragment,{children:[(0,L.jsxs)(S.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:r?"none":"1px solid ".concat(B.divider),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:r?"#fff":B.surfaceAlt},bgcolor:r?E(q):"transparent"},children:[(0,L.jsx)(y.A,{children:(0,L.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:B.textMuted},children:String(t+1).padStart(2,"0")})}),(0,L.jsx)(y.A,{children:(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,L.jsx)(G,{color:He?"#0ea5e9":q,size:36,children:He?(0,L.jsx)(D.gwi,{size:18}):(0,L.jsx)(D.nZo,{size:18})}),(0,L.jsxs)(p.A,{children:[(0,L.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary,whiteSpace:"nowrap"},children:(He?e.locationname:e.tenantname)||"\u2014"}),(0,L.jsxs)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:["ID #",He?e.locationid:e.tenantid]})]})]})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.totalorders,color:q,icon:(0,L.jsx)(D.F6S,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.Orderspending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.orderscancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.orderscompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:11})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(J,{color:"#f59e0b",icon:(0,L.jsx)(D.YHz,{size:11}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection Amount",minWidth:90})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,L.jsx)(J,{color:"#ef4444",icon:(0,L.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,L.jsx)(J,{color:"#10b981",icon:(0,L.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(J,{color:q,icon:(0,L.jsx)(D.YHz,{size:11}),label:ee(i).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,L.jsx)(y.A,{align:"right",children:(0,L.jsx)(c.A,{title:r?"Hide rider breakdown":"View rider breakdown",placement:"top",children:(0,L.jsx)(b.A,{size:"small",onClick:()=>{const t=!r;de(t?o:null),t&&(pe([]),He?Ke(e.locationid):Le(e.tenantid))},sx:{bgcolor:r?q:Z(q),color:r?"#fff":q,border:"1px solid ".concat(U(q)),"&:hover":{bgcolor:q,color:"#fff"}},children:r?(0,L.jsx)(D.Xbk,{size:16}):(0,L.jsx)(D.j1Q,{size:16})})})})]}),r&&(0,L.jsx)(S.A,{children:(0,L.jsx)(y.A,{colSpan:13,sx:{p:0,borderBottom:"1px solid ".concat(B.divider),bgcolor:E(q)},children:(0,L.jsx)(A.A,{in:r,timeout:"auto",unmountOnExit:!0,children:(0,L.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,L.jsxs)(a.A,{elevation:0,sx:{borderRadius:B.radiusCard/8,border:"1px solid",borderColor:B.borderSubtle,overflow:"hidden",boxShadow:B.shadowSoft},children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(E(q)," 0%, ").concat(E($)," 100%)"),borderBottom:"1px solid ".concat(B.borderSubtle)},children:[(0,L.jsx)(G,{color:q,size:28,selected:!0,children:(0,L.jsx)(D.Itr,{size:14})}),(0,L.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Rider Breakdown \xb7 ",He?e.locationname:e.tenantname]})]}),(0,L.jsxs)(v.A,{size:"small",children:[(0,L.jsx)(w.A,{children:(0,L.jsxs)(S.A,{sx:{"& th":{backgroundColor:B.surfaceAlt,color:B.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B.borderSubtle),py:1,px:1.5}},children:[(0,L.jsx)(y.A,{children:"#"}),(0,L.jsx)(y.A,{children:"Rider"}),(0,L.jsx)(y.A,{align:"center",children:"Orders"}),(0,L.jsx)(y.A,{align:"center",children:"Deliveries"}),(0,L.jsx)(y.A,{align:"center",children:"Pending"}),(0,L.jsx)(y.A,{align:"center",children:"Cancelled"}),(0,L.jsx)(y.A,{align:"center",children:"Completed"}),(0,L.jsx)(y.A,{align:"center",children:"Collection"}),(0,L.jsx)(y.A,{align:"center",children:"KMS / Actual"}),(0,L.jsx)(y.A,{align:"center",children:"Amount"})]})}),(0,L.jsxs)(C.A,{children:[me&&(0,L.jsx)(F.r,{col:6}),me||ue&&0!==ue.length?ue.map(((e,t)=>{const o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,L.jsxs)(S.A,{sx:{"& td":{borderBottom:"1px solid ".concat(B.divider),py:1,px:1.5},"&:hover":{backgroundColor:B.surfaceAlt}},children:[(0,L.jsx)(y.A,{children:(0,L.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:B.textMuted},children:String(t+1).padStart(2,"0")})}),(0,L.jsx)(y.A,{children:(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,L.jsx)(G,{color:q,size:28,children:(0,L.jsx)(D.LTk,{size:14})}),(0,L.jsxs)(p.A,{children:[(0,L.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:B.textPrimary,whiteSpace:"nowrap"},children:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"\u2014"}),(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textSecondary},children:e.ridercontact||"ID #".concat(e.userid)})]})]})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.orderscreated,color:q,icon:(0,L.jsx)(D.F6S,{size:10})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.totalorders,color:"#0ea5e9",icon:(0,L.jsx)(D.F6S,{size:10})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,L.jsx)(D.tX0,{size:10})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,L.jsx)(D.uDv,{size:10})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,L.jsx)(D.mU9,{size:10})})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(J,{color:"#f59e0b",icon:(0,L.jsx)(D.YHz,{size:10}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection",minWidth:80})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsxs)(p.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,L.jsx)(J,{color:"#ef4444",icon:(0,L.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,L.jsx)(J,{color:"#10b981",icon:(0,L.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,L.jsx)(y.A,{align:"center",children:(0,L.jsx)(J,{color:q,icon:(0,L.jsx)(D.YHz,{size:10}),label:ee(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.userid,"-").concat(t))})):(0,L.jsx)(S.A,{children:(0,L.jsx)(y.A,{colSpan:10,sx:{py:3},children:(0,L.jsx)(x.A,{variant:"caption",sx:{color:B.textMuted,textAlign:"center",display:"block"},children:"No rider activity for this row."})})})]})]})]})})})})})]},"".concat(o,"-").concat(t))}))]})]})}),Fe.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z.A,{}),(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1.5,flexWrap:"wrap",sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(E(q)," 0%, ").concat(E($)," 100%)")},children:[(0,L.jsxs)(p.A,{direction:"row",alignItems:"center",spacing:1,flexWrap:"wrap",children:[(0,L.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:B.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,L.jsx)(k.A,{size:"small",label:"".concat(Oe.totalOrders," orders"),sx:{fontWeight:700,bgcolor:Z(q),color:q,border:"1px solid ".concat(U(q))}}),(0,L.jsx)(k.A,{size:"small",label:"".concat(Oe.deliComplete," delivered"),sx:{fontWeight:700,bgcolor:Z("#10b981"),color:"#10b981",border:"1px solid ".concat(U("#10b981"))}}),(0,L.jsx)(k.A,{size:"small",label:"".concat(Oe.deliPend," pending"),sx:{fontWeight:700,bgcolor:Z("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(U("#f59e0b"))}})]}),(0,L.jsx)(k.A,{label:ee(Oe.amount),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(q," 0%, ").concat($," 100%)"),boxShadow:"0 6px 16px ".concat(X(q))}})]})]})]}),(0,L.jsx)(P.A,{open:ae,onClose:()=>se(!1),onSelect:e=>{oe(e.startDate),ne(e.endDate),he(e.label)}})]})}},59212:(e,t,o)=>{o.d(t,{A:()=>h});var r=o(89379),n=o(9950),i=o(93230),l=o(41413),a=o(77922),s=o(29925),c=o(26910),d=o(31222),x=o(44414);const h=(0,n.forwardRef)(((e,t)=>{let{setAppId:o,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:g,pill:j=!1,accentColor:b="#6366f1",icon:A,placeholder:f="Select Zone",paperComponent:v}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(b).concat(e),C=y("08"),z=y("26"),k=y("55"),D=y("18"),W=j?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:b},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(z)},"&.Mui-focused fieldset":{borderColor:b,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:b}}:{},I=j&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:D,color:b,transition:"background-color 0.15s, color 0.15s"},children:A||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(a.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,r.A)({},p),onChange:(e,t,r)=>{"clear"===r?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===o||void 0===o||o(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>j?(0,x.jsx)(s.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,placeholder:f,InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:I}),sx:(0,r.A)((0,r.A)({},W),g||m||{})})):(0,x.jsx)(s.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,r.A)({},g||m||{})}))})}))},96646:(e,t,o)=>{o.d(t,{r:()=>s});var r=o(9213),n=o(21671),i=o(82917),l=o(93230),a=o(44414);const s=e=>{let{rowsPerPage:t=5,col:o=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(r.A,{children:[(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,t)=>(0,a.jsx)(n.A,{children:(0,a.jsxs)(l.A,{spacing:.5,children:[(0,a.jsx)(i.A,{variant:"text",width:100}),(0,a.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:150})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(n.A,{align:"center",children:(0,a.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/6849.d98042c1.chunk.js b/build/static/js/6849.d98042c1.chunk.js deleted file mode 100644 index 6359599..0000000 --- a/build/static/js/6849.d98042c1.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6849],{35678:(e,t,o)=>{o.d(t,{A:()=>v});var r=o(9950),n=o(96583),i=o(40033),l=o(82053),a=o(28170),s=o(93230),c=o(82223),d=o(55916),x=o(4159),u=o.n(x),h=o(56712),p=o(81417),m=o(96600),g=o(53132),b=o(94289),A=o(57326),j=o(50624),f=o(44414);const v=e=>{let{open:t,onClose:o,onSelect:x}=e;const[v,w]=(0,r.useState)(null);return(0,f.jsxs)(n.A,{open:t,onClose:o,children:[(0,f.jsx)(i.A,{align:"left",children:(0,f.jsx)(l.A,{variant:"h4",children:"Select Filter Options"})}),(0,f.jsx)(a.A,{sx:{width:"100%"},className:"datedialog",children:(0,f.jsx)(d.U,{open:t,toggle:o,id:"daterange1",onChange:e=>{w({startDate:u()(e.startDate).format("YYYY-MM-DD"),endDate:u()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,h.A)(new Date,-1),endDate:(0,h.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,h.A)(new Date,1),endDate:(0,h.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,g.A)(new Date,-1)),endDate:(0,m.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,b.A)(new Date),endDate:(0,A.A)(new Date)},{label:"Last Month",startDate:(0,b.A)((0,j.A)(new Date,-1)),endDate:(0,A.A)((0,j.A)(new Date,-1))}]})}),(0,f.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,f.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),o()):o()},children:"OK"})})]})}},56311:(e,t,o)=>{o.d(t,{A:()=>h});var r=o(89379),n=o(9950),i=o(2660),l=o(2046),a=o(83274),s=o(25333),c=o(97125),d=o(7762),x=o(52097),u=o(44414);const h=e=>{let{value:t,onChange:o,onDebouncedChange:h,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const b=(0,n.useRef)(null),[A]=(0,x.d7)(t,p);return(0,n.useEffect)((()=>{h&&h(A)}),[A,h]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=b.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,u.jsx)(i.A,{sx:(0,r.A)({},g),inputRef:b,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,u.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,u.jsx)(c.A,{})}),endAdornment:(0,u.jsx)(a.A,{title:"Clear",children:(0,u.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>o(""),children:(0,u.jsx)(d.A,{})})})})}},56849:(e,t,o)=>{o.r(t),o.d(t,{default:()=>G});var r=o(89379),n=o(9950),i=o(26910),l=o(36150),a=o(2235),s=o(41413),c=o(83274),d=o(16491),x=o(82053),u=o(93230),h=o(60899),p=o(77922),m=o(29925),g=o(1320),b=o(15769),A=o(69780),j=o(9213),f=o(21671),v=o(34075),w=o(25333),S=o(33738),y=o(74745),C=o(25277),k=o(31222),D=o(4159),z=o.n(D),I=o(81425),W=o(52351),M=o(35678),P=o(59212),R=o(56311),N=o(96646),T=o(20466),O=o(44414),Y=o(36220);z().extend(Y);const F={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},L=(e,t)=>"".concat(e).concat(t),B=e=>L(e,"08"),E=e=>L(e,"18"),K=e=>L(e,"26"),H=e=>L(e,"55"),Z="#662582",q="#9255AB",U=e=>(0,O.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:F.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),X=e=>{let{color:t,selected:o,size:r=24,children:n}=e;return(0,O.jsx)(s.A,{sx:{width:r,height:r,bgcolor:o?t:E(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},$=e=>{let{color:t,icon:o,label:r,tooltip:n,minWidth:i=80}=e;return(0,O.jsx)(c.A,{title:n||"",placement:"top",children:(0,O.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:B(t),border:"1px solid ".concat(H(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[o,r]})})},_=e=>{let{value:t,color:o="#ef4444",icon:r}=e;const n=Number(t)||0;return 0===n?(0,O.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted,fontWeight:700},children:"0"}):(0,O.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:B(o),border:"1px solid ".concat(H(o)),color:o,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[r,n]})},J=e=>({"& .MuiOutlinedInput-root":{borderRadius:F.radiusPill+"px",bgcolor:B(e),fontWeight:600,"& fieldset":{borderColor:H(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(K(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}});function V(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function G(){const e=(0,n.useRef)(null),t=(0,n.useRef)(null),[o,D]=(0,n.useState)(0),[Y,L]=(0,n.useState)(z()().format("YYYY-MM-DD")),[G,Q]=(0,n.useState)(z()().format("YYYY-MM-DD")),[ee,te]=(0,n.useState)("All"),[oe,re]=(0,n.useState)(!1),[ne,ie]=(0,n.useState)(null),[le,ae]=(0,n.useState)("Today"),[se,ce]=(0,n.useState)([]),[de,xe]=(0,n.useState)(!1),[ue,he]=(0,n.useState)(0),[pe,me]=(0,n.useState)(0),[ge,be]=(0,n.useState)(null),[Ae,je]=(0,n.useState)(null),[fe,ve]=(0,n.useState)(""),[we,Se]=(0,n.useState)(""),[,ye]=(0,n.useState)(0);(0,n.useEffect)((()=>{me(0),be(null),he(0),je(null),ie(null)}),[o]),(0,n.useEffect)((()=>{he(0),je(null),ie(null)}),[pe]);const{data:Ce,isLoading:ke,isError:De,error:ze}=(0,l.I)({queryKey:[o,pe,ue,Y,G],queryFn:pe?I.U6:I.DK}),{data:Ie}=(0,l.I)({queryKey:["tenantlist",o],queryFn:()=>(0,I.Mn)(o),enabled:0!==o}),{data:We}=(0,l.I)({queryKey:["gettenantlocations",pe],queryFn:()=>(0,I.DL)(pe),enabled:0!==pe}),Me=(0,n.useMemo)((()=>Array.isArray(Ce)?Ce:[]),[Ce]),Pe=(0,n.useMemo)((()=>{if(!we)return Me;const e=we.toLowerCase().trim();return Me.filter((t=>[t.tenantname,t.locationname,String(t.tenantid||""),String(t.locationid||"")].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[Me,we]),Re=(0,n.useMemo)((()=>Pe.reduce(((e,t)=>(e.totalOrders+=Number(t.totalorders)||0,e.orderPend+=Number(t.Orderspending)||0,e.orderComplete+=Number(t.orderscompleted)||0,e.orderCancel+=Number(t.orderscancelled)||0,e.deliPend+=Number(t.deliveriespending)||0,e.deliComplete+=Number(t.deliveriescompleted)||0,e.deliCancel+=Number(t.deliveriescancelled)||0,e.collection+=Number(t.collectionamt)||0,e.kms+=Number(t.kms)||0,e.cumulativekms+=Number(t.cumulativekms)||0,e.amount+=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0),e)),{totalOrders:0,orderPend:0,orderComplete:0,orderCancel:0,deliPend:0,deliComplete:0,deliCancel:0,collection:0,kms:0,cumulativekms:0,amount:0})),[Pe]);De&&console.warn("ordersSummary error:",null===ze||void 0===ze?void 0:ze.message);const Ne=[{key:"orders",label:"Total Orders",color:Z,icon:k.F6S,value:Re.totalOrders},{key:"pending",label:"Orders Pending",color:"#f59e0b",icon:k.tX0,value:Re.orderPend},{key:"completed",label:"Orders Completed",color:"#10b981",icon:k.mU9,value:Re.orderComplete},{key:"amount",label:"Total Amount",color:"#0ea5e9",icon:k.YHz,value:V(Re.amount)}],Te=Boolean(pe);return(0,O.jsxs)(O.Fragment,{children:[(de||ke)&&(0,O.jsx)(W.A,{}),(0,O.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"linear-gradient(135deg, ".concat(B(Z)," 0%, ").concat(B(q)," 100%)"),boxShadow:F.shadowMd},children:(0,O.jsxs)(u.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,O.jsx)(s.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Z,color:"#fff",boxShadow:"0 6px 18px ".concat(K(Z))},children:(0,O.jsx)(k.GdF,{size:22})}),(0,O.jsxs)(u.A,{children:[(0,O.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders Summary"}),(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,O.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,O.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:600},children:["Live \xb7 ",ee||"All Zones"," \xb7 ",le]})]})]})]}),(0,O.jsx)(P.A,{ref:e,locaName:ee,setAppId:D,setLocoName:te,setPage:ye,pill:!0,accentColor:Z,icon:(0,O.jsx)(k.HPi,{size:14}),placeholder:"Select Zone",paperComponent:U,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,O.jsx)(h.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ne.map((e=>{const t=e.icon;return(0,O.jsx)(h.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,O.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:F.shadowMd,borderColor:H(e.color)}},children:[(0,O.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(E(e.color)," 100%)")}}),(0,O.jsxs)(u.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,O.jsxs)(u.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,O.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,O.jsx)(x.A,{sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,O.jsx)(s.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:E(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(H(e.color)),flexShrink:0},children:(0,O.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,O.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:F.radiusCard/8,borderTopRightRadius:F.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:F.borderSubtle,borderBottom:0,background:"#fff"},children:(0,O.jsxs)(u.A,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,O.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,O.jsxs)(d.A,{onClick:()=>re(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:B("#f59e0b"),border:"1.5px solid ".concat(H("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(K("#f59e0b"))}},children:[(0,O.jsx)(k.Ki0,{size:14}),"Orders \xb7 ",le," \xb7 ",z()(Y).format("DD/MM/YY")," \u2013 ",z()(G).format("DD/MM/YY")]})}),(0,O.jsx)(p.A,{options:Ie||[],value:ge,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||(null===e||void 0===e?void 0:e.label)||"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.tenantid)===(null===t||void 0===t?void 0:t.tenantid),PaperComponent:U,sx:(0,r.A)({minWidth:{xs:"100%",sm:220}},J(Z)),onOpen:t=>{o||(t.preventDefault(),(0,T.k)("Please select a Zone first!","warning",3e3),setTimeout((()=>{var t;return null===(t=e.current)||void 0===t?void 0:t.focus()}),0))},onChange:(e,t,o)=>{"clear"!==o&&t?(me((null===t||void 0===t?void 0:t.tenantid)||0),be(t),he((null===t||void 0===t?void 0:t.locationid)||0),je(null)):(me(0),be(null),he(0),je(null))},renderInput:e=>(0,O.jsx)(m.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,placeholder:"Select Tenant",size:"small",InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,O.jsx)(X,{color:Z,size:24,selected:Boolean(ge),children:(0,O.jsx)(k.nZo,{size:14})}),e.InputProps.startAdornment]})})}))}),(0,O.jsx)(p.A,{options:We||[],value:Ae,getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname).concat(e.suburb?" (".concat(e.suburb,")"):""):"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.locationid)===(null===t||void 0===t?void 0:t.locationid),PaperComponent:U,sx:(0,r.A)({minWidth:{xs:"100%",sm:220}},J("#0ea5e9")),onOpen:r=>{o||pe?pe||(r.preventDefault(),(0,T.k)("Please select a Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=t.current)||void 0===e?void 0:e.focus()}),0)):(r.preventDefault(),(0,T.k)("Please select Zone and Tenant first!","warning",3e3),setTimeout((()=>{var t;return null===(t=e.current)||void 0===t?void 0:t.focus()}),0))},onChange:(e,t,o)=>{"clear"!==o&&t?(he((null===t||void 0===t?void 0:t.locationid)||0),je(t)):(he(0),je(null))},renderInput:e=>(0,O.jsx)(m.A,(0,r.A)((0,r.A)({},e),{},{placeholder:"Select Location",size:"small",InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,O.jsx)(X,{color:"#0ea5e9",size:24,selected:Boolean(Ae),children:(0,O.jsx)(k.gwi,{size:14})}),e.InputProps.startAdornment]})})}))})]}),(0,O.jsx)(d.A,{sx:{width:{xs:"100%",md:280,lg:320},flex:{xs:"1 1 100%",md:"0 0 auto"}},children:(0,O.jsx)(R.A,{value:fe,onChange:ve,onDebouncedChange:Se,placeholder:"Search ".concat(Te?"locations":"tenants"," (ctrl+k)"),sx:{m:0,width:"100%",borderRadius:999,bgcolor:B(Z),"& fieldset":{borderColor:H(Z),borderWidth:1.5},"&:hover fieldset":{borderColor:Z},"&.Mui-focused fieldset":{borderColor:Z,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(K(Z))}}})})]})}),(0,O.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:F.radiusCard/8,borderBottomRightRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,overflow:"hidden",background:"#fff"},children:[(0,O.jsx)(g.A,{sx:{maxHeight:{xs:"calc(100vh - 280px)",md:"calc(100vh - 240px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:H(Z),borderRadius:8,"&:hover":{backgroundColor:Z}},"&::-webkit-scrollbar-track":{backgroundColor:F.surfaceAlt}},children:(0,O.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:1080,md:1200}},children:[(0,O.jsxs)(A.A,{children:[(0,O.jsxs)(j.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,O.jsx)(f.A,{rowSpan:2,children:"#"}),(0,O.jsx)(f.A,{rowSpan:2,children:Te?"Location":"Tenant"}),(0,O.jsx)(f.A,{align:"center",rowSpan:2,children:"All"}),(0,O.jsx)(f.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(B("#ef4444")," !important"),color:"#ef4444 !important"},children:"Orders"}),(0,O.jsx)(f.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(B("#10b981")," !important"),color:"#10b981 !important"},children:"Deliveries"}),(0,O.jsx)(f.A,{align:"center",rowSpan:2,children:"Collection"}),(0,O.jsx)(f.A,{align:"center",rowSpan:2,children:"KMS / Actual"}),(0,O.jsx)(f.A,{align:"center",rowSpan:2,children:"Amount"}),(0,O.jsx)(f.A,{align:"right",rowSpan:2,children:"Action"})]}),(0,O.jsxs)(j.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:{xs:10,md:10.5},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:{xs:.75,md:1},px:{xs:1,md:1.5}}},children:[(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#ef4444")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#ef4444")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#ef4444")," !important"),color:"#10b981 !important"},children:"Completed"}),(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#10b981")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#10b981")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,O.jsx)(f.A,{align:"center",sx:{bgcolor:"".concat(B("#10b981")," !important"),color:"#10b981 !important"},children:"Completed"})]})]}),(0,O.jsxs)(v.A,{children:[ke&&(0,O.jsx)(N.r,{col:9}),!ke&&0===Pe.length&&(0,O.jsx)(j.A,{children:(0,O.jsx)(f.A,{colSpan:13,sx:{py:6},children:(0,O.jsxs)(u.A,{alignItems:"center",spacing:1.5,children:[(0,O.jsx)(s.A,{sx:{width:64,height:64,bgcolor:E("#94a3b8"),color:F.textMuted},children:(0,O.jsx)(k.Z2J,{size:28})}),(0,O.jsxs)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:F.textPrimary},children:["No ",Te?"locations":"tenants"," to show"]}),(0,O.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary,textAlign:"center",maxWidth:360},children:we?"Try a different keyword.":De?"Something went wrong fetching the summary. Try a different filter.":"Pick a zone, tenant, or date range to load the summary."})]})})}),Pe.map(((e,t)=>{const o=Te?e.locationname:e.tenantname,r=ne===o,l=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,O.jsxs)(n.Fragment,{children:[(0,O.jsxs)(j.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:r?"none":"1px solid ".concat(F.divider),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:r?"#fff":F.surfaceAlt},bgcolor:r?B(Z):"transparent"},children:[(0,O.jsx)(f.A,{children:(0,O.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F.textMuted},children:String(t+1).padStart(2,"0")})}),(0,O.jsx)(f.A,{children:(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,O.jsx)(X,{color:Te?"#0ea5e9":Z,size:36,children:Te?(0,O.jsx)(k.gwi,{size:18}):(0,O.jsx)(k.nZo,{size:18})}),(0,O.jsxs)(u.A,{children:[(0,O.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:(Te?e.locationname:e.tenantname)||"\u2014"}),(0,O.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:["ID #",Te?e.locationid:e.tenantid]})]})]})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.totalorders,color:Z,icon:(0,O.jsx)(k.F6S,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.Orderspending,color:"#f59e0b",icon:(0,O.jsx)(k.tX0,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.orderscancelled,color:"#ef4444",icon:(0,O.jsx)(k.uDv,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.orderscompleted,color:"#10b981",icon:(0,O.jsx)(k.mU9,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,O.jsx)(k.tX0,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,O.jsx)(k.uDv,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,O.jsx)(k.mU9,{size:11})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)($,{color:"#f59e0b",icon:(0,O.jsx)(k.YHz,{size:11}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection Amount",minWidth:90})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsxs)(u.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,O.jsx)($,{color:"#ef4444",icon:(0,O.jsx)(k.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,O.jsx)($,{color:"#10b981",icon:(0,O.jsx)(k.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)($,{color:Z,icon:(0,O.jsx)(k.YHz,{size:11}),label:V(l).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,O.jsx)(f.A,{align:"right",children:(0,O.jsx)(c.A,{title:r?"Hide rider breakdown":"View rider breakdown",placement:"top",children:(0,O.jsx)(w.A,{size:"small",onClick:()=>{const t=!r;ie(t?o:null),t&&(ce([]),Te?(async e=>{xe(!0);try{var t;const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationsummary/?tenantid=").concat(pe,"&locationid=").concat(e,"&fromdate=").concat(Y,"&todate=").concat(G));ce(Array.isArray(null===(t=o.data)||void 0===t?void 0:t.details)?o.data.details:[])}catch(o){(0,T.k)((null===o||void 0===o?void 0:o.message)||"Failed to load rider breakdown","error",2e3),ce([])}finally{xe(!1)}})(e.locationid):(async e=>{xe(!0);try{var t;const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getuserreportsummary/?tenantid=").concat(e,"&fromdate=").concat(Y,"&todate=").concat(G));ce(Array.isArray(null===(t=o.data)||void 0===t?void 0:t.details)?o.data.details:[])}catch(o){(0,T.k)((null===o||void 0===o?void 0:o.message)||"Failed to load rider breakdown","error",2e3),ce([])}finally{xe(!1)}})(e.tenantid))},sx:{bgcolor:r?Z:E(Z),color:r?"#fff":Z,border:"1px solid ".concat(H(Z)),"&:hover":{bgcolor:Z,color:"#fff"}},children:r?(0,O.jsx)(k.Xbk,{size:16}):(0,O.jsx)(k.j1Q,{size:16})})})})]}),r&&(0,O.jsx)(j.A,{children:(0,O.jsx)(f.A,{colSpan:13,sx:{p:0,borderBottom:"1px solid ".concat(F.divider),bgcolor:B(Z)},children:(0,O.jsx)(S.A,{in:r,timeout:"auto",unmountOnExit:!0,children:(0,O.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,O.jsxs)(a.A,{elevation:0,sx:{borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,overflow:"hidden",boxShadow:F.shadowSoft},children:[(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(B(Z)," 0%, ").concat(B(q)," 100%)"),borderBottom:"1px solid ".concat(F.borderSubtle)},children:[(0,O.jsx)(X,{color:Z,size:28,selected:!0,children:(0,O.jsx)(k.Itr,{size:14})}),(0,O.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Rider Breakdown \xb7 ",Te?e.locationname:e.tenantname]})]}),(0,O.jsxs)(b.A,{size:"small",children:[(0,O.jsx)(A.A,{children:(0,O.jsxs)(j.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:1,px:1.5}},children:[(0,O.jsx)(f.A,{children:"#"}),(0,O.jsx)(f.A,{children:"Rider"}),(0,O.jsx)(f.A,{align:"center",children:"Orders"}),(0,O.jsx)(f.A,{align:"center",children:"Deliveries"}),(0,O.jsx)(f.A,{align:"center",children:"Pending"}),(0,O.jsx)(f.A,{align:"center",children:"Cancelled"}),(0,O.jsx)(f.A,{align:"center",children:"Completed"}),(0,O.jsx)(f.A,{align:"center",children:"Collection"}),(0,O.jsx)(f.A,{align:"center",children:"KMS / Actual"}),(0,O.jsx)(f.A,{align:"center",children:"Amount"})]})}),(0,O.jsxs)(v.A,{children:[de&&(0,O.jsx)(N.r,{col:6}),de||se&&0!==se.length?se.map(((e,t)=>{const o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,O.jsxs)(j.A,{sx:{"& td":{borderBottom:"1px solid ".concat(F.divider),py:1,px:1.5},"&:hover":{backgroundColor:F.surfaceAlt}},children:[(0,O.jsx)(f.A,{children:(0,O.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F.textMuted},children:String(t+1).padStart(2,"0")})}),(0,O.jsx)(f.A,{children:(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,O.jsx)(X,{color:Z,size:28,children:(0,O.jsx)(k.LTk,{size:14})}),(0,O.jsxs)(u.A,{children:[(0,O.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"\u2014"}),(0,O.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:e.ridercontact||"ID #".concat(e.userid)})]})]})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.orderscreated,color:Z,icon:(0,O.jsx)(k.F6S,{size:10})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.totalorders,color:"#0ea5e9",icon:(0,O.jsx)(k.F6S,{size:10})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriespending,color:"#f59e0b",icon:(0,O.jsx)(k.tX0,{size:10})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,O.jsx)(k.uDv,{size:10})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)(_,{value:e.deliveriescompleted,color:"#10b981",icon:(0,O.jsx)(k.mU9,{size:10})})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)($,{color:"#f59e0b",icon:(0,O.jsx)(k.YHz,{size:10}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection",minWidth:80})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsxs)(u.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,O.jsx)($,{color:"#ef4444",icon:(0,O.jsx)(k.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,O.jsx)($,{color:"#10b981",icon:(0,O.jsx)(k.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,O.jsx)(f.A,{align:"center",children:(0,O.jsx)($,{color:Z,icon:(0,O.jsx)(k.YHz,{size:10}),label:V(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.userid,"-").concat(t))})):(0,O.jsx)(j.A,{children:(0,O.jsx)(f.A,{colSpan:10,sx:{py:3},children:(0,O.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted,textAlign:"center",display:"block"},children:"No rider activity for this row."})})})]})]})]})})})})})]},"".concat(o,"-").concat(t))}))]})]})}),Pe.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(y.A,{}),(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1.5,flexWrap:"wrap",sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(B(Z)," 0%, ").concat(B(q)," 100%)")},children:[(0,O.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,flexWrap:"wrap",children:[(0,O.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,O.jsx)(C.A,{size:"small",label:"".concat(Re.totalOrders," orders"),sx:{fontWeight:700,bgcolor:E(Z),color:Z,border:"1px solid ".concat(H(Z))}}),(0,O.jsx)(C.A,{size:"small",label:"".concat(Re.deliComplete," delivered"),sx:{fontWeight:700,bgcolor:E("#10b981"),color:"#10b981",border:"1px solid ".concat(H("#10b981"))}}),(0,O.jsx)(C.A,{size:"small",label:"".concat(Re.deliPend," pending"),sx:{fontWeight:700,bgcolor:E("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(H("#f59e0b"))}})]}),(0,O.jsx)(C.A,{label:V(Re.amount),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(Z," 0%, ").concat(q," 100%)"),boxShadow:"0 6px 16px ".concat(K(Z))}})]})]})]}),(0,O.jsx)(M.A,{open:oe,onClose:()=>re(!1),onSelect:e=>{L(e.startDate),Q(e.endDate),ae(e.label)}})]})}},59212:(e,t,o)=>{o.d(t,{A:()=>u});var r=o(89379),n=o(9950),i=o(93230),l=o(41413),a=o(77922),s=o(29925),c=o(26910),d=o(31222),x=o(44414);const u=(0,n.forwardRef)(((e,t)=>{let{setAppId:o,setLocoName:u,setPage:h,sx:p,textfeildSx:m,textfieldSx:g,pill:b=!1,accentColor:A="#6366f1",icon:j,placeholder:f="Select Zone",paperComponent:v}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(A).concat(e),C=y("08"),k=y("26"),D=y("55"),z=y("18"),I=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:D,borderWidth:1.5},"&:hover fieldset":{borderColor:A},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(k)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:A}}:{},W=b&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:z,color:A,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(a.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,r.A)({},p),onChange:(e,t,r)=>{"clear"===r?(null===o||void 0===o||o(0),null===u||void 0===u||u(""),null===h||void 0===h||h(0)):t&&(null===o||void 0===o||o(t.applocationid),null===u||void 0===u||u(t.locationname),null===h||void 0===h||h(0))},renderInput:e=>b?(0,x.jsx)(s.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,placeholder:f,InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:W}),sx:(0,r.A)((0,r.A)({},I),g||m||{})})):(0,x.jsx)(s.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,r.A)({},g||m||{})}))})}))},96646:(e,t,o)=>{o.d(t,{r:()=>s});var r=o(9213),n=o(21671),i=o(82917),l=o(93230),a=o(44414);const s=e=>{let{rowsPerPage:t=5,col:o=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(r.A,{children:[(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,t)=>(0,a.jsx)(n.A,{children:(0,a.jsxs)(l.A,{spacing:.5,children:[(0,a.jsx)(i.A,{variant:"text",width:100}),(0,a.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:150})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(n.A,{align:"center",children:(0,a.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/7157.5fea29d8.chunk.js b/build/static/js/7157.5fea29d8.chunk.js new file mode 100644 index 0000000..2c9d273 --- /dev/null +++ b/build/static/js/7157.5fea29d8.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7157],{23787:(e,r,o)=>{o.d(r,{FG:()=>p,nV:()=>x,pY:()=>g,pg:()=>h});var i=o(89379),n=o(80045),t=o(93230),s=o(2235),l=o(16491),c=o(82053),a=o(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:r,scroll:o=!1,onScroll:s,sx:l}=e,c=(0,n.A)(e,d);return(0,a.jsx)(t.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:s,sx:(0,i.A)((0,i.A)({p:1.5},o&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},c),{},{children:r}))},h=e=>{let{accent:r="#662582",header:o,footer:n,selected:t=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(s.A,{elevation:0,onClick:c,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?r:"#e2e8f0",background:t?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,a.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[o,d,n]})]})},p=e=>{let{children:r,columns:o=2,sx:n}=e;return(0,a.jsx)(l.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(o,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:r})},g=e=>{let{label:r,value:o,children:i,full:n=!1,align:t="left"}=e;return(0,a.jsxs)(l.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,a.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==o&&void 0!==o?o:"\u2014"})})]})}},56311:(e,r,o)=>{o.d(r,{A:()=>p});var i=o(89379),n=o(9950),t=o(2660),s=o(2046),l=o(83274),c=o(25333),a=o(97125),d=o(7762),x=o(52097),h=o(44414);const p=e=>{let{value:r,onChange:o,onDebouncedChange:p,debounceTime:g=500,placeholder:m="Search (ctrl+k)",sx:b}=e;const u=(0,n.useRef)(null),[j]=(0,x.d7)(r,g);return(0,n.useEffect)((()=>{p&&p(j)}),[j,p]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=u.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===u.current&&u.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(t.A,{sx:(0,i.A)({},b),inputRef:u,placeholder:m,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,r,o)=>{o.d(r,{A:()=>h});var i=o(89379),n=o(9950),t=o(93230),s=o(41413),l=o(77922),c=o(29925),a=o(26910),d=o(31222),x=o(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:o,setLocoName:h,setPage:p,sx:g,textfeildSx:m,textfieldSx:b,pill:u=!1,accentColor:j="#6366f1",icon:A,placeholder:f="Select Zone",paperComponent:v}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const k=e=>"".concat(j).concat(e),y=k("08"),C=k("26"),I=k("55"),z=k("18"),W=u?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:y,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:I,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},R=u&&(0,x.jsx)(t.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:z,color:j,transition:"background-color 0.15s, color 0.15s"},children:A||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,i.A)({},g),onChange:(e,r,i)=>{"clear"===i?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):r&&(null===o||void 0===o||o(r.applocationid),null===h||void 0===h||h(r.locationname),null===p||void 0===p||p(0))},renderInput:e=>u?(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:r,placeholder:f,InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:R}),sx:(0,i.A)((0,i.A)({},W),b||m||{})})):(0,x.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,i.A)({},b||m||{})}))})}))},96646:(e,r,o)=>{o.d(r,{r:()=>c});var i=o(9213),n=o(21671),t=o(82917),s=o(93230),l=o(44414);const c=e=>{let{rowsPerPage:r=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(i.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(t.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(t.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(t.A,{variant:"text",width:100}),(0,l.jsx)(t.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(t.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(t.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(t.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(t.A,{variant:"circular",width:28,height:28})]})})]},r)))})}},97157:(e,r,o)=>{o.r(r),o.d(r,{default:()=>_});var i=o(89379),n=o(9950),t=o(2235),s=o(41413),l=o(16491),c=o(14857),a=o(47223),d=o(93230),x=o(82053),h=o(60899),p=o(1320),g=o(15769),m=o(69780),b=o(9213),u=o(21671),j=o(34075),A=o(31222),f=o(36150),v=o(52351),w=o(56311),S=o(59212),k=o(23787),y=o(96646),C=o(81425),I=o(44414);const z=16,W="0 8px 24px rgba(15, 23, 42, 0.08)",R="0 18px 50px rgba(15, 23, 42, 0.18)",M="#0f172a",P="#64748b",L="#94a3b8",B="#e2e8f0",F="#f1f5f9",N="#f8fafc",T=(e,r)=>"".concat(e).concat(r),J=e=>T(e,"08"),D=e=>T(e,"18"),H=e=>T(e,"26"),K=e=>T(e,"55"),O="#662582",E=e=>(0,I.jsx)(t.A,(0,i.A)((0,i.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:R,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Y=e=>{let{color:r,selected:o,size:i=24,children:n}=e;return(0,I.jsx)(s.A,{sx:{width:i,height:i,bgcolor:o?r:D(r),color:o?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},Z=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0),G=e=>new Intl.NumberFormat("en-IN",{minimumFractionDigits:2}).format(Number(e)||0),$=e=>{let{color:r,icon:o,label:i,width:n}=e;return(0,I.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:J(r),border:"1px solid ".concat(K(r)),color:r,fontSize:11,fontWeight:800,minWidth:n,justifyContent:"center"},children:[o,i]})},_=()=>{const e=(0,c.A)(),r=(0,a.A)(e.breakpoints.down("md")),o=(0,n.useRef)(),[i,R]=(0,n.useState)(0),[T,_]=(0,n.useState)("All"),[q,V]=(0,n.useState)(""),[X,Q]=(0,n.useState)(""),{data:U=[],isLoading:ee}=(0,f.I)({queryKey:["getallpricing",i],queryFn:C.OM,keepPreviousData:!0}),re=(0,n.useMemo)((()=>{if(!X)return U;const e=X.toLowerCase().trim();return U.filter((r=>[r.applocation,r.appname,r.slab,String(r.pricingid)].filter(Boolean).some((r=>String(r).toLowerCase().includes(e)))))}),[U,X]),oe=(0,n.useMemo)((()=>{const e=U.length;return{total:e,tenants:new Set(U.map((e=>e.appname)).filter(Boolean)).size,avgBase:e?U.reduce(((e,r)=>e+(Number(r.baseprice)||0)),0)/e:0}}),[U]),ie=[{key:"total",label:"Total Pricing Slabs",color:O,icon:A.JL6,value:oe.total},{key:"tenants",label:"Tenants Priced",color:"#0ea5e9",icon:A.Itr,value:oe.tenants},{key:"avg",label:"Avg Base Price",color:"#f59e0b",icon:A.H4F,value:Z(oe.avgBase)},{key:"zone",label:"Active Zone",color:"#10b981",icon:A.JFD,value:T||"All Zones"}];return(0,I.jsxs)(I.Fragment,{children:[ee&&(0,I.jsx)(v.A,{}),(0,I.jsx)(t.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:z/8,border:"1px solid",borderColor:B,background:"linear-gradient(135deg, ".concat(J(O)," 0%, ").concat(J("#9255AB")," 100%)"),boxShadow:W},children:(0,I.jsxs)(d.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,I.jsx)(s.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:O,color:"#fff",boxShadow:"0 6px 18px ".concat(H(O))},children:(0,I.jsx)(A.JL6,{size:22})}),(0,I.jsxs)(d.A,{children:[(0,I.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:M,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Pricing"}),(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,I.jsx)(l.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,I.jsxs)(x.A,{variant:"caption",sx:{color:P,fontWeight:600},children:["Live \xb7 ",T||"All Zones"]})]})]})]}),(0,I.jsx)(S.A,{locaName:T,setAppId:R,setLocoName:_,pill:!0,accentColor:O,icon:(0,I.jsx)(A.HPi,{size:14}),placeholder:"Select Zone",paperComponent:E,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,I.jsx)(h.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:ie.map((e=>{const r=e.icon;return(0,I.jsx)(h.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,I.jsxs)(t.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:z/8,border:"1px solid",borderColor:B,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:W,borderColor:K(e.color)}},children:[(0,I.jsx)(l.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(D(e.color)," 100%)")}}),(0,I.jsxs)(d.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,I.jsxs)(d.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,I.jsx)(x.A,{variant:"caption",sx:{color:P,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,I.jsx)(x.A,{sx:{fontWeight:800,color:M,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,I.jsx)(s.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:D(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(K(e.color)),flexShrink:0},children:(0,I.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,I.jsx)(t.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:z/8,borderTopRightRadius:z/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:B,borderBottom:0,background:"#fff"},children:(0,I.jsxs)(d.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,I.jsx)(Y,{color:O,size:32,children:(0,I.jsx)(A.JL6,{size:18})}),(0,I.jsxs)(d.A,{children:[(0,I.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:P,letterSpacing:.6,textTransform:"uppercase"},children:"Pricing Catalog"}),(0,I.jsxs)(x.A,{variant:"body2",sx:{color:M,fontWeight:700},children:[U.length," total \xb7 ",re.length," shown"]})]})]}),(0,I.jsx)(l.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,I.jsx)(w.A,{value:q,onChange:V,onDebouncedChange:Q,placeholder:"Search pricing (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:J(O),"& fieldset":{borderColor:K(O),borderWidth:1.5},"&:hover fieldset":{borderColor:O},"&.Mui-focused fieldset":{borderColor:O,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(H(O))}}})})]})}),(0,I.jsx)(t.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:z/8,borderBottomRightRadius:z/8,border:"1px solid",borderColor:B,overflow:"hidden",background:"#fff"},children:r?0!==re.length||ee?(0,I.jsx)(k.nV,{scroll:!0,children:re.map(((e,r)=>{var o;return(0,I.jsxs)(k.pg,{accent:O,header:(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,I.jsx)(Y,{color:O,size:36,children:(0,I.jsx)(A.Itr,{size:18})}),(0,I.jsxs)(d.A,{sx:{minWidth:0},children:[(0,I.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:M},noWrap:!0,children:e.appname||"\u2014"}),(0,I.jsxs)(x.A,{variant:"caption",sx:{color:P},children:["ID #",e.pricingid]})]})]}),(0,I.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:L,flexShrink:0},children:String(r+1).padStart(2,"0")})]}),children:[(0,I.jsxs)(d.A,{direction:"row",spacing:.75,sx:{mt:1,flexWrap:"wrap",gap:.75},children:[e.applocation?(0,I.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:J("#10b981"),border:"1px solid ".concat(K("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,I.jsx)(A.JFD,{size:12})," ",e.applocation]}):null,(0,I.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:J("#0ea5e9"),border:"1px solid ".concat(K("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,I.jsx)(A.BJM,{size:12})," ",e.slab||"\u2014"]})]}),(0,I.jsxs)(k.FG,{children:[(0,I.jsx)(k.pY,{label:"Base Price",children:(0,I.jsx)($,{color:O,icon:(0,I.jsx)(A.bmp,{size:12}),label:Z(e.baseprice)})}),(0,I.jsx)(k.pY,{label:"Price / KM",children:(0,I.jsx)($,{color:"#10b981",icon:(0,I.jsx)(A.H4F,{size:12}),label:Z(e.priceperkm)})}),(0,I.jsx)(k.pY,{label:"Min KM",children:(0,I.jsx)($,{color:"#f59e0b",icon:(0,I.jsx)(A.xI$,{size:12}),label:"".concat(G(e.minkm)," km")})}),(0,I.jsx)(k.pY,{label:"Max KM",children:(0,I.jsx)($,{color:"#ef4444",icon:(0,I.jsx)(A.xI$,{size:12}),label:"".concat(G(e.maxkm)," km")})}),(0,I.jsx)(k.pY,{label:"Min Orders",children:(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,I.jsx)(A.GdF,{size:14,color:L}),(0,I.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:M},children:null!==(o=e.minorder)&&void 0!==o?o:"\u2014"})]})})]})]},e.pricingid||"".concat(e.appname,"-").concat(r))}))}):(0,I.jsxs)(d.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,I.jsx)(s.A,{sx:{width:64,height:64,bgcolor:D("#94a3b8"),color:L},children:(0,I.jsx)(A.JL6,{size:28})}),(0,I.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:M},children:"No pricing to show"}),(0,I.jsx)(x.A,{variant:"caption",sx:{color:P,textAlign:"center"},children:q?"Try a different keyword.":"Pick a zone above to load the catalog."})]}):(0,I.jsx)(p.A,{ref:o,sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:K(O),borderRadius:8,"&:hover":{backgroundColor:O}},"&::-webkit-scrollbar-track":{backgroundColor:N}},children:(0,I.jsxs)(g.A,{stickyHeader:!0,sx:{minWidth:{xs:860,md:1080}},children:[(0,I.jsx)(m.A,{children:(0,I.jsxs)(b.A,{sx:{"& th":{backgroundColor:N,color:P,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(B),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,I.jsx)(u.A,{children:"#"}),(0,I.jsx)(u.A,{children:"Tenant"}),(0,I.jsx)(u.A,{children:"Zone"}),(0,I.jsx)(u.A,{children:"Slab"}),(0,I.jsx)(u.A,{align:"center",children:"Base Price"}),(0,I.jsx)(u.A,{align:"center",children:"Min KM"}),(0,I.jsx)(u.A,{align:"center",children:"Price / KM"}),(0,I.jsx)(u.A,{align:"center",children:"Max KM"}),(0,I.jsx)(u.A,{align:"center",children:"Min Orders"})]})}),(0,I.jsxs)(j.A,{children:[ee&&(0,I.jsx)(y.r,{col:5}),0!==re.length||ee?re.map(((e,r)=>{var o;return(0,I.jsxs)(b.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(F),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:N}},children:[(0,I.jsx)(u.A,{children:(0,I.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:L},children:String(r+1).padStart(2,"0")})}),(0,I.jsx)(u.A,{children:(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,I.jsx)(Y,{color:O,size:36,children:(0,I.jsx)(A.Itr,{size:18})}),(0,I.jsxs)(d.A,{children:[(0,I.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:M,whiteSpace:"nowrap"},children:e.appname||"\u2014"}),(0,I.jsxs)(x.A,{variant:"caption",sx:{color:P},children:["ID #",e.pricingid]})]})]})}),(0,I.jsx)(u.A,{children:e.applocation?(0,I.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:J("#10b981"),border:"1px solid ".concat(K("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,I.jsx)(A.JFD,{size:12})," ",e.applocation]}):(0,I.jsx)(x.A,{variant:"caption",sx:{color:L},children:"\u2014"})}),(0,I.jsx)(u.A,{children:(0,I.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:J("#0ea5e9"),border:"1px solid ".concat(K("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,I.jsx)(A.BJM,{size:12})," ",e.slab||"\u2014"]})}),(0,I.jsx)(u.A,{align:"center",children:(0,I.jsx)($,{color:O,icon:(0,I.jsx)(A.bmp,{size:12}),label:Z(e.baseprice),width:110})}),(0,I.jsx)(u.A,{align:"center",children:(0,I.jsx)($,{color:"#f59e0b",icon:(0,I.jsx)(A.xI$,{size:12}),label:"".concat(G(e.minkm)," km"),width:90})}),(0,I.jsx)(u.A,{align:"center",children:(0,I.jsx)($,{color:"#10b981",icon:(0,I.jsx)(A.H4F,{size:12}),label:Z(e.priceperkm),width:110})}),(0,I.jsx)(u.A,{align:"center",children:(0,I.jsx)($,{color:"#ef4444",icon:(0,I.jsx)(A.xI$,{size:12}),label:"".concat(G(e.maxkm)," km"),width:90})}),(0,I.jsx)(u.A,{align:"center",children:(0,I.jsxs)(d.A,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.5,children:[(0,I.jsx)(A.GdF,{size:14,color:L}),(0,I.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:M,whiteSpace:"nowrap"},children:null!==(o=e.minorder)&&void 0!==o?o:"\u2014"})]})})]},e.pricingid||"".concat(e.appname,"-").concat(r))})):(0,I.jsx)(b.A,{children:(0,I.jsx)(u.A,{colSpan:9,sx:{py:6},children:(0,I.jsxs)(d.A,{alignItems:"center",spacing:1.5,children:[(0,I.jsx)(s.A,{sx:{width:64,height:64,bgcolor:D("#94a3b8"),color:L},children:(0,I.jsx)(A.JL6,{size:28})}),(0,I.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:M},children:"No pricing to show"}),(0,I.jsx)(x.A,{variant:"caption",sx:{color:P},children:q?"Try a different keyword.":"Pick a zone above to load the catalog."})]})})})]})]})})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/7157.a80416ea.chunk.js b/build/static/js/7157.a80416ea.chunk.js deleted file mode 100644 index 9ec8a33..0000000 --- a/build/static/js/7157.a80416ea.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7157],{56311:(e,r,o)=>{o.d(r,{A:()=>p});var t=o(89379),n=o(9950),i=o(2660),s=o(2046),l=o(83274),c=o(25333),a=o(97125),d=o(7762),x=o(52097),h=o(44414);const p=e=>{let{value:r,onChange:o,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:m}=e;const b=(0,n.useRef)(null),[A]=(0,x.d7)(r,g);return(0,n.useEffect)((()=>{p&&p(A)}),[A,p]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=b.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,t.A)({},m),inputRef:b,placeholder:u,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,r,o)=>{o.d(r,{A:()=>h});var t=o(89379),n=o(9950),i=o(93230),s=o(41413),l=o(77922),c=o(29925),a=o(26910),d=o(31222),x=o(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:o,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:m,pill:b=!1,accentColor:A="#6366f1",icon:f,placeholder:j="Select Zone",paperComponent:v}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const k=e=>"".concat(A).concat(e),y=k("08"),C=k("26"),I=k("55"),R=k("18"),z=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:y,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:I,borderWidth:1.5},"&:hover fieldset":{borderColor:A},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:A}}:{},W=b&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:R,color:A,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,t.A)({},g),onChange:(e,r,t)=>{"clear"===t?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):r&&(null===o||void 0===o||o(r.applocationid),null===h||void 0===h||h(r.locationname),null===p||void 0===p||p(0))},renderInput:e=>b?(0,x.jsx)(c.A,(0,t.A)((0,t.A)({},e),{},{inputRef:r,placeholder:j,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:W}),sx:(0,t.A)((0,t.A)({},z),m||u||{})})):(0,x.jsx)(c.A,(0,t.A)((0,t.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,t.A)({},m||u||{})}))})}))},96646:(e,r,o)=>{o.d(r,{r:()=>c});var t=o(9213),n=o(21671),i=o(82917),s=o(93230),l=o(44414);const c=e=>{let{rowsPerPage:r=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(t.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}},97157:(e,r,o)=>{o.r(r),o.d(r,{default:()=>_});var t=o(89379),n=o(9950),i=o(2235),s=o(41413),l=o(16491),c=o(93230),a=o(82053),d=o(60899),x=o(1320),h=o(15769),p=o(69780),g=o(9213),u=o(21671),m=o(34075),b=o(31222),A=o(36150),f=o(52351),j=o(56311),v=o(59212),w=o(96646),S=o(81425),k=o(44414);const y=16,C="0 8px 24px rgba(15, 23, 42, 0.08)",I="0 18px 50px rgba(15, 23, 42, 0.18)",R="#0f172a",z="#64748b",W="#94a3b8",L="#e2e8f0",M="#f1f5f9",P="#f8fafc",B=(e,r)=>"".concat(e).concat(r),N=e=>B(e,"08"),F=e=>B(e,"18"),T=e=>B(e,"26"),D=e=>B(e,"55"),J="#662582",E=e=>(0,k.jsx)(i.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:I,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),H=e=>{let{color:r,selected:o,size:t=24,children:n}=e;return(0,k.jsx)(s.A,{sx:{width:t,height:t,bgcolor:o?r:F(r),color:o?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},O=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0),Z=e=>new Intl.NumberFormat("en-IN",{minimumFractionDigits:2}).format(Number(e)||0),K=e=>{let{color:r,icon:o,label:t,width:n}=e;return(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N(r),border:"1px solid ".concat(D(r)),color:r,fontSize:11,fontWeight:800,minWidth:n,justifyContent:"center"},children:[o,t]})},_=()=>{const e=(0,n.useRef)(),[r,o]=(0,n.useState)(0),[t,I]=(0,n.useState)("All"),[B,_]=(0,n.useState)(""),[q,$]=(0,n.useState)(""),{data:G=[],isLoading:Y}=(0,A.I)({queryKey:["getallpricing",r],queryFn:S.OM,keepPreviousData:!0}),Q=(0,n.useMemo)((()=>{if(!q)return G;const e=q.toLowerCase().trim();return G.filter((r=>[r.applocation,r.appname,r.slab,String(r.pricingid)].filter(Boolean).some((r=>String(r).toLowerCase().includes(e)))))}),[G,q]),U=(0,n.useMemo)((()=>{const e=G.length;return{total:e,tenants:new Set(G.map((e=>e.appname)).filter(Boolean)).size,avgBase:e?G.reduce(((e,r)=>e+(Number(r.baseprice)||0)),0)/e:0}}),[G]),V=[{key:"total",label:"Total Pricing Slabs",color:J,icon:b.JL6,value:U.total},{key:"tenants",label:"Tenants Priced",color:"#0ea5e9",icon:b.Itr,value:U.tenants},{key:"avg",label:"Avg Base Price",color:"#f59e0b",icon:b.H4F,value:O(U.avgBase)},{key:"zone",label:"Active Zone",color:"#10b981",icon:b.JFD,value:t||"All Zones"}];return(0,k.jsxs)(k.Fragment,{children:[Y&&(0,k.jsx)(f.A,{}),(0,k.jsx)(i.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:y/8,border:"1px solid",borderColor:L,background:"linear-gradient(135deg, ".concat(N(J)," 0%, ").concat(N("#9255AB")," 100%)"),boxShadow:C},children:(0,k.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,k.jsx)(s.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:J,color:"#fff",boxShadow:"0 6px 18px ".concat(T(J))},children:(0,k.jsx)(b.JL6,{size:22})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"h3",sx:{fontWeight:800,color:R,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Pricing"}),(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,k.jsx)(l.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,k.jsxs)(a.A,{variant:"caption",sx:{color:z,fontWeight:600},children:["Live \xb7 ",t||"All Zones"]})]})]})]}),(0,k.jsx)(v.A,{locaName:t,setAppId:o,setLocoName:I,pill:!0,accentColor:J,icon:(0,k.jsx)(b.HPi,{size:14}),placeholder:"Select Zone",paperComponent:E,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,k.jsx)(d.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:V.map((e=>{const r=e.icon;return(0,k.jsx)(d.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,k.jsxs)(i.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:y/8,border:"1px solid",borderColor:L,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:C,borderColor:D(e.color)}},children:[(0,k.jsx)(l.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(F(e.color)," 100%)")}}),(0,k.jsxs)(c.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,k.jsxs)(c.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,k.jsx)(a.A,{variant:"caption",sx:{color:z,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,k.jsx)(a.A,{sx:{fontWeight:800,color:R,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,k.jsx)(s.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:F(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(D(e.color)),flexShrink:0},children:(0,k.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,k.jsx)(i.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:y/8,borderTopRightRadius:y/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:L,borderBottom:0,background:"#fff"},children:(0,k.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,k.jsx)(H,{color:J,size:32,children:(0,k.jsx)(b.JL6,{size:18})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"caption",sx:{fontWeight:800,color:z,letterSpacing:.6,textTransform:"uppercase"},children:"Pricing Catalog"}),(0,k.jsxs)(a.A,{variant:"body2",sx:{color:R,fontWeight:700},children:[G.length," total \xb7 ",Q.length," shown"]})]})]}),(0,k.jsx)(l.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,k.jsx)(j.A,{value:B,onChange:_,onDebouncedChange:$,placeholder:"Search pricing (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:N(J),"& fieldset":{borderColor:D(J),borderWidth:1.5},"&:hover fieldset":{borderColor:J},"&.Mui-focused fieldset":{borderColor:J,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(T(J))}}})})]})}),(0,k.jsx)(i.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:y/8,borderBottomRightRadius:y/8,border:"1px solid",borderColor:L,overflow:"hidden",background:"#fff"},children:(0,k.jsx)(x.A,{ref:e,sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:D(J),borderRadius:8,"&:hover":{backgroundColor:J}},"&::-webkit-scrollbar-track":{backgroundColor:P}},children:(0,k.jsxs)(h.A,{stickyHeader:!0,sx:{minWidth:{xs:860,md:1080}},children:[(0,k.jsx)(p.A,{children:(0,k.jsxs)(g.A,{sx:{"& th":{backgroundColor:P,color:z,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(L),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,k.jsx)(u.A,{children:"#"}),(0,k.jsx)(u.A,{children:"Tenant"}),(0,k.jsx)(u.A,{children:"Zone"}),(0,k.jsx)(u.A,{children:"Slab"}),(0,k.jsx)(u.A,{align:"center",children:"Base Price"}),(0,k.jsx)(u.A,{align:"center",children:"Min KM"}),(0,k.jsx)(u.A,{align:"center",children:"Price / KM"}),(0,k.jsx)(u.A,{align:"center",children:"Max KM"}),(0,k.jsx)(u.A,{align:"center",children:"Min Orders"})]})}),(0,k.jsxs)(m.A,{children:[Y&&(0,k.jsx)(w.r,{col:5}),0!==Q.length||Y?Q.map(((e,r)=>{var o;return(0,k.jsxs)(g.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(M),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:P}},children:[(0,k.jsx)(u.A,{children:(0,k.jsx)(a.A,{variant:"caption",sx:{fontWeight:700,color:W},children:String(r+1).padStart(2,"0")})}),(0,k.jsx)(u.A,{children:(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,k.jsx)(H,{color:J,size:36,children:(0,k.jsx)(b.Itr,{size:18})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"subtitle2",sx:{fontWeight:700,color:R,whiteSpace:"nowrap"},children:e.appname||"\u2014"}),(0,k.jsxs)(a.A,{variant:"caption",sx:{color:z},children:["ID #",e.pricingid]})]})]})}),(0,k.jsx)(u.A,{children:e.applocation?(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N("#10b981"),border:"1px solid ".concat(D("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,k.jsx)(b.JFD,{size:12})," ",e.applocation]}):(0,k.jsx)(a.A,{variant:"caption",sx:{color:W},children:"\u2014"})}),(0,k.jsx)(u.A,{children:(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N("#0ea5e9"),border:"1px solid ".concat(D("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,k.jsx)(b.BJM,{size:12})," ",e.slab||"\u2014"]})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:J,icon:(0,k.jsx)(b.bmp,{size:12}),label:O(e.baseprice),width:110})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#f59e0b",icon:(0,k.jsx)(b.xI$,{size:12}),label:"".concat(Z(e.minkm)," km"),width:90})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#10b981",icon:(0,k.jsx)(b.H4F,{size:12}),label:O(e.priceperkm),width:110})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#ef4444",icon:(0,k.jsx)(b.xI$,{size:12}),label:"".concat(Z(e.maxkm)," km"),width:90})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.5,children:[(0,k.jsx)(b.GdF,{size:14,color:W}),(0,k.jsx)(a.A,{variant:"subtitle2",sx:{fontWeight:700,color:R,whiteSpace:"nowrap"},children:null!==(o=e.minorder)&&void 0!==o?o:"\u2014"})]})})]},e.pricingid||"".concat(e.appname,"-").concat(r))})):(0,k.jsx)(g.A,{children:(0,k.jsx)(u.A,{colSpan:9,sx:{py:6},children:(0,k.jsxs)(c.A,{alignItems:"center",spacing:1.5,children:[(0,k.jsx)(s.A,{sx:{width:64,height:64,bgcolor:F("#94a3b8"),color:W},children:(0,k.jsx)(b.JL6,{size:28})}),(0,k.jsx)(a.A,{variant:"subtitle1",sx:{fontWeight:700,color:R},children:"No pricing to show"}),(0,k.jsx)(a.A,{variant:"caption",sx:{color:z},children:B?"Try a different keyword.":"Pick a zone above to load the catalog."})]})})})]})]})})})]})}}}]); \ No newline at end of file diff --git a/build/static/js/7221.434a49d6.chunk.js b/build/static/js/7221.434a49d6.chunk.js new file mode 100644 index 0000000..b4129b5 --- /dev/null +++ b/build/static/js/7221.434a49d6.chunk.js @@ -0,0 +1 @@ +(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7221],{23787:(e,r,t)=>{"use strict";t.d(r,{FG:()=>p,nV:()=>h,pY:()=>u,pg:()=>x});var i=t(89379),s=t(80045),n=t(93230),l=t(2235),o=t(16491),c=t(82053),a=t(44414);const d=["children","scroll","onScroll","sx"],h=e=>{let{children:r,scroll:t=!1,onScroll:l,sx:o}=e,c=(0,s.A)(e,d);return(0,a.jsx)(n.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:l,sx:(0,i.A)((0,i.A)({p:1.5},t&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),o)},c),{},{children:r}))},x=e=>{let{accent:r="#662582",header:t,footer:s,selected:n=!1,onClick:c,children:d,sx:h}=e;return(0,a.jsxs)(l.A,{elevation:0,onClick:c,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:n?r:"#e2e8f0",background:n?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},h),children:[(0,a.jsx)(o.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,a.jsxs)(o.A,{sx:{p:1.5,pl:2},children:[t,d,s]})]})},p=e=>{let{children:r,columns:t=2,sx:s}=e;return(0,a.jsx)(o.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))"),gap:1,mt:1.25},s),children:r})},u=e=>{let{label:r,value:t,children:i,full:s=!1,align:n="left"}=e;return(0,a.jsxs)(o.A,{sx:{gridColumn:s?"1 / -1":"auto",minWidth:0,textAlign:n},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,a.jsx)(o.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==t&&void 0!==t?t:"\u2014"})})]})}},36220:function(e){e.exports=function(){"use strict";var e="minute",r=/[+-]\d\d(?::?\d\d)?/g,t=/([+-]|\d\d)/g;return function(i,s,n){var l=s.prototype;n.utc=function(e){return new s({date:e,utc:!0,args:arguments})},l.utc=function(r){var t=n(this.toDate(),{locale:this.$L,utc:!0});return r?t.add(this.utcOffset(),e):t},l.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=l.parse;l.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var c=l.init;l.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var a=l.utcOffset;l.utcOffset=function(i,s){var n=this.$utils().u;if(n(i))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof i&&(i=function(e){void 0===e&&(e="");var i=e.match(r);if(!i)return null;var s=(""+i[0]).match(t)||["-",0,0],n=s[0],l=60*+s[1]+ +s[2];return 0===l?0:"+"===n?l:-l}(i),null===i))return this;var l=Math.abs(i)<=16?60*i:i,o=this;if(s)return o.$offset=l,o.$u=0===i,o;if(0!==i){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(l+c,e)).$offset=l,o.$x.$localOffset=c}else o=this.utc();return o};var d=l.format;l.format=function(e){var r=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,r)},l.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var h=l.toDate;l.toDate=function(e){return"s"===e&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var x=l.diff;l.diff=function(e,r,t){if(e&&this.$u===e.$u)return x.call(this,e,r,t);var i=this.local(),s=n(e).local();return x.call(i,s,r,t)}}}()},47659:(e,r,t)=>{"use strict";t.d(r,{A:()=>d});var i=t(89379),s=t(48089),n=t(50704),l=t(16491),o=t(82053),c=t(60899),a=t(44414);const d=e=>{let{primary:r,secondary:t,percentage:d,color:h,sx:x}=e;return(0,a.jsx)(s.A,{elevation:0,sx:(0,i.A)({background:h,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},x),children:(0,a.jsxs)(n.A,{children:[(0,a.jsx)(l.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,a.jsx)(o.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,a.jsxs)(c.Ay,{container:!0,spacing:0,children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:t})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"subtitle2",color:"inherit",children:r})})]})]})})}},57221:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>V});var i=t(89379),s=t(93230),n=t(82053),l=t(25277),o=t(83274),c=t(25333),a=t(82223),d=t(55158),h=t(60899),x=t(1320),p=t(15769),u=t(69780),A=t(9213),m=t(21671),j=t(34075),f=t(74745),v=t(77922),g=t(29925),y=t(9950),b=t(14857),k=t(47223),S=t(23787),Y=t(28429),C=t(4159),z=t.n(C),W=t(50027),D=t(63189),M=t(81425),T=t(20466),w=t(36150),R=t(51778),J=t(52351),K=t(94826),O=t(13838),F=t(47659),H=t(58168);const P={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM482 232c0-4.4 3.6-8 8-8h44c4.4 0 8 3.6 8 8v80c0 4.4-3.6 8-8 8h-44c-4.4 0-8-3.6-8-8v-80zM270 582c0 4.4-3.6 8-8 8h-80c-4.4 0-8-3.6-8-8v-44c0-4.4 3.6-8 8-8h80c4.4 0 8 3.6 8 8v44zm90.7-204.5l-31.1 31.1a8.03 8.03 0 01-11.3 0L261.7 352a8.03 8.03 0 010-11.3l31.1-31.1c3.1-3.1 8.2-3.1 11.3 0l56.6 56.6c3.1 3.1 3.1 8.2 0 11.3zm291.1 83.6l-84.5 84.5c5 18.7.2 39.4-14.5 54.1a55.95 55.95 0 01-79.2 0 55.95 55.95 0 010-79.2 55.87 55.87 0 0154.1-14.5l84.5-84.5c3.1-3.1 8.2-3.1 11.3 0l28.3 28.3c3.1 3.1 3.1 8.1 0 11.3zm43-52.4l-31.1-31.1a8.03 8.03 0 010-11.3l56.6-56.6c3.1-3.1 8.2-3.1 11.3 0l31.1 31.1c3.1 3.1 3.1 8.2 0 11.3l-56.6 56.6a8.03 8.03 0 01-11.3 0zM846 582c0 4.4-3.6 8-8 8h-80c-4.4 0-8-3.6-8-8v-44c0-4.4 3.6-8 8-8h80c4.4 0 8 3.6 8 8v44z"}}]},name:"dashboard",theme:"filled"};var I=t(61187),L=function(e,r){return y.createElement(I.A,(0,H.A)({},e,{ref:r,icon:P}))};const Z=y.forwardRef(L);var N=t(31222),B=t(43302),G=t(99324),U=t(44414),E=t(36220);z().extend(E);const q=e=>{let{list:r,aiMode:t}=e;return r&&0!==r.length?(0,U.jsx)(S.nV,{children:r.map(((e,r)=>{const i="Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary";return(0,U.jsx)(S.pg,{header:(0,U.jsxs)(s.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,U.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,U.jsxs)(n.A,{sx:{fontWeight:800,color:"#94a3b8"},children:["#",r+1]}),1==t&&(0,U.jsx)(l.A,{size:"small",color:"primary",label:e.zone_name})]}),(0,U.jsx)(l.A,{size:"small",label:e.ordertype,color:i})]}),children:(0,U.jsxs)(S.FG,{children:[(0,U.jsx)(S.pY,{label:"Tenant",full:!0,children:(0,U.jsx)(o.A,{title:e.tenantaddress,children:(0,U.jsxs)(s.A,{children:[(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:e.tenantsuburb}),(0,U.jsx)(n.A,{noWrap:!0,variant:"body2",children:e.applocation})]})})}),(0,U.jsxs)(S.pY,{label:"Order Location",full:!0,children:[(0,U.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,U.jsx)(o.A,{title:"Order Id",children:(0,U.jsx)(n.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,U.jsx)(o.A,{title:"Ordered date",children:(0,U.jsxs)(s.A,{children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]})}),"-",(0,U.jsx)(o.A,{title:"Delivery date",children:(0,U.jsxs)(s.A,{children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})})]})]}),(0,U.jsx)(S.pY,{label:"Pickup",children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcontactno}),(0,U.jsx)(o.A,{title:e.pickupaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})}),(0,U.jsx)(S.pY,{label:"Delivery",children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycontactno}),(0,U.jsx)(o.A,{title:e.deliveryaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})}),e.ordernotes?(0,U.jsx)(S.pY,{label:"Notes",value:e.ordernotes,full:!0}):null,1==t&&(0,U.jsxs)(S.pY,{label:"Rider",full:!0,children:[(0,U.jsx)(n.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,U.jsxs)(n.A,{children:["ID : ",e.userid]})]}),(0,U.jsx)(S.pY,{label:"Profit",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"Charges",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,U.jsx)(o.A,{title:"Amount",placement:"left",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,U.jsx)(S.pY,{label:"KMS",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"KMS",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,U.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r)}))}):(0,U.jsx)(s.A,{alignItems:"center",sx:{py:4},children:(0,U.jsx)(O.A,{})})},V=()=>{var e,r,t,S,C,H,P;const I=(0,b.A)(),L=(0,k.A)(I.breakpoints.down("md")),E=(0,Y.Zp)(),V=(0,Y.zy)();console.log("location.state",V.state);const[Q,X]=(0,y.useState)(null),[$,_]=(0,y.useState)(null),[ee,re]=(0,y.useState)([]),[te,ie]=(0,y.useState)(!1),se=null===(e=V.state)||void 0===e?void 0:e.deliverylist,ne=null===(r=V.state)||void 0===r?void 0:r.zoneData,le=null===(t=V.state)||void 0===t?void 0:t.metaData,oe=null===(S=V.state)||void 0===S?void 0:S.riderToken,ce=null===(C=V.state)||void 0===C?void 0:C.appId,ae=null===(H=V.state)||void 0===H?void 0:H.aiMode,de=null===(P=V.state)||void 0===P?void 0:P.reassignOrders;(0,y.useEffect)((()=>{console.log("aiMode",ae),console.log("riderToken",oe),console.log("zoneData",ne),console.log("metaData",le),console.log("reassignOrders",de)}),[]),(0,y.useEffect)((()=>{if(null===se||void 0===se||!se.length)return;const e=se.map((e=>{const r=Number(e.cumulativekms||0),t=Number(e.minkm||0),s=Number(e.baseprice||0),n=Number(e.priceperkm||0);return r<=t?(0,i.A)((0,i.A)({},e),{},{deliveryamt:s}):(0,i.A)((0,i.A)({},e),{},{deliveryamt:(r-t)*n+s})}));re(e),console.log("finaldeliveryList",e)}),[se]);const{data:he=[],isLoading:xe,isError:pe,error:ue}=(0,w.I)({queryKey:["paymentmodes"],queryFn:M.HY}),{data:Ae=[],isLoading:me,isError:je,error:fe,refetch:ve}=(0,w.I)({queryKey:["ridersList",ce],queryFn:M.Sd,enabled:0!==ce}),ge=(0,R.n)({mutationFn:M.k3,onSuccess:()=>{(0,T.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,T.k)(e.message,"error",2e3)}}),ye=(0,R.n)({mutationFn:M.H2,onSuccess:(e,r)=>{console.log("data",e),console.log("varialbles",r),ge.mutate(Q.userfcmtoken||oe),"accepted"==e.status&&(0,T.k)("Delivery Created Successfully","success",2e3),setTimeout((()=>{ie(!1),E("/nearle/deliveries")}),2e3)},onError:e=>{(0,T.k)(e.message,"error",4e3)}});return(0,U.jsxs)(W.A,{content:!1,title:(0,U.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,U.jsxs)(o.A,{title:"Back to orders",placement:"top",children:[(0,U.jsx)(c.A,{onClick:()=>E("/nearle/orders"),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,U.jsx)(G.eQE,{size:22})})," "]}),(0,U.jsx)(n.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]}),secondary:(0,U.jsx)(a.A,{sx:{m:2},color:"primary",variant:"contained",startIcon:(0,U.jsx)(D.A,{}),children:"Re-Assign"}),children:[(xe||me||te)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J.A,{}),(0,U.jsx)(K.A,{})]}),(0,U.jsx)(d.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:xe||me||te,children:(0,U.jsx)(K.A,{color:"inherit"})}),1==ae&&(0,U.jsx)(s.A,{sx:{m:2},children:(0,U.jsxs)(h.Ay,{container:!0,spacing:2,children:[(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(F.A,{secondary:null===le||void 0===le?void 0:le.total_orders,primary:"Orders",percentage:(0,U.jsx)(Z,{}),color:I.palette.success.main,sx:{cursor:"pointer"}})}),(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(F.A,{secondary:null===le||void 0===le?void 0:le.total_riders,primary:"Riders",percentage:(0,U.jsx)(N.bsz,{}),color:I.palette.warning.main})}),(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(F.A,{secondary:null===ne||void 0===ne?void 0:ne.length,primary:"Zones",percentage:(0,U.jsx)(B.us2,{}),color:I.palette.info.main})}),(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(F.A,{secondary:null===ne||void 0===ne?void 0:ne.length,primary:"Kilometer",percentage:(0,U.jsx)(B.us2,{}),color:I.palette.error.main})})]})}),L?(0,U.jsx)(q,{list:ee,aiMode:ae}):(0,U.jsx)(x.A,{sx:{maxHeight:"calc(100vh - 250px)",overflow:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:I.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:I.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:I.palette.primary.lighter,cursor:"pointer"}},children:(0,U.jsxs)(p.A,{stickyHeader:!0,children:[(0,U.jsx)(u.A,{children:(0,U.jsxs)(A.A,{sx:{backgroundColor:"red"},children:[(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"#"}),1==ae&&(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Zone "}),(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Tenant "}),(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"order Location"}),(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Pickup "}),(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Delivery"}),(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Notes"}),1==ae&&(0,U.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Rider"}),(0,U.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Type"}),(0,U.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Profit"}),(0,U.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"Charges"}),(0,U.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:I.palette.secondary.light},children:"KMS"})]})}),(0,U.jsxs)(j.A,{children:[0==(null===ee||void 0===ee?void 0:ee.length)&&(0,U.jsx)(A.A,{children:(0,U.jsx)(m.A,{colSpan:10,children:(0,U.jsx)(O.A,{})})}),ee&&1==ae?null===ee||void 0===ee?void 0:ee.map(((e,r)=>(0,U.jsx)(y.Fragment,{children:(0,U.jsxs)(A.A,{sx:{},children:[(0,U.jsx)(m.A,{children:(0,U.jsxs)(n.A,{children:[" ",r+1]})}),1==ae&&(0,U.jsx)(m.A,{children:(0,U.jsx)(l.A,{color:"primary",label:e.zone_name})}),(0,U.jsx)(m.A,{children:(0,U.jsxs)(o.A,{title:e.tenantaddress,children:[(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,U.jsxs)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,U.jsx)("br",{})]}),(0,U.jsx)(n.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,U.jsxs)(m.A,{align:"left",children:[(0,U.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,U.jsx)(o.A,{title:"Order Id",children:(0,U.jsx)(n.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,U.jsxs)(o.A,{title:"Ordered date",children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,U.jsxs)(o.A,{title:"Delivery date",children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,U.jsx)(m.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcontactno}),(0,U.jsx)(o.A,{title:e.pickupaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,U.jsx)(m.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycontactno}),(0,U.jsx)(o.A,{title:e.deliveryaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,U.jsx)(m.A,{align:"left",children:e.ordernotes}),1==ae&&(0,U.jsxs)(m.A,{align:"left",children:[(0,U.jsx)(n.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,U.jsxs)(n.A,{children:["ID : ",e.userid]})]}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsx)(l.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"Charges",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,U.jsx)(o.A,{title:"Amount",placement:"left",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"KMS",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,U.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r))):null===ee||void 0===ee?void 0:ee.map(((e,r)=>(0,U.jsx)(y.Fragment,{children:(0,U.jsxs)(A.A,{sx:{},children:[(0,U.jsx)(m.A,{children:(0,U.jsxs)(n.A,{children:[" ",r+1]})}),(0,U.jsx)(m.A,{children:(0,U.jsxs)(o.A,{title:e.tenantaddress,children:[(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,U.jsxs)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,U.jsx)("br",{})]}),(0,U.jsx)(n.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,U.jsxs)(m.A,{align:"left",children:[(0,U.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,U.jsx)(n.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,U.jsx)(o.A,{title:"Order Id",children:(0,U.jsx)(n.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,U.jsxs)(o.A,{title:"Ordered date",children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,U.jsxs)(o.A,{title:"Delivery date",children:[(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(n.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,U.jsx)(m.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.pickupcontactno}),(0,U.jsx)(o.A,{title:e.pickupaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,U.jsx)(m.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycustomer}),(0,U.jsx)(n.A,{variant:"caption",children:e.deliverycontactno}),(0,U.jsx)(o.A,{title:e.deliveryaddress,children:(0,U.jsx)(n.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,U.jsx)(m.A,{align:"left",children:e.ordernotes}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsx)(l.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"Charges",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,U.jsx)(o.A,{title:"Amount",placement:"left",children:(0,U.jsx)(l.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,U.jsx)(m.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(o.A,{title:"KMS",placement:"top",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,U.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,U.jsx)(l.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r)))]})]})}),(0,U.jsx)(f.A,{}),0==ae&&(0,U.jsxs)(h.Ay,{container:!0,spacing:2,sx:{p:2},children:[(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(v.A,{id:"free-solo-demo",options:he,renderInput:e=>(0,U.jsx)(g.A,(0,i.A)((0,i.A)({},e),{},{label:"Choose Payment"})),onChange:(e,r,t)=>{if("clear"!==t){if(r){console.log("Selected:",r),_(r);const e=null===ee||void 0===ee?void 0:ee.map((e=>(0,i.A)((0,i.A)({},e),{},{paymenttype:r.apptypeid})));re(e)}}else _(null)}})}),(0,U.jsx)(h.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(v.A,{id:"free-solo-demo",options:Ae,renderInput:e=>(0,U.jsx)(g.A,(0,i.A)((0,i.A)({},e),{},{label:"Choose Rider"})),onChange:(e,r,t)=>{if("clear"!==t){if(r){X(r),console.log("Selected:",r);const e=null===ee||void 0===ee?void 0:ee.map((e=>(0,i.A)((0,i.A)({},e),{},{userid:r.userid,userfcmtoken:r.userfcmtoken})));re(e)}}else X(null)}})})]}),(0,U.jsx)(f.A,{}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,alignItems:{xs:"stretch",sm:"center"},justifyContent:"end",sx:{p:2},children:[(0,U.jsx)(a.A,{fullWidth:L,variant:"contained",color:"secondary",startIcon:(0,U.jsx)(D.A,{}),onClick:()=>{E("/nearle/orders")},children:"Back"}),(0,U.jsx)(a.A,{fullWidth:L,sx:{my:{xs:0,sm:2}},variant:"contained",disabled:0===ae&&(!Q||!$),onClick:async()=>{ie(!0),ye.mutate({deliveries:ee})},children:"Assign Orders"})]})]})}},62217:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},94826:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});var i=t(59254),s=t(46639),n=t(62217),l=t(44414);const o=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,l.jsxs)(o,{children:[(0,l.jsx)(s.A,{color:"primary",size:80,thickness:6}),(0,l.jsx)(c,{children:(0,l.jsx)("img",{src:n,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/7221.f8fb20dc.chunk.js b/build/static/js/7221.f8fb20dc.chunk.js deleted file mode 100644 index 352862f..0000000 --- a/build/static/js/7221.f8fb20dc.chunk.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7221],{36220:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(i,s,n){var o=s.prototype;n.utc=function(e){return new s({date:e,utc:!0,args:arguments})},o.utc=function(t){var r=n(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var l=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),l.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var a=o.utcOffset;o.utcOffset=function(i,s){var n=this.$utils().u;if(n(i))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof i&&(i=function(e){void 0===e&&(e="");var i=e.match(t);if(!i)return null;var s=(""+i[0]).match(r)||["-",0,0],n=s[0],o=60*+s[1]+ +s[2];return 0===o?0:"+"===n?o:-o}(i),null===i))return this;var o=Math.abs(i)<=16?60*i:i,l=this;if(s)return l.$offset=o,l.$u=0===i,l;if(0!==i){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(l=this.local().add(o+c,e)).$offset=o,l.$x.$localOffset=c}else l=this.utc();return l};var d=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var x=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return x.call(this,e,t,r);var i=this.local(),s=n(e).local();return x.call(i,s,t,r)}}}()},47659:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var i=r(89379),s=r(48089),n=r(50704),o=r(16491),l=r(82053),c=r(60899),a=r(44414);const d=e=>{let{primary:t,secondary:r,percentage:d,color:h,sx:x}=e;return(0,a.jsx)(s.A,{elevation:0,sx:(0,i.A)({background:h,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},x),children:(0,a.jsxs)(n.A,{children:[(0,a.jsx)(o.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,a.jsx)(l.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,a.jsxs)(c.Ay,{container:!0,spacing:0,children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(l.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:r})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(l.A,{variant:"subtitle2",color:"inherit",children:t})})]})]})})}},57221:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>E});var i=r(89379),s=r(93230),n=r(83274),o=r(25333),l=r(82053),c=r(82223),a=r(55158),d=r(60899),h=r(1320),x=r(15769),u=r(69780),p=r(9213),A=r(21671),m=r(34075),j=r(25277),f=r(74745),v=r(77922),g=r(29925),y=r(9950),k=r(14857),b=r(28429),S=r(4159),Y=r.n(S),C=r(50027),z=r(63189),D=r(81425),W=r(20466),T=r(36150),M=r(51778),R=r(52351),w=r(94826),J=r(13838),K=r(47659),O=r(58168);const H={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM482 232c0-4.4 3.6-8 8-8h44c4.4 0 8 3.6 8 8v80c0 4.4-3.6 8-8 8h-44c-4.4 0-8-3.6-8-8v-80zM270 582c0 4.4-3.6 8-8 8h-80c-4.4 0-8-3.6-8-8v-44c0-4.4 3.6-8 8-8h80c4.4 0 8 3.6 8 8v44zm90.7-204.5l-31.1 31.1a8.03 8.03 0 01-11.3 0L261.7 352a8.03 8.03 0 010-11.3l31.1-31.1c3.1-3.1 8.2-3.1 11.3 0l56.6 56.6c3.1 3.1 3.1 8.2 0 11.3zm291.1 83.6l-84.5 84.5c5 18.7.2 39.4-14.5 54.1a55.95 55.95 0 01-79.2 0 55.95 55.95 0 010-79.2 55.87 55.87 0 0154.1-14.5l84.5-84.5c3.1-3.1 8.2-3.1 11.3 0l28.3 28.3c3.1 3.1 3.1 8.1 0 11.3zm43-52.4l-31.1-31.1a8.03 8.03 0 010-11.3l56.6-56.6c3.1-3.1 8.2-3.1 11.3 0l31.1 31.1c3.1 3.1 3.1 8.2 0 11.3l-56.6 56.6a8.03 8.03 0 01-11.3 0zM846 582c0 4.4-3.6 8-8 8h-80c-4.4 0-8-3.6-8-8v-44c0-4.4 3.6-8 8-8h80c4.4 0 8 3.6 8 8v44z"}}]},name:"dashboard",theme:"filled"};var F=r(61187),P=function(e,t){return y.createElement(F.A,(0,O.A)({},e,{ref:t,icon:H}))};const Z=y.forwardRef(P);var L=r(31222),B=r(43302),N=r(99324),U=r(44414),I=r(36220);Y().extend(I);const E=()=>{var e,t,r,S,O,H,F;const P=(0,k.A)(),I=(0,b.Zp)(),E=(0,b.zy)();console.log("location.state",E.state);const[G,q]=(0,y.useState)(null),[V,Q]=(0,y.useState)(null),[X,$]=(0,y.useState)([]),[_,ee]=(0,y.useState)(!1),te=null===(e=E.state)||void 0===e?void 0:e.deliverylist,re=null===(t=E.state)||void 0===t?void 0:t.zoneData,ie=null===(r=E.state)||void 0===r?void 0:r.metaData,se=null===(S=E.state)||void 0===S?void 0:S.riderToken,ne=null===(O=E.state)||void 0===O?void 0:O.appId,oe=null===(H=E.state)||void 0===H?void 0:H.aiMode,le=null===(F=E.state)||void 0===F?void 0:F.reassignOrders;(0,y.useEffect)((()=>{console.log("aiMode",oe),console.log("riderToken",se),console.log("zoneData",re),console.log("metaData",ie),console.log("reassignOrders",le)}),[]),(0,y.useEffect)((()=>{if(null===te||void 0===te||!te.length)return;const e=te.map((e=>{const t=Number(e.cumulativekms||0),r=Number(e.minkm||0),s=Number(e.baseprice||0),n=Number(e.priceperkm||0);return t<=r?(0,i.A)((0,i.A)({},e),{},{deliveryamt:s}):(0,i.A)((0,i.A)({},e),{},{deliveryamt:(t-r)*n+s})}));$(e),console.log("finaldeliveryList",e)}),[te]);const{data:ce=[],isLoading:ae,isError:de,error:he}=(0,T.I)({queryKey:["paymentmodes"],queryFn:D.HY}),{data:xe=[],isLoading:ue,isError:pe,error:Ae,refetch:me}=(0,T.I)({queryKey:["ridersList",ne],queryFn:D.Sd,enabled:0!==ne}),je=(0,M.n)({mutationFn:D.k3,onSuccess:()=>{(0,W.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,W.k)(e.message,"error",2e3)}}),fe=(0,M.n)({mutationFn:D.H2,onSuccess:(e,t)=>{console.log("data",e),console.log("varialbles",t),je.mutate(G.userfcmtoken||se),"accepted"==e.status&&(0,W.k)("Delivery Created Successfully","success",2e3),setTimeout((()=>{ee(!1),I("/nearle/deliveries")}),2e3)},onError:e=>{(0,W.k)(e.message,"error",4e3)}});return(0,U.jsxs)(C.A,{content:!1,title:(0,U.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,U.jsxs)(n.A,{title:"Back to orders",placement:"top",children:[(0,U.jsx)(o.A,{onClick:()=>I("/nearle/orders"),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,U.jsx)(N.eQE,{size:22})})," "]}),(0,U.jsx)(l.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]}),secondary:(0,U.jsx)(c.A,{sx:{m:2},color:"primary",variant:"contained",startIcon:(0,U.jsx)(z.A,{}),children:"Re-Assign"}),children:[(ae||ue||_)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(R.A,{}),(0,U.jsx)(w.A,{})]}),(0,U.jsx)(a.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:ae||ue||_,children:(0,U.jsx)(w.A,{color:"inherit"})}),1==oe&&(0,U.jsx)(s.A,{sx:{m:2},children:(0,U.jsxs)(d.Ay,{container:!0,spacing:2,children:[(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(K.A,{secondary:null===ie||void 0===ie?void 0:ie.total_orders,primary:"Orders",percentage:(0,U.jsx)(Z,{}),color:P.palette.success.main,sx:{cursor:"pointer"}})}),(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(K.A,{secondary:null===ie||void 0===ie?void 0:ie.total_riders,primary:"Riders",percentage:(0,U.jsx)(L.bsz,{}),color:P.palette.warning.main})}),(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(K.A,{secondary:null===re||void 0===re?void 0:re.length,primary:"Zones",percentage:(0,U.jsx)(B.us2,{}),color:P.palette.info.main})}),(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,U.jsx)(K.A,{secondary:null===re||void 0===re?void 0:re.length,primary:"Kilometer",percentage:(0,U.jsx)(B.us2,{}),color:P.palette.error.main})})]})}),(0,U.jsx)(h.A,{sx:{maxHeight:"calc(100vh - 250px)",overflow:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:P.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:P.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:P.palette.primary.lighter,cursor:"pointer"}},children:(0,U.jsxs)(x.A,{stickyHeader:!0,children:[(0,U.jsx)(u.A,{children:(0,U.jsxs)(p.A,{sx:{backgroundColor:"red"},children:[(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"#"}),1==oe&&(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Zone "}),(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Tenant "}),(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"order Location"}),(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Pickup "}),(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Delivery"}),(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Notes"}),1==oe&&(0,U.jsx)(A.A,{sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Rider"}),(0,U.jsx)(A.A,{align:"center",sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Type"}),(0,U.jsx)(A.A,{align:"center",sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Profit"}),(0,U.jsx)(A.A,{align:"center",sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"Charges"}),(0,U.jsx)(A.A,{align:"center",sx:{position:"sticky !important",backgroundColor:P.palette.secondary.light},children:"KMS"})]})}),(0,U.jsxs)(m.A,{children:[0==(null===X||void 0===X?void 0:X.length)&&(0,U.jsx)(p.A,{children:(0,U.jsx)(A.A,{colSpan:10,children:(0,U.jsx)(J.A,{})})}),X&&1==oe?null===X||void 0===X?void 0:X.map(((e,t)=>(0,U.jsx)(y.Fragment,{children:(0,U.jsxs)(p.A,{sx:{},children:[(0,U.jsx)(A.A,{children:(0,U.jsxs)(l.A,{children:[" ",t+1]})}),1==oe&&(0,U.jsx)(A.A,{children:(0,U.jsx)(j.A,{color:"primary",label:e.zone_name})}),(0,U.jsx)(A.A,{children:(0,U.jsxs)(n.A,{title:e.tenantaddress,children:[(0,U.jsx)(l.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,U.jsxs)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,U.jsx)("br",{})]}),(0,U.jsx)(l.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,U.jsxs)(A.A,{align:"left",children:[(0,U.jsx)(n.A,{title:e.locationaddress,placement:"top",children:(0,U.jsx)(l.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,U.jsx)(n.A,{title:"Order Id",children:(0,U.jsx)(l.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,U.jsxs)(n.A,{title:"Ordered date",children:[(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,U.jsxs)(n.A,{title:"Delivery date",children:[(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,U.jsx)(A.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(l.A,{variant:"caption",children:e.pickupcustomer}),(0,U.jsx)(l.A,{variant:"caption",children:e.pickupcontactno}),(0,U.jsx)(n.A,{title:e.pickupaddress,children:(0,U.jsx)(l.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,U.jsx)(A.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(l.A,{variant:"caption",children:e.deliverycustomer}),(0,U.jsx)(l.A,{variant:"caption",children:e.deliverycontactno}),(0,U.jsx)(n.A,{title:e.deliveryaddress,children:(0,U.jsx)(l.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,U.jsx)(A.A,{align:"left",children:e.ordernotes}),1==oe&&(0,U.jsxs)(A.A,{align:"left",children:[(0,U.jsx)(l.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,U.jsxs)(l.A,{children:["ID : ",e.userid]})]}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsx)(j.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(n.A,{title:"Charges",placement:"top",children:(0,U.jsx)(j.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,U.jsx)(n.A,{title:"Amount",placement:"left",children:(0,U.jsx)(j.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(n.A,{title:"KMS",placement:"top",children:(0,U.jsx)(j.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,U.jsx)(n.A,{title:"Cumulative Kms",placement:"right",children:(0,U.jsx)(j.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},t))):null===X||void 0===X?void 0:X.map(((e,t)=>(0,U.jsx)(y.Fragment,{children:(0,U.jsxs)(p.A,{sx:{},children:[(0,U.jsx)(A.A,{children:(0,U.jsxs)(l.A,{children:[" ",t+1]})}),(0,U.jsx)(A.A,{children:(0,U.jsxs)(n.A,{title:e.tenantaddress,children:[(0,U.jsx)(l.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,U.jsxs)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,U.jsx)("br",{})]}),(0,U.jsx)(l.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,U.jsxs)(A.A,{align:"left",children:[(0,U.jsx)(n.A,{title:e.locationaddress,placement:"top",children:(0,U.jsx)(l.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,U.jsx)(n.A,{title:"Order Id",children:(0,U.jsx)(l.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,U.jsxs)(n.A,{title:"Ordered date",children:[(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,U.jsxs)(n.A,{title:"Delivery date",children:[(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,U.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,U.jsx)(A.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(l.A,{variant:"caption",children:e.pickupcustomer}),(0,U.jsx)(l.A,{variant:"caption",children:e.pickupcontactno}),(0,U.jsx)(n.A,{title:e.pickupaddress,children:(0,U.jsx)(l.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,U.jsx)(A.A,{align:"left",children:(0,U.jsx)(s.A,{direction:"row",spacing:1,children:(0,U.jsxs)(s.A,{direction:"column",children:[(0,U.jsx)(l.A,{variant:"caption",children:e.deliverycustomer}),(0,U.jsx)(l.A,{variant:"caption",children:e.deliverycontactno}),(0,U.jsx)(n.A,{title:e.deliveryaddress,children:(0,U.jsx)(l.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,U.jsx)(A.A,{align:"left",children:e.ordernotes}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsx)(j.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(n.A,{title:"Charges",placement:"top",children:(0,U.jsx)(j.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,U.jsx)(n.A,{title:"Amount",placement:"left",children:(0,U.jsx)(j.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,U.jsx)(A.A,{align:"center",children:(0,U.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,U.jsx)(n.A,{title:"KMS",placement:"top",children:(0,U.jsx)(j.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,U.jsx)(n.A,{title:"Cumulative Kms",placement:"right",children:(0,U.jsx)(j.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},t)))]})]})}),(0,U.jsx)(f.A,{}),0==oe&&(0,U.jsxs)(d.Ay,{container:!0,spacing:2,sx:{p:2},children:[(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(v.A,{id:"free-solo-demo",options:ce,renderInput:e=>(0,U.jsx)(g.A,(0,i.A)((0,i.A)({},e),{},{label:"Choose Payment"})),onChange:(e,t,r)=>{if("clear"!==r){if(t){console.log("Selected:",t),Q(t);const e=null===X||void 0===X?void 0:X.map((e=>(0,i.A)((0,i.A)({},e),{},{paymenttype:t.apptypeid})));$(e)}}else Q(null)}})}),(0,U.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(v.A,{id:"free-solo-demo",options:xe,renderInput:e=>(0,U.jsx)(g.A,(0,i.A)((0,i.A)({},e),{},{label:"Choose Rider"})),onChange:(e,t,r)=>{if("clear"!==r){if(t){q(t),console.log("Selected:",t);const e=null===X||void 0===X?void 0:X.map((e=>(0,i.A)((0,i.A)({},e),{},{userid:t.userid,userfcmtoken:t.userfcmtoken})));$(e)}}else q(null)}})})]}),(0,U.jsx)(f.A,{}),(0,U.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:2,alignItems:"center",justifyContent:"end",sx:{p:2},children:[(0,U.jsx)(c.A,{sx:{},variant:"contained",color:"secondary",startIcon:(0,U.jsx)(z.A,{}),onClick:()=>{I("/nearle/orders")},children:"Back"}),(0,U.jsx)(c.A,{sx:{my:2},variant:"contained",disabled:0===oe&&(!G||!V),onClick:async()=>{ee(!0),fe.mutate({deliveries:X})},children:"Assign Orders"})]})]})}},62217:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},94826:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var i=r(59254),s=r(46639),n=r(62217),o=r(44414);const l=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,o.jsxs)(l,{children:[(0,o.jsx)(s.A,{color:"primary",size:80,thickness:6}),(0,o.jsx)(c,{children:(0,o.jsx)("img",{src:n,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/7875.9e6056f7.chunk.js b/build/static/js/7875.9e6056f7.chunk.js new file mode 100644 index 0000000..30cca6b --- /dev/null +++ b/build/static/js/7875.9e6056f7.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7875],{23787:(e,s,n)=>{n.d(s,{FG:()=>u,nV:()=>x,pY:()=>g,pg:()=>h});var t=n(89379),i=n(80045),a=n(93230),l=n(2235),r=n(16491),o=n(82053),c=n(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:s,scroll:n=!1,onScroll:l,sx:r}=e,o=(0,i.A)(e,d);return(0,c.jsx)(a.A,(0,t.A)((0,t.A)({spacing:1.25,onScroll:l,sx:(0,t.A)((0,t.A)({p:1.5},n&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),r)},o),{},{children:s}))},h=e=>{let{accent:s="#662582",header:n,footer:i,selected:a=!1,onClick:o,children:d,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:o,sx:(0,t.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:a?s:"#e2e8f0",background:a?"".concat(s,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(r.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:s}}),(0,c.jsxs)(r.A,{sx:{p:1.5,pl:2},children:[n,d,i]})]})},u=e=>{let{children:s,columns:n=2,sx:i}=e;return(0,c.jsx)(r.A,{sx:(0,t.A)({display:"grid",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))"),gap:1,mt:1.25},i),children:s})},g=e=>{let{label:s,value:n,children:t,full:i=!1,align:a="left"}=e;return(0,c.jsxs)(r.A,{sx:{gridColumn:i?"1 / -1":"auto",minWidth:0,textAlign:a},children:[(0,c.jsx)(o.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:s}),(0,c.jsx)(r.A,{sx:{mt:.25,minWidth:0},children:void 0!==t?t:(0,c.jsx)(o.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==n&&void 0!==n?n:"\u2014"})})]})}},97875:(e,s,n)=>{n.r(s),n.d(s,{default:()=>ae});var t=n(89379),i=n(69780),a=n(9213),l=n(21671),r=n(16491),o=n(14857),c=n(47223),d=n(96583),x=n(40033),h=n(28170),u=n(60899),g=n(29277),A=n(29925),m=n(79739),j=n(93230),p=n(82223),v=n(82917),y=n(41413),f=n(82053),b=n(25277),C=n(15769),w=n(34075),S=n(33738),F=n(46639),k=n(48159),I=n(84142),P=n(74745),R=n(249),W=n(26050),z=n(14195),q=n(2046),_=n(25333),D=n(25979),N=n(2660),O=n(23787),Y=n(77922),B=n(44070),H=n(8750),E=n(60767),M=n(37476),T=n(8881),U=n(4159),K=n.n(U),L=n(51400),V=n(39060),G=n(50027),Z=n(9950),Q=n(26910),X=n(52351),J=n(56713),$=n(1320),ee=n(6258),se=n(7251),ne=n(80691),te=n(99459),ie=n(44414);const ae=()=>{function e(e,s,n){return s[n]e[n]?1:0}const s=[{id:"sno",disablePadding:!0,label:"#"},{id:"tenantname",numeric:!1,disablePadding:!1,label:"REQUESTOR"},{id:"contact",numeric:!1,disablePadding:!1,label:"BANK"},{id:"address3",disablePadding:!1,label:"IFSC"},{id:"address",disablePadding:!1,label:"REF NO"},{id:"amount",disablePadding:!1,label:"AMOUNT"},{id:"city",disablePadding:!1,label:"REASON"}];function n(e){const{order:n,orderBy:t,onRequestSort:o}=e;return(0,ie.jsx)(i.A,{children:(0,ie.jsx)(a.A,{children:s.map((e=>{return(0,ie.jsx)(l.A,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",sortDirection:t===e.id&&n,children:(0,ie.jsxs)(se.A,{active:t===e.id,direction:t===e.id?n:"asc",onClick:(s=e.id,e=>{o(e,s)}),children:[e.label,t===e.id?(0,ie.jsx)(r.A,{component:"span",sx:ne.A,children:"desc"===n?"sorted descending":"sorted ascending"}):null]})},e.id);var s}))})})}function U(){const s=(0,o.A)(),D=(0,c.A)(s.breakpoints.down("md")),[N,E]=Z.useState("asc"),[U,X]=Z.useState("calories"),[se,ne]=Z.useState([]),[ae,le]=Z.useState(0),[de,xe]=Z.useState(10),[he,ue]=(0,Z.useState)(""),[ge,je]=(0,Z.useState)(""),[pe,ye]=(0,Z.useState)(""),[we,Se]=(0,Z.useState)(""),[Fe,ke]=(0,Z.useState)(""),[Ie,Pe]=(0,Z.useState)(""),[Re,We]=(0,Z.useState)(""),[ze,qe]=(0,Z.useState)(""),[_e,De]=(0,Z.useState)(""),[Ne,Oe]=(0,Z.useState)(""),[Ye]=(0,Z.useState)(""),[Be,He]=(0,Z.useState)({});te.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[Ee,Me]=(0,Z.useState)([]),[Te]=(0,Z.useState)([]),[Ue,Ke]=(0,Z.useState)(0),[Le]=(0,Z.useState)(!1),[Ve]=(0,Z.useState)(!1),[Ge]=(0,Z.useState)(!1),[Ze,Qe]=(0,Z.useState)(""),[Xe,Je]=(0,Z.useState)(""),[$e,es]=(0,Z.useState)("");(0,Z.useEffect)((()=>{Me([{sno:1,role:"",cost:"",serviceid:0,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}]),console.log(Ee)}),[]);const ss=e=>{(0,T.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),console.log(alertmessage)};(0,Z.useEffect)((()=>{try{te.A.fromAddress(Fe).then((e=>{if("OK"==e.status){const{lat:s,lng:n}=e.results[0].geometry.location;He({lat:s,lng:n}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[Fe]),(0,Z.useEffect)((()=>{console.log("rolesarr"),console.log(Ee)}),[Ee]);const ns=async()=>{console.log("submit");let e=[],s=!1;if(Ee.map((n=>{n.role&&n.cost||(s=!0),e.push({serviceid:n.serviceid,tenantid:Ye,categoryid:n.categoryid,subcategoryid:n.subcategoryid,servicecode:n.servicecode,servicename:n.servicename,unitid:n.unitid,unitname:n.unitname,serviceamount:parseFloat(n.serviceamount),categoryname:n.categoryname,subcategoryname:n.servicename})})),console.log(e),s)(0,T.M8)("Fill all Details",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3});else try{me(!0),await Q.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/update/services"),e).then((e=>{console.log("res:",e),"Update successful"===e.data.message&&(0,T.M8)("Service Updated Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),me(!1)})).catch((e=>{console.log(e),me(!1)}))}catch(n){console.log(n),me(!1)}},ts=(e,s)=>{const n=se.indexOf(s);let t=[];-1===n?t=t.concat(se,s):0===n?t=t.concat(se.slice(1)):n===se.length-1?t=t.concat(se.slice(0,-1)):n>0&&(t=t.concat(se.slice(0,n),se.slice(n+1))),ne(t)},is=e=>-1!==se.indexOf(e),as=ae>0?Math.max(0,(1+ae)*de-ce.length):0,ls=Z.useMemo((()=>function(e,s){const n=e.map(((e,s)=>[e,s]));return n.sort(((e,n)=>{const t=s(e[0],n[0]);return 0!==t?t:e[1]-n[1]})),n.map((e=>e[0]))}(ce,function(s,n){return"desc"===s?(s,t)=>e(s,t,n):(s,t)=>-e(s,t,n)}(N,U)).slice(ae*de,ae*de+de)),[N,U,ae,de]);return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(d.A,{fullWidth:!0,open:ve,onClose:Ce,scroll:"paper",fullScreen:D,maxWidth:"sm",TransitionComponent:M.s,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,ie.jsx)(x.A,{children:"Create Request"}),(0,ie.jsx)(h.A,{dividers:!0,children:(0,ie.jsx)(G.A,{sx:{height:"100%"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:2.5,children:[(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Reference No"}),(0,ie.jsx)(A.A,{type:"number",fullWidth:!0,sx:{width:"100%"},value:Ze,onChange:e=>{Qe(e.target.value),console.log(e)}})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Requestor"}),(0,ie.jsx)(A.A,{value:Xe,onChange:e=>Je(e.target.value),fullWidth:!0,sx:{width:"100%"}})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Bank Name"}),(0,ie.jsx)(A.A,{value:$e,sx:{width:"100%"},onChange:e=>es(e.target.value)})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Amount"}),(0,ie.jsx)(A.A,{type:"number",value:amount,sx:{width:"100%"},onChange:e=>setAmount(e.target.value)})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Account No"}),(0,ie.jsx)(A.A,{type:"number",fullWidth:!0,sx:{width:"100%"},value:accountno,onChange:e=>{setAccountno(e.target.value),console.log(e)}})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"IFSC Code"}),(0,ie.jsx)(A.A,{value:ifsc,onChange:e=>setIfsc(e.target.value),fullWidth:!0,sx:{width:"100%"}})]}),(0,ie.jsxs)(u.Ay,{item:!0,xs:12,sm:6,children:[(0,ie.jsx)(g.A,{children:"Reason"}),(0,ie.jsx)(A.A,{value:reason,onChange:e=>setReason(e.target.value),fullWidth:!0,sx:{width:"100%"}})]})]})})}),(0,ie.jsx)(m.A,{children:(0,ie.jsx)(u.Ay,{container:!0,children:(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(j.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[(0,ie.jsx)(p.A,{variant:"contained",onClick:()=>{(()=>{if(Ze)if(Xe)if($e)if(amount)if(accountno)if(ifsc)if(reason){let e={requestid:0,requestdate:K()().format("YYYY-MM-DD HH:mm:ss"),referenceno:Ze,Apptypeid:22,requesttype:"staffexpenses",reason:reason,requestor:Xe,amount:amount,Accountno:accountno,bankname:$e,ifsccode:ifsc};console.log(e)}else ss("Fill Reason");else ss("Fill IFSC");else ss("Fill Account No");else ss("Fill Amount");else ss("Fill Bank Name");else ss("Fill Requestor");else ss("Fill Reference No")})()},children:"Update"}),(0,ie.jsx)(p.A,{variant:"contained",onClick:()=>{Ce()},color:"error",children:"Close"})]})})})})]}),(0,ie.jsxs)(r.A,{sx:{width:"100%"},children:[D&&(0,ie.jsxs)(O.nV,{scroll:!0,children:[Ae&&[0,1,2,3,4].map((e=>(0,ie.jsxs)(O.pg,{accent:"#662582",children:[(0,ie.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,ie.jsx)(v.A,{variant:"circular",width:32,height:32}),(0,ie.jsxs)(j.A,{sx:{flex:1},children:[(0,ie.jsx)(v.A,{animation:"wave",width:"60%"}),(0,ie.jsx)(v.A,{animation:"wave",width:"40%"})]})]}),(0,ie.jsxs)(O.FG,{children:[(0,ie.jsx)(O.pY,{label:"Amount",value:(0,ie.jsx)(v.A,{animation:"wave",width:50})}),(0,ie.jsx)(O.pY,{label:"Ref No",value:(0,ie.jsx)(v.A,{animation:"wave",width:50})})]})]},e))),!Ae&&ls.map(((e,s)=>{const n=is(e.sno);return(0,ie.jsx)(O.pg,{accent:"#662582",selected:n,onClick:s=>ts(0,e.sno),header:(0,ie.jsxs)(j.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,ie.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,ie.jsx)(y.A,{sx:{width:32,height:32,bgcolor:"#66258218",color:"#662582",fontSize:13},children:e.requestor?String(e.requestor).charAt(0).toUpperCase():"#"}),(0,ie.jsxs)(j.A,{sx:{minWidth:0},children:[(0,ie.jsx)(f.A,{sx:{fontSize:14,fontWeight:700,color:"#0f172a"},noWrap:!0,children:e.requestor||"\u2014"}),(0,ie.jsxs)(f.A,{sx:{fontSize:11,color:"#94a3b8"},noWrap:!0,children:["#",e.sno]})]})]}),null!=e.amount&&(0,ie.jsx)(b.A,{label:e.amount,size:"small",sx:{bgcolor:"#66258218",color:"#662582",fontWeight:700}})]}),children:(0,ie.jsxs)(O.FG,{children:[(0,ie.jsx)(O.pY,{label:"Bank",value:e.bankname}),(0,ie.jsx)(O.pY,{label:"Account No",value:e.accountno}),(0,ie.jsx)(O.pY,{label:"IFSC",value:e.ifsccode}),(0,ie.jsx)(O.pY,{label:"Ref No",value:e.referenceno}),(0,ie.jsx)(O.pY,{label:"Reason",value:e.reason,full:!0})]})},e.sno)})),!Ae&&0===ls.length&&(0,ie.jsxs)(j.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,ie.jsx)(y.A,{sx:{width:64,height:64,bgcolor:"#f1f5f9",color:"#94a3b8"}}),(0,ie.jsx)(f.A,{sx:{fontSize:15,fontWeight:700,color:"#0f172a"},children:"No requests to show"}),(0,ie.jsx)(f.A,{sx:{fontSize:13,color:"#94a3b8"},children:"Requests will appear here once available."})]})]}),(0,ie.jsx)($.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider",display:D?"none":"block"},children:(0,ie.jsxs)(C.A,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[(0,ie.jsx)(n,{numSelected:se.length,order:N,orderBy:U,onSelectAllClick:e=>{if(e.target.checked){const e=ce.map((e=>e.name));ne(e)}else ne([])},onRequestSort:(e,s)=>{E(U===s&&"asc"===N?"desc":"asc"),X(s)},rowCount:ce.length}),Ae&&(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(w.A,{children:[0,1,2,3,4,5,6,7,8,9].map((e=>(0,ie.jsxs)(a.A,{children:[(0,ie.jsx)(l.A,{children:(0,ie.jsx)(v.A,{animation:"wave"})}),(0,ie.jsx)(l.A,{children:(0,ie.jsxs)(j.A,{direction:"row",spacing:1,children:[(0,ie.jsx)(v.A,{variant:"circular",width:40,height:40}),(0,ie.jsxs)(j.A,{direction:"column",children:[(0,ie.jsx)(v.A,{animation:"wave",width:100}),(0,ie.jsx)(v.A,{animation:"wave",width:100})]})]})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(v.A,{animation:"wave"})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(v.A,{animation:"wave"})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(v.A,{animation:"wave"})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(v.A,{animation:"wave"})})]},e)))})}),(0,ie.jsxs)(w.A,{children:[ls.map(((e,s)=>{const n=is(e.sno),o="enhanced-table-checkbox-".concat(s);return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(a.A,{hover:!0,onClick:s=>ts(0,e.sno),role:"checkbox","aria-checked":n,tabIndex:-1,sx:{cursor:"pointer"},children:[(0,ie.jsx)(l.A,{component:"th",id:o,scope:"row",padding:"none",children:e.sno}),(0,ie.jsx)(l.A,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,ie.jsxs)(j.A,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,ie.jsx)(y.A,{alt:"",size:"sm",sx:{width:"25px",height:"25px"}}),(0,ie.jsx)(j.A,{direction:"column",children:(0,ie.jsx)(f.A,{variant:"caption",children:e.requestor})})]})}),(0,ie.jsxs)(l.A,{align:"left",children:[(0,ie.jsxs)(f.A,{variant:"caption",children:[" ",e.accountno]}),(0,ie.jsxs)(f.A,{variant:"h6",children:[" ",e.bankname]})]}),(0,ie.jsx)(l.A,{children:e.ifsccode}),(0,ie.jsx)(l.A,{align:"left",children:e.referenceno}),(0,ie.jsx)(l.A,{children:e.amount}),(0,ie.jsx)(l.A,{children:e.reason})]},e.sno),(0,ie.jsx)(a.A,{children:(0,ie.jsxs)(l.A,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:8,sx:{width:"100%"},children:[(0,ie.jsx)(S.A,{in:expandopen===e.sno,timeout:"auto",unmountOnExit:!0,children:(0,ie.jsx)(M.A,{type:"slide",direction:"down",in:!0,children:(0,ie.jsx)(G.A,{sx:{height:"100%"},children:Ge?(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(G.A,{children:(0,ie.jsx)(j.A,{alignItems:"center",children:(0,ie.jsx)(F.A,{})})})}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(k.A,{value:Ue,onChange:(e,s)=>Ke(s),children:[(0,ie.jsx)(I.A,{label:"client Details"}),(0,ie.jsx)(I.A,{label:"Client Pricing"})]}),0===Ue&&(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:2.5,sx:{pl:{xs:0,sm:5,md:6,lg:10,xl:12},p:2},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:5,md:4,lg:4,xl:3,children:(0,ie.jsx)(G.A,{sx:{height:"100%"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(j.A,{spacing:2.5,alignItems:"center",children:[(0,ie.jsx)(y.A,{alt:"Avatar 1",size:"xl"}),(0,ie.jsxs)(j.A,{spacing:.5,alignItems:"center",children:[(0,ie.jsx)(f.A,{variant:"h5",children:he}),(0,ie.jsx)(f.A,{color:"secondary",children:we})]})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(P.A,{})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(R.A,{component:"nav","aria-label":"main mailbox folders",sx:{py:0},children:[(0,ie.jsxs)(W.Ay,{children:[(0,ie.jsx)(z.A,{children:(0,ie.jsx)(L.A,{})}),(0,ie.jsx)(f.A,{align:"right",children:ge})]}),(0,ie.jsxs)(W.Ay,{children:[(0,ie.jsx)(z.A,{children:(0,ie.jsx)(V.A,{})}),(0,ie.jsxs)(f.A,{align:"left",children:["+1 ",pe]})]})]})})]})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:7,md:8,lg:8,xl:9,children:(0,ie.jsx)(G.A,{title:(0,ie.jsx)(r.A,{sx:{p:1},children:"Contact Details"}),sx:{height:"100%"},children:(0,ie.jsxs)(R.A,{sx:{py:0},children:[(0,ie.jsx)(W.Ay,{children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6,children:(0,ie.jsxs)(j.A,{spacing:.5,children:[(0,ie.jsx)(f.A,{color:"secondary",children:" Contact Name"}),(0,ie.jsx)(f.A,{children:ze})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6})]})}),(0,ie.jsx)(W.Ay,{children:(0,ie.jsxs)(j.A,{spacing:.5,children:[(0,ie.jsx)(f.A,{color:"secondary",children:"Address"}),(0,ie.jsx)(f.A,{children:Fe})]})}),(0,ie.jsx)(W.Ay,{children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6,children:(0,ie.jsxs)(j.A,{spacing:.5,children:[(0,ie.jsx)(f.A,{color:"secondary",children:"City"}),(0,ie.jsx)(f.A,{children:Ie})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6,children:(0,ie.jsxs)(j.A,{spacing:.5,children:[(0,ie.jsx)(f.A,{color:"secondary",children:"Zip Code"}),(0,ie.jsx)(f.A,{children:Re})]})})]})})]})})})]})}),1===Ue&&(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(u.Ay,{container:!0,sx:{p:1},children:(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(G.A,{sx:{height:"100%",p:1},children:Ee[0].role?(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)($.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider"},children:(0,ie.jsxs)(C.A,{sx:{width:"100%"},children:[(0,ie.jsx)(i.A,{children:(0,ie.jsxs)(a.A,{children:[(0,ie.jsx)(l.A,{children:"#"}),(0,ie.jsx)(l.A,{sx:{width:"30%"},children:"Category"}),(0,ie.jsx)(l.A,{sx:{width:"30%"},children:"Skill"}),(0,ie.jsx)(l.A,{sx:{width:"30%"},children:"Cost/Hr"})]})}),(0,ie.jsx)(w.A,{children:Ee.map((e=>(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(a.A,{children:[(0,ie.jsx)(l.A,{children:e.sno}),(0,ie.jsx)(l.A,{children:e.categoryname}),(0,ie.jsx)(l.A,{children:e.role}),(0,ie.jsx)(l.A,{children:e.cost})]})})))})]})})}):(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(f.A,{children:"No Data found"})})})})})})]})})})}),(0,ie.jsx)(S.A,{in:editexpandopen===e.sno,timeout:"auto",unmountOnExit:!0,children:(0,ie.jsx)(M.A,{type:"slide",direction:"down",in:!0,children:Ge?(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(G.A,{children:(0,ie.jsx)(j.A,{alignItems:"center",children:(0,ie.jsx)(F.A,{})})})}):(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(G.A,{sx:{height:"100%"},children:[(0,ie.jsxs)(k.A,{value:Ue,onChange:(e,s)=>Ke(s),children:[(0,ie.jsx)(I.A,{label:"client Details"}),(0,ie.jsx)(I.A,{label:"Client Pricing"})]}),0===Ue&&(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(G.A,{sx:{height:"100%"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:2.5,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:5,md:4,lg:4,xl:3,children:(0,ie.jsx)(G.A,{title:(0,ie.jsx)(r.A,{sx:{p:1},children:"Client"}),sx:{height:"100%"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(j.A,{spacing:2,alignItems:"center",sx:{width:"100%"},children:[(0,ie.jsx)(A.A,{type:"text",label:"Business name",fullWidth:!0,sx:{width:"100%"},value:he,onChange:e=>ue(e.target.value)}),(0,ie.jsx)(A.A,{type:"number",value:we,onChange:e=>Se(e.target.value),label:"Business No.",fullWidth:!0,sx:{width:"100%"}})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(R.A,{component:"nav","aria-label":"main mailbox folders",sx:{py:0},children:(0,ie.jsxs)(j.A,{direction:"column",spacing:2,sx:{width:"100%"},children:[(0,ie.jsx)(A.A,{type:"email",value:ge,sx:{width:"100%"},onChange:e=>je(e.target.value),label:"Email"}),(0,ie.jsx)(A.A,{type:"number",value:pe,placeholder:"Mobile Number",InputProps:{startAdornment:(0,ie.jsx)(q.A,{position:"start",children:"+1"})},sx:{width:"100%"},onChange:e=>ye(e.target.value)})]})})})]})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:7,md:8,lg:8,xl:9,children:(0,ie.jsx)(G.A,{title:(0,ie.jsx)(r.A,{sx:{p:1},children:"Contact Details"}),sx:{height:"100%"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(j.A,{spacing:.5,children:(0,ie.jsx)(A.A,{type:"text",value:ze,onChange:e=>qe(e.target.value),label:"Contact Name"})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(j.A,{spacing:.5,children:[(0,ie.jsx)(ie.Fragment,{}),(0,ie.jsx)(J.default,{className:"automap",apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",style:{width:"100%",height:"40px",borderRadius:"5px",border:"1px solid #e0e0e0",textIndent:"10px",outline:"none"},onPlaceSelected:e=>{let s,n,t,i;ke(e.formatted_address);for(let a=0;ake(e.target.value)})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6,children:(0,ie.jsx)(j.A,{spacing:.5,children:(0,ie.jsx)(A.A,{label:"City",type:"text",value:Ie,onChange:e=>Pe(e.target.value)})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,md:6,children:(0,ie.jsx)(j.A,{spacing:.5,children:(0,ie.jsx)(A.A,{label:"Zip Code",value:Re,onChange:e=>We(e.target.value)})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(j.A,{direction:"row",justifyContent:"flex-end",children:(0,ie.jsxs)(p.A,{variant:"contained",onClick:()=>{(async()=>{if(he)if(we)if(ge)if(pe)if(ze)if(Fe)if(Ie)if(Re)if(Be.lat&&Be.lng)if(!Le&&!Ve||Ee[0].role&&Ee[0].cost){let s={tenantid:Ye,registrationno:we,tenantname:he,primaryemail:ge,primarycontact:ze,contactno:pe,address:Fe,suburb:Ne,city:Ie,state:_e,postcode:Re,latitude:Be.lat.toString(),longitude:Be.lng.toString(),approved:Le&&1===re||!Le&&0===re&&!Ve?1:0};console.log(s);try{me(!0),await Q.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/update"),s).then((e=>{console.log("res:",e),"Update successful"===e.data.message&&((0,T.M8)("Client Details Updated Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:3e3}),me(!0),setTimeout((()=>{be(),fe(),oe(0),me(!1)}),2e3)),me(!1)})).catch((e=>{console.log(e),me(!1)}))}catch(e){console.log(e),me(!1)}}else ss("Fill client pricing");else setAlertmessage("Fill correct address"),ss("Fill correct address");else ss("Fill Zip code");else ss("Fill City name");else ss("Fill Address");else ss("Fill Contact name");else ss("Fill Mobile number");else ss("Fill Email address");else ss("Fill Business No.");else ss("Fill Business name")})(),Le&&ns()},children:["Update ",Le?"& Approve":"",Ve?"& Disable":""]})})})]})})})]})})}),1===Ue&&(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsx)(u.Ay,{container:!0,children:(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(G.A,{sx:{height:"100%",p:1},children:(0,ie.jsxs)(G.A,{sx:{height:"100%"},children:[(0,ie.jsx)($.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider"},children:(0,ie.jsxs)(C.A,{sx:{width:"100%"},children:[(0,ie.jsx)(i.A,{children:(0,ie.jsxs)(a.A,{children:[(0,ie.jsx)(l.A,{children:"#"}),(0,ie.jsx)(l.A,{children:"Category"}),(0,ie.jsx)(l.A,{sx:{width:"40%"},children:"Skill"}),(0,ie.jsx)(l.A,{sx:{width:"40%"},children:"Cost/Hr"}),(0,ie.jsx)(l.A,{sx:{width:"10px"}})]})}),(0,ie.jsx)(w.A,{children:Ee.map((e=>(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(a.A,{children:[(0,ie.jsx)(l.A,{children:e.sno}),(0,ie.jsx)(l.A,{children:e.categoryname}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(Y.A,{fullWidth:!0,id:"venuetype33",variant:"outlined",error:!0,freeSolo:!0,options:Te.sort(((e,s)=>-s.categoryname.localeCompare(e.categoryname))),groupBy:e=>e.categoryname,getOptionLabel:e=>e.subcategoryname,isOptionEqualToValue:(e,s)=>e.subcategoryid===s.subcategoryid,onChange:(s,n)=>{if(n){console.log("eval",s);let t=Ee.find((e=>e.subcategoryid===n.subcategoryid));if(console.log(n),t)ss("select different skill");else{let s=Ee;s[e.sno-1].role=n.subcategoryname,s[e.sno-1].categoryname=n.categoryname,s[e.sno-1].categoryid=n.categoryid,s[e.sno-1].subcategoryid=n.subcategoryid,s[e.sno-1].servicename=n.subcategoryname,s[e.sno-1].unitid=n.unitid,s[e.sno-1].unitname=n.unitname,Me([...s])}}console.log(n)},renderInput:s=>(0,ie.jsx)(A.A,(0,t.A)((0,t.A)({},s),{},{placeholder:"Choose a Skill",defaultValue:e.role,variant:"outlined",sx:{input:{"&::placeholder":{opacity:.9}}}})),value:{categoryid:e.categoryid,categoryname:"",cost:e.serviceamount,label:e.servicename,status:0,subcategoryid:e.subcategoryid,subcategoryname:e.servicename,unitid:e.unitid,unitname:e.unitname},disabled:!!Ae})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(A.A,{type:"number",onChange:s=>{let n=Ee;s.target.value<1e3&&(n[e.sno-1].cost=s.target.value,n[e.sno-1].servicevalue=s.target.value,n[e.sno-1].serviceamount=s.target.value,Me([...n])),console.log(s.target.value)},value:e.cost,autoComplete:"off",fullWidth:!0})}),(0,ie.jsx)(l.A,{children:(0,ie.jsx)(_.A,{onClick:()=>(async(e,s)=>{console.log(s);let n=Ee;if(0!==s.serviceid&&Ee.length>1){console.log([{serviceid:s.serviceid,tenantid:s.tenantid,categoryid:s.categoryid,subcategoryid:s.subcategoryid,servicecode:s.servicecode,servicename:s.servicename,unitid:s.unitid,unitname:s.unitname,serviceamount:s.servicevalue}]);try{await Q.A.delete("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/delete/services"),{data:[{serviceid:s.serviceid,tenantid:s.tenantid,categoryid:s.categoryid,subcategoryid:s.subcategoryid,servicecode:s.servicecode,servicename:s.servicename,unitid:s.unitid,unitname:s.unitname,serviceamount:s.servicevalue}]}).then((s=>{console.log("res"),console.log(s),"Deleted successful"===s.data.message&&((0,T.M8)("Client pricing Deleted",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),n.splice(e-1,1),n.map(((e,s)=>{e.sno=s+1})),console.log(n),Me([...n]))})).catch((e=>{console.log(e),me(!1)}))}catch(t){console.log(t),me(!1)}}else Ee.length>1?(n.splice(e-1,1),n.map(((e,s)=>{e.sno=s+1})),console.log(n),Me([...n])):1===Ee.length&&Me([{sno:1,role:"",cost:"",serviceid:s.serviceid,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}])})(e.sno,e),color:"error",children:(0,ie.jsx)(B.A,{})})})]})})))})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(p.A,{color:"primary",endIcon:(0,ie.jsx)(H.A,{}),onClick:()=>(()=>{let e=Ee;e[e.length-1].role&&e[e.length-1].cost?(e.push({sno:e.length+1,cost:"",role:"",serviceid:0,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}),Me([...e])):ss("Fill all Previous Details")})(),sx:{m:2},variant:"dashed",size:"extraSmall",children:"ADD SKILL"})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsx)(u.Ay,{container:!0,justifyContent:"flex-end",children:(0,ie.jsx)(u.Ay,{item:!0,children:(0,ie.jsx)(p.A,{variant:"contained",size:"small",onClick:ns,children:"Update"})})})})]})})})})})]})})})})]})})]})})),as>0&&(0,ie.jsx)(a.A,{style:{height:53*as},children:(0,ie.jsx)(l.A,{colSpan:6})})]})]})}),(0,ie.jsx)(ee.A,{rowsPerPageOptions:[10,25,50,100],component:"div",count:ce.length,rowsPerPage:de,page:ae,onPageChange:(e,s)=>{le(s)},onRowsPerPageChange:e=>{xe(parseInt(e.target.value,10)),le(0)}})]})]})}const ae=(0,o.A)(),le=(0,c.A)(ae.breakpoints.down("md")),[re,oe]=(0,Z.useState)(0),[ce,de]=(0,Z.useState)([]),[xe,he]=(0,Z.useState)([]),[ue,ge]=(0,Z.useState)([]),[Ae,me]=(0,Z.useState)(!1),[je,pe]=(0,Z.useState)(""),[ve,ye]=(0,Z.useState)(!1);(0,Z.useEffect)((()=>{localStorage.getItem("partnerid")&&(be(localStorage.getItem("partnerid")),fe(localStorage.getItem("partnerid")))}),[]),(0,Z.useEffect)((()=>{}),[je,re]);const fe=async e=>{me(!0);try{await Q.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/payments/requests/getpaymentrequest/?partnerid=").concat(e,"&status=1")).then((e=>{if("Successful"===e.data.message){let s=[];e.data.details.map(((e,n)=>{s=[...s,(0,t.A)((0,t.A)({},e),{},{sno:n+1})]})),he(s),console.log(e.data.details),me(!1)}})).catch((e=>{console.log(e),me(!1)}))}catch(s){console.log(s),me(!1)}},be=async e=>{me(!0);try{await Q.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/payments/requests/getpaymentrequest/?partnerid=").concat(e,"&status=0")).then((e=>{if("Success"===e.data.message){let s=[];e.data.details.map(((e,n)=>{s=[...s,(0,t.A)((0,t.A)({},e),{},{sno:n+1})]})),ge(s),de(s),console.log(e.data.details),me(!1)}})).catch((e=>{console.log(e),me(!1)}))}catch(s){console.log(s),me(!1)}},Ce=()=>{ye(!1)};return(0,ie.jsxs)(ie.Fragment,{children:[Ae&&(0,ie.jsx)(X.A,{}),(0,ie.jsxs)(u.Ay,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(j.A,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",sm:"center"},spacing:{xs:1.5,sm:0},children:[(0,ie.jsx)(f.A,{variant:"h3",children:"Payment Requests"}),(0,ie.jsx)(p.A,{variant:"contained",fullWidth:le,onClick:()=>{},children:"Create Request"})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,children:(0,ie.jsxs)(r.A,{sx:{overflow:"auto",border:1,borderColor:"grey.200",borderRadius:2,backgroundColor:"#fff",minHeight:400},children:[(0,ie.jsxs)(j.A,{alignItems:"center",justifyContent:"space-between",direction:"row",sx:{p:2,width:"100%",flexWrap:"wrap",gap:1},children:[(0,ie.jsxs)(k.A,{value:re,onChange:(e,s)=>{oe(s),1===s&&de(xe),0===s&&de(ue)},variant:"scrollable",scrollButtons:"auto",children:[(0,ie.jsx)(I.A,{label:"Pending",icon:(0,ie.jsx)(b.A,{label:ue.length,color:"primary",variant:"light",size:"small"}),iconPosition:"end"}),(0,ie.jsx)(I.A,{label:"Paid",iconPosition:"end",icon:(0,ie.jsx)(b.A,{label:xe.length,color:"primary",variant:"light",size:"small"})})]}),(0,ie.jsx)(D.A,{sx:{width:{xs:"100%",md:250}},children:(0,ie.jsx)(N.A,{size:"small",id:"header-search",startAdornment:(0,ie.jsx)(q.A,{position:"start",sx:{mr:-.5},children:(0,ie.jsx)(E.A,{})}),"aria-describedby":"header-search-text",inputProps:{"aria-label":"weight"},placeholder:"Search",value:je,onChange:e=>{pe(e.target.value)},autoComplete:"off"})})]}),(0,ie.jsx)(U,{})]})})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/7875.ed9def13.chunk.js b/build/static/js/7875.ed9def13.chunk.js deleted file mode 100644 index 8363001..0000000 --- a/build/static/js/7875.ed9def13.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7875],{97875:(e,s,n)=>{n.r(s),n.d(s,{default:()=>ne});var t=n(89379),i=n(69780),a=n(9213),l=n(21671),r=n(16491),c=n(96583),o=n(40033),d=n(28170),x=n(60899),h=n(29277),u=n(29925),g=n(79739),m=n(93230),A=n(82223),j=n(15769),p=n(34075),y=n(82917),v=n(41413),f=n(82053),b=n(33738),C=n(46639),S=n(48159),w=n(84142),F=n(74745),k=n(249),I=n(26050),P=n(14195),_=n(2046),D=n(25333),R=n(25277),q=n(25979),z=n(2660),N=n(77922),O=n(44070),B=n(8750),E=n(60767),H=n(37476),M=n(8881),W=n(4159),T=n.n(W),U=n(51400),Y=n(39060),K=n(50027),L=n(9950),Z=n(26910),V=n(52351),Q=n(56713),G=n(1320),J=n(6258),X=n(7251),$=n(80691),ee=n(99459),se=n(44414);const ne=()=>{function e(e,s,n){return s[n]e[n]?1:0}const s=[{id:"sno",disablePadding:!0,label:"#"},{id:"tenantname",numeric:!1,disablePadding:!1,label:"REQUESTOR"},{id:"contact",numeric:!1,disablePadding:!1,label:"BANK"},{id:"address3",disablePadding:!1,label:"IFSC"},{id:"address",disablePadding:!1,label:"REF NO"},{id:"amount",disablePadding:!1,label:"AMOUNT"},{id:"city",disablePadding:!1,label:"REASON"}];function n(e){const{order:n,orderBy:t,onRequestSort:c}=e;return(0,se.jsx)(i.A,{children:(0,se.jsx)(a.A,{children:s.map((e=>{return(0,se.jsx)(l.A,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",sortDirection:t===e.id&&n,children:(0,se.jsxs)(X.A,{active:t===e.id,direction:t===e.id?n:"asc",onClick:(s=e.id,e=>{c(e,s)}),children:[e.label,t===e.id?(0,se.jsx)(r.A,{component:"span",sx:$.A,children:"desc"===n?"sorted descending":"sorted ascending"}):null]})},e.id);var s}))})})}function W(){const[s,R]=L.useState("asc"),[q,z]=L.useState("calories"),[E,W]=L.useState([]),[V,X]=L.useState(0),[$,ae]=L.useState(10),[le,re]=(0,L.useState)(""),[ce,oe]=(0,L.useState)(""),[he,ue]=(0,L.useState)(""),[me,ye]=(0,L.useState)(""),[ve,fe]=(0,L.useState)(""),[be,Ce]=(0,L.useState)(""),[Se,we]=(0,L.useState)(""),[Fe,ke]=(0,L.useState)(""),[Ie,Pe]=(0,L.useState)(""),[_e,De]=(0,L.useState)(""),[Re]=(0,L.useState)(""),[qe,ze]=(0,L.useState)({});ee.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[Ne,Oe]=(0,L.useState)([]),[Be]=(0,L.useState)([]),[Ee,He]=(0,L.useState)(0),[Me]=(0,L.useState)(!1),[We]=(0,L.useState)(!1),[Te]=(0,L.useState)(!1),[Ue,Ye]=(0,L.useState)(""),[Ke,Le]=(0,L.useState)(""),[Ze,Ve]=(0,L.useState)("");(0,L.useEffect)((()=>{Oe([{sno:1,role:"",cost:"",serviceid:0,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}]),console.log(Ne)}),[]);const Qe=e=>{(0,M.M8)(e,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),console.log(alertmessage)};(0,L.useEffect)((()=>{try{ee.A.fromAddress(ve).then((e=>{if("OK"==e.status){const{lat:s,lng:n}=e.results[0].geometry.location;ze({lat:s,lng:n}),console.log(e)}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[ve]),(0,L.useEffect)((()=>{console.log("rolesarr"),console.log(Ne)}),[Ne]);const Ge=async()=>{console.log("submit");let e=[],s=!1;if(Ne.map((n=>{n.role&&n.cost||(s=!0),e.push({serviceid:n.serviceid,tenantid:Re,categoryid:n.categoryid,subcategoryid:n.subcategoryid,servicecode:n.servicecode,servicename:n.servicename,unitid:n.unitid,unitname:n.unitname,serviceamount:parseFloat(n.serviceamount),categoryname:n.categoryname,subcategoryname:n.servicename})})),console.log(e),s)(0,M.M8)("Fill all Details",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3});else try{xe(!0),await Z.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/update/services"),e).then((e=>{console.log("res:",e),"Update successful"===e.data.message&&(0,M.M8)("Service Updated Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),xe(!1)})).catch((e=>{console.log(e),xe(!1)}))}catch(n){console.log(n),xe(!1)}},Je=V>0?Math.max(0,(1+V)*$-ie.length):0,Xe=L.useMemo((()=>function(e,s){const n=e.map(((e,s)=>[e,s]));return n.sort(((e,n)=>{const t=s(e[0],n[0]);return 0!==t?t:e[1]-n[1]})),n.map((e=>e[0]))}(ie,function(s,n){return"desc"===s?(s,t)=>e(s,t,n):(s,t)=>-e(s,t,n)}(s,q)).slice(V*$,V*$+$)),[s,q,V,$]);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsxs)(c.A,{fullWidth:!0,open:ge,onClose:pe,scroll:"paper",maxWidth:"sm",TransitionComponent:H.s,children:[(0,se.jsx)(o.A,{children:"Create Request"}),(0,se.jsx)(d.A,{dividers:!0,children:(0,se.jsx)(K.A,{sx:{height:"100%"},children:(0,se.jsxs)(x.Ay,{container:!0,spacing:2.5,children:[(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Reference No"}),(0,se.jsx)(u.A,{type:"number",fullWidth:!0,sx:{width:"100%"},value:Ue,onChange:e=>{Ye(e.target.value),console.log(e)}})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Requestor"}),(0,se.jsx)(u.A,{value:Ke,onChange:e=>Le(e.target.value),fullWidth:!0,sx:{width:"100%"}})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Bank Name"}),(0,se.jsx)(u.A,{value:Ze,sx:{width:"100%"},onChange:e=>Ve(e.target.value)})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Amount"}),(0,se.jsx)(u.A,{type:"number",value:amount,sx:{width:"100%"},onChange:e=>setAmount(e.target.value)})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Account No"}),(0,se.jsx)(u.A,{type:"number",fullWidth:!0,sx:{width:"100%"},value:accountno,onChange:e=>{setAccountno(e.target.value),console.log(e)}})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"IFSC Code"}),(0,se.jsx)(u.A,{value:ifsc,onChange:e=>setIfsc(e.target.value),fullWidth:!0,sx:{width:"100%"}})]}),(0,se.jsxs)(x.Ay,{item:!0,xs:12,sm:6,children:[(0,se.jsx)(h.A,{children:"Reason"}),(0,se.jsx)(u.A,{value:reason,onChange:e=>setReason(e.target.value),fullWidth:!0,sx:{width:"100%"}})]})]})})}),(0,se.jsx)(g.A,{children:(0,se.jsx)(x.Ay,{container:!0,children:(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(m.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[(0,se.jsx)(A.A,{variant:"contained",onClick:()=>{(()=>{if(Ue)if(Ke)if(Ze)if(amount)if(accountno)if(ifsc)if(reason){let e={requestid:0,requestdate:T()().format("YYYY-MM-DD HH:mm:ss"),referenceno:Ue,Apptypeid:22,requesttype:"staffexpenses",reason:reason,requestor:Ke,amount:amount,Accountno:accountno,bankname:Ze,ifsccode:ifsc};console.log(e)}else Qe("Fill Reason");else Qe("Fill IFSC");else Qe("Fill Account No");else Qe("Fill Amount");else Qe("Fill Bank Name");else Qe("Fill Requestor");else Qe("Fill Reference No")})()},children:"Update"}),(0,se.jsx)(A.A,{variant:"contained",onClick:()=>{pe()},color:"error",children:"Close"})]})})})})]}),(0,se.jsxs)(r.A,{sx:{width:"100%"},children:[(0,se.jsx)(G.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider"},children:(0,se.jsxs)(j.A,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[(0,se.jsx)(n,{numSelected:E.length,order:s,orderBy:q,onSelectAllClick:e=>{if(e.target.checked){const e=ie.map((e=>e.name));W(e)}else W([])},onRequestSort:(e,n)=>{R(q===n&&"asc"===s?"desc":"asc"),z(n)},rowCount:ie.length}),de&&(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(p.A,{children:[0,1,2,3,4,5,6,7,8,9].map((e=>(0,se.jsxs)(a.A,{children:[(0,se.jsx)(l.A,{children:(0,se.jsx)(y.A,{animation:"wave"})}),(0,se.jsx)(l.A,{children:(0,se.jsxs)(m.A,{direction:"row",spacing:1,children:[(0,se.jsx)(y.A,{variant:"circular",width:40,height:40}),(0,se.jsxs)(m.A,{direction:"column",children:[(0,se.jsx)(y.A,{animation:"wave",width:100}),(0,se.jsx)(y.A,{animation:"wave",width:100})]})]})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(y.A,{animation:"wave"})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(y.A,{animation:"wave"})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(y.A,{animation:"wave"})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(y.A,{animation:"wave"})})]},e)))})}),(0,se.jsxs)(p.A,{children:[Xe.map(((e,s)=>{const n=(c=e.sno,-1!==E.indexOf(c));var c;const o="enhanced-table-checkbox-".concat(s);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsxs)(a.A,{hover:!0,onClick:s=>((e,s)=>{const n=E.indexOf(s);let t=[];-1===n?t=t.concat(E,s):0===n?t=t.concat(E.slice(1)):n===E.length-1?t=t.concat(E.slice(0,-1)):n>0&&(t=t.concat(E.slice(0,n),E.slice(n+1))),W(t)})(0,e.sno),role:"checkbox","aria-checked":n,tabIndex:-1,sx:{cursor:"pointer"},children:[(0,se.jsx)(l.A,{component:"th",id:o,scope:"row",padding:"none",children:e.sno}),(0,se.jsx)(l.A,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,se.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,se.jsx)(v.A,{alt:"",size:"sm",sx:{width:"25px",height:"25px"}}),(0,se.jsx)(m.A,{direction:"column",children:(0,se.jsx)(f.A,{variant:"caption",children:e.requestor})})]})}),(0,se.jsxs)(l.A,{align:"left",children:[(0,se.jsxs)(f.A,{variant:"caption",children:[" ",e.accountno]}),(0,se.jsxs)(f.A,{variant:"h6",children:[" ",e.bankname]})]}),(0,se.jsx)(l.A,{children:e.ifsccode}),(0,se.jsx)(l.A,{align:"left",children:e.referenceno}),(0,se.jsx)(l.A,{children:e.amount}),(0,se.jsx)(l.A,{children:e.reason})]},e.sno),(0,se.jsx)(a.A,{children:(0,se.jsxs)(l.A,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:8,sx:{width:"100%"},children:[(0,se.jsx)(b.A,{in:expandopen===e.sno,timeout:"auto",unmountOnExit:!0,children:(0,se.jsx)(H.A,{type:"slide",direction:"down",in:!0,children:(0,se.jsx)(K.A,{sx:{height:"100%"},children:Te?(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(K.A,{children:(0,se.jsx)(m.A,{alignItems:"center",children:(0,se.jsx)(C.A,{})})})}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsxs)(S.A,{value:Ee,onChange:(e,s)=>He(s),children:[(0,se.jsx)(w.A,{label:"client Details"}),(0,se.jsx)(w.A,{label:"Client Pricing"})]}),0===Ee&&(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(x.Ay,{container:!0,spacing:2.5,sx:{pl:{xs:0,sm:5,md:6,lg:10,xl:12},p:2},children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,sm:5,md:4,lg:4,xl:3,children:(0,se.jsx)(K.A,{sx:{height:"100%"},children:(0,se.jsxs)(x.Ay,{container:!0,spacing:3,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(m.A,{spacing:2.5,alignItems:"center",children:[(0,se.jsx)(v.A,{alt:"Avatar 1",size:"xl"}),(0,se.jsxs)(m.A,{spacing:.5,alignItems:"center",children:[(0,se.jsx)(f.A,{variant:"h5",children:le}),(0,se.jsx)(f.A,{color:"secondary",children:me})]})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(F.A,{})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(k.A,{component:"nav","aria-label":"main mailbox folders",sx:{py:0},children:[(0,se.jsxs)(I.Ay,{children:[(0,se.jsx)(P.A,{children:(0,se.jsx)(U.A,{})}),(0,se.jsx)(f.A,{align:"right",children:ce})]}),(0,se.jsxs)(I.Ay,{children:[(0,se.jsx)(P.A,{children:(0,se.jsx)(Y.A,{})}),(0,se.jsxs)(f.A,{align:"left",children:["+1 ",he]})]})]})})]})})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,sm:7,md:8,lg:8,xl:9,children:(0,se.jsx)(K.A,{title:(0,se.jsx)(r.A,{sx:{p:1},children:"Contact Details"}),sx:{height:"100%"},children:(0,se.jsxs)(k.A,{sx:{py:0},children:[(0,se.jsx)(I.Ay,{children:(0,se.jsxs)(x.Ay,{container:!0,spacing:3,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6,children:(0,se.jsxs)(m.A,{spacing:.5,children:[(0,se.jsx)(f.A,{color:"secondary",children:" Contact Name"}),(0,se.jsx)(f.A,{children:Fe})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6})]})}),(0,se.jsx)(I.Ay,{children:(0,se.jsxs)(m.A,{spacing:.5,children:[(0,se.jsx)(f.A,{color:"secondary",children:"Address"}),(0,se.jsx)(f.A,{children:ve})]})}),(0,se.jsx)(I.Ay,{children:(0,se.jsxs)(x.Ay,{container:!0,spacing:3,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6,children:(0,se.jsxs)(m.A,{spacing:.5,children:[(0,se.jsx)(f.A,{color:"secondary",children:"City"}),(0,se.jsx)(f.A,{children:be})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6,children:(0,se.jsxs)(m.A,{spacing:.5,children:[(0,se.jsx)(f.A,{color:"secondary",children:"Zip Code"}),(0,se.jsx)(f.A,{children:Se})]})})]})})]})})})]})}),1===Ee&&(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(x.Ay,{container:!0,sx:{p:1},children:(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(K.A,{sx:{height:"100%",p:1},children:Ne[0].role?(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(G.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider"},children:(0,se.jsxs)(j.A,{sx:{width:"100%"},children:[(0,se.jsx)(i.A,{children:(0,se.jsxs)(a.A,{children:[(0,se.jsx)(l.A,{children:"#"}),(0,se.jsx)(l.A,{sx:{width:"30%"},children:"Category"}),(0,se.jsx)(l.A,{sx:{width:"30%"},children:"Skill"}),(0,se.jsx)(l.A,{sx:{width:"30%"},children:"Cost/Hr"})]})}),(0,se.jsx)(p.A,{children:Ne.map((e=>(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(a.A,{children:[(0,se.jsx)(l.A,{children:e.sno}),(0,se.jsx)(l.A,{children:e.categoryname}),(0,se.jsx)(l.A,{children:e.role}),(0,se.jsx)(l.A,{children:e.cost})]})})))})]})})}):(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(f.A,{children:"No Data found"})})})})})})]})})})}),(0,se.jsx)(b.A,{in:editexpandopen===e.sno,timeout:"auto",unmountOnExit:!0,children:(0,se.jsx)(H.A,{type:"slide",direction:"down",in:!0,children:Te?(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(K.A,{children:(0,se.jsx)(m.A,{alignItems:"center",children:(0,se.jsx)(C.A,{})})})}):(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(K.A,{sx:{height:"100%"},children:[(0,se.jsxs)(S.A,{value:Ee,onChange:(e,s)=>He(s),children:[(0,se.jsx)(w.A,{label:"client Details"}),(0,se.jsx)(w.A,{label:"Client Pricing"})]}),0===Ee&&(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(K.A,{sx:{height:"100%"},children:(0,se.jsxs)(x.Ay,{container:!0,spacing:2.5,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,sm:5,md:4,lg:4,xl:3,children:(0,se.jsx)(K.A,{title:(0,se.jsx)(r.A,{sx:{p:1},children:"Client"}),sx:{height:"100%"},children:(0,se.jsxs)(x.Ay,{container:!0,spacing:3,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(m.A,{spacing:2,alignItems:"center",sx:{width:"100%"},children:[(0,se.jsx)(u.A,{type:"text",label:"Business name",fullWidth:!0,sx:{width:"100%"},value:le,onChange:e=>re(e.target.value)}),(0,se.jsx)(u.A,{type:"number",value:me,onChange:e=>ye(e.target.value),label:"Business No.",fullWidth:!0,sx:{width:"100%"}})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(k.A,{component:"nav","aria-label":"main mailbox folders",sx:{py:0},children:(0,se.jsxs)(m.A,{direction:"column",spacing:2,sx:{width:"100%"},children:[(0,se.jsx)(u.A,{type:"email",value:ce,sx:{width:"100%"},onChange:e=>oe(e.target.value),label:"Email"}),(0,se.jsx)(u.A,{type:"number",value:he,placeholder:"Mobile Number",InputProps:{startAdornment:(0,se.jsx)(_.A,{position:"start",children:"+1"})},sx:{width:"100%"},onChange:e=>ue(e.target.value)})]})})})]})})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,sm:7,md:8,lg:8,xl:9,children:(0,se.jsx)(K.A,{title:(0,se.jsx)(r.A,{sx:{p:1},children:"Contact Details"}),sx:{height:"100%"},children:(0,se.jsxs)(x.Ay,{container:!0,spacing:3,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(m.A,{spacing:.5,children:(0,se.jsx)(u.A,{type:"text",value:Fe,onChange:e=>ke(e.target.value),label:"Contact Name"})})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(m.A,{spacing:.5,children:[(0,se.jsx)(se.Fragment,{}),(0,se.jsx)(Q.default,{className:"automap",apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",style:{width:"100%",height:"40px",borderRadius:"5px",border:"1px solid #e0e0e0",textIndent:"10px",outline:"none"},onPlaceSelected:e=>{let s,n,t,i;fe(e.formatted_address);for(let a=0;afe(e.target.value)})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6,children:(0,se.jsx)(m.A,{spacing:.5,children:(0,se.jsx)(u.A,{label:"City",type:"text",value:be,onChange:e=>Ce(e.target.value)})})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,md:6,children:(0,se.jsx)(m.A,{spacing:.5,children:(0,se.jsx)(u.A,{label:"Zip Code",value:Se,onChange:e=>we(e.target.value)})})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(m.A,{direction:"row",justifyContent:"flex-end",children:(0,se.jsxs)(A.A,{variant:"contained",onClick:()=>{(async()=>{if(le)if(me)if(ce)if(he)if(Fe)if(ve)if(be)if(Se)if(qe.lat&&qe.lng)if(!Me&&!We||Ne[0].role&&Ne[0].cost){let s={tenantid:Re,registrationno:me,tenantname:le,primaryemail:ce,primarycontact:Fe,contactno:he,address:ve,suburb:_e,city:be,state:Ie,postcode:Se,latitude:qe.lat.toString(),longitude:qe.lng.toString(),approved:Me&&1===ne||!Me&&0===ne&&!We?1:0};console.log(s);try{xe(!0),await Z.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/update"),s).then((e=>{console.log("res:",e),"Update successful"===e.data.message&&((0,M.M8)("Client Details Updated Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:3e3}),xe(!0),setTimeout((()=>{je(),Ae(),te(0),xe(!1)}),2e3)),xe(!1)})).catch((e=>{console.log(e),xe(!1)}))}catch(e){console.log(e),xe(!1)}}else Qe("Fill client pricing");else setAlertmessage("Fill correct address"),Qe("Fill correct address");else Qe("Fill Zip code");else Qe("Fill City name");else Qe("Fill Address");else Qe("Fill Contact name");else Qe("Fill Mobile number");else Qe("Fill Email address");else Qe("Fill Business No.");else Qe("Fill Business name")})(),Me&&Ge()},children:["Update ",Me?"& Approve":"",We?"& Disable":""]})})})]})})})]})})}),1===Ee&&(0,se.jsx)(se.Fragment,{children:(0,se.jsx)(x.Ay,{container:!0,children:(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(K.A,{sx:{height:"100%",p:1},children:(0,se.jsxs)(K.A,{sx:{height:"100%"},children:[(0,se.jsx)(G.A,{sx:{width:"100%",borderBottom:1,borderColor:"divider"},children:(0,se.jsxs)(j.A,{sx:{width:"100%"},children:[(0,se.jsx)(i.A,{children:(0,se.jsxs)(a.A,{children:[(0,se.jsx)(l.A,{children:"#"}),(0,se.jsx)(l.A,{children:"Category"}),(0,se.jsx)(l.A,{sx:{width:"40%"},children:"Skill"}),(0,se.jsx)(l.A,{sx:{width:"40%"},children:"Cost/Hr"}),(0,se.jsx)(l.A,{sx:{width:"10px"}})]})}),(0,se.jsx)(p.A,{children:Ne.map((e=>(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)(a.A,{children:[(0,se.jsx)(l.A,{children:e.sno}),(0,se.jsx)(l.A,{children:e.categoryname}),(0,se.jsx)(l.A,{children:(0,se.jsx)(N.A,{fullWidth:!0,id:"venuetype33",variant:"outlined",error:!0,freeSolo:!0,options:Be.sort(((e,s)=>-s.categoryname.localeCompare(e.categoryname))),groupBy:e=>e.categoryname,getOptionLabel:e=>e.subcategoryname,isOptionEqualToValue:(e,s)=>e.subcategoryid===s.subcategoryid,onChange:(s,n)=>{if(n){console.log("eval",s);let t=Ne.find((e=>e.subcategoryid===n.subcategoryid));if(console.log(n),t)Qe("select different skill");else{let s=Ne;s[e.sno-1].role=n.subcategoryname,s[e.sno-1].categoryname=n.categoryname,s[e.sno-1].categoryid=n.categoryid,s[e.sno-1].subcategoryid=n.subcategoryid,s[e.sno-1].servicename=n.subcategoryname,s[e.sno-1].unitid=n.unitid,s[e.sno-1].unitname=n.unitname,Oe([...s])}}console.log(n)},renderInput:s=>(0,se.jsx)(u.A,(0,t.A)((0,t.A)({},s),{},{placeholder:"Choose a Skill",defaultValue:e.role,variant:"outlined",sx:{input:{"&::placeholder":{opacity:.9}}}})),value:{categoryid:e.categoryid,categoryname:"",cost:e.serviceamount,label:e.servicename,status:0,subcategoryid:e.subcategoryid,subcategoryname:e.servicename,unitid:e.unitid,unitname:e.unitname},disabled:!!de})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(u.A,{type:"number",onChange:s=>{let n=Ne;s.target.value<1e3&&(n[e.sno-1].cost=s.target.value,n[e.sno-1].servicevalue=s.target.value,n[e.sno-1].serviceamount=s.target.value,Oe([...n])),console.log(s.target.value)},value:e.cost,autoComplete:"off",fullWidth:!0})}),(0,se.jsx)(l.A,{children:(0,se.jsx)(D.A,{onClick:()=>(async(e,s)=>{console.log(s);let n=Ne;if(0!==s.serviceid&&Ne.length>1){console.log([{serviceid:s.serviceid,tenantid:s.tenantid,categoryid:s.categoryid,subcategoryid:s.subcategoryid,servicecode:s.servicecode,servicename:s.servicename,unitid:s.unitid,unitname:s.unitname,serviceamount:s.servicevalue}]);try{await Z.A.delete("".concat("https://jupiter.nearle.app/live/api/v2","/tenants/delete/services"),{data:[{serviceid:s.serviceid,tenantid:s.tenantid,categoryid:s.categoryid,subcategoryid:s.subcategoryid,servicecode:s.servicecode,servicename:s.servicename,unitid:s.unitid,unitname:s.unitname,serviceamount:s.servicevalue}]}).then((s=>{console.log("res"),console.log(s),"Deleted successful"===s.data.message&&((0,M.M8)("Client pricing Deleted",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),n.splice(e-1,1),n.map(((e,s)=>{e.sno=s+1})),console.log(n),Oe([...n]))})).catch((e=>{console.log(e),xe(!1)}))}catch(t){console.log(t),xe(!1)}}else Ne.length>1?(n.splice(e-1,1),n.map(((e,s)=>{e.sno=s+1})),console.log(n),Oe([...n])):1===Ne.length&&Oe([{sno:1,role:"",cost:"",serviceid:s.serviceid,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}])})(e.sno,e),color:"error",children:(0,se.jsx)(O.A,{})})})]})})))})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(A.A,{color:"primary",endIcon:(0,se.jsx)(B.A,{}),onClick:()=>(()=>{let e=Ne;e[e.length-1].role&&e[e.length-1].cost?(e.push({sno:e.length+1,cost:"",role:"",serviceid:0,tenantid:0,categoryid:0,subcategoryid:0,servicecode:"",servicename:"",unitid:0,unitname:"",serviceamount:"",discountid:0,taxpercent:0,taxamount:0,servicevalue:0,categoryname:""}),Oe([...e])):Qe("Fill all Previous Details")})(),sx:{m:2},variant:"dashed",size:"extraSmall",children:"ADD SKILL"})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsx)(x.Ay,{container:!0,justifyContent:"flex-end",children:(0,se.jsx)(x.Ay,{item:!0,children:(0,se.jsx)(A.A,{variant:"contained",size:"small",onClick:Ge,children:"Update"})})})})]})})})})})]})})})})]})})]})})),Je>0&&(0,se.jsx)(a.A,{style:{height:53*Je},children:(0,se.jsx)(l.A,{colSpan:6})})]})]})}),(0,se.jsx)(J.A,{rowsPerPageOptions:[10,25,50,100],component:"div",count:ie.length,rowsPerPage:$,page:V,onPageChange:(e,s)=>{X(s)},onRowsPerPageChange:e=>{ae(parseInt(e.target.value,10)),X(0)}})]})]})}const[ne,te]=(0,L.useState)(0),[ie,ae]=(0,L.useState)([]),[le,re]=(0,L.useState)([]),[ce,oe]=(0,L.useState)([]),[de,xe]=(0,L.useState)(!1),[he,ue]=(0,L.useState)(""),[ge,me]=(0,L.useState)(!1);(0,L.useEffect)((()=>{localStorage.getItem("partnerid")&&(je(localStorage.getItem("partnerid")),Ae(localStorage.getItem("partnerid")))}),[]),(0,L.useEffect)((()=>{}),[he,ne]);const Ae=async e=>{xe(!0);try{await Z.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/payments/requests/getpaymentrequest/?partnerid=").concat(e,"&status=1")).then((e=>{if("Successful"===e.data.message){let s=[];e.data.details.map(((e,n)=>{s=[...s,(0,t.A)((0,t.A)({},e),{},{sno:n+1})]})),re(s),console.log(e.data.details),xe(!1)}})).catch((e=>{console.log(e),xe(!1)}))}catch(s){console.log(s),xe(!1)}},je=async e=>{xe(!0);try{await Z.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/payments/requests/getpaymentrequest/?partnerid=").concat(e,"&status=0")).then((e=>{if("Success"===e.data.message){let s=[];e.data.details.map(((e,n)=>{s=[...s,(0,t.A)((0,t.A)({},e),{},{sno:n+1})]})),oe(s),ae(s),console.log(e.data.details),xe(!1)}})).catch((e=>{console.log(e),xe(!1)}))}catch(s){console.log(s),xe(!1)}},pe=()=>{me(!1)};return(0,se.jsxs)(se.Fragment,{children:[de&&(0,se.jsx)(V.A,{}),(0,se.jsxs)(x.Ay,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(m.A,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[(0,se.jsx)(f.A,{variant:"h3",children:"Payment Requests"}),(0,se.jsx)(A.A,{variant:"contained",onClick:()=>{},children:"Create Request"})]})}),(0,se.jsx)(x.Ay,{item:!0,xs:12,children:(0,se.jsxs)(r.A,{sx:{overflow:"auto",border:1,borderColor:"grey.200",borderRadius:2,backgroundColor:"#fff",minHeight:400},children:[(0,se.jsxs)(m.A,{alignItems:"center",justifyContent:"space-between",direction:"row",sx:{p:2,width:"100%"},children:[(0,se.jsxs)(S.A,{value:ne,onChange:(e,s)=>{te(s),1===s&&ae(le),0===s&&ae(ce)},variant:"scrollable",scrollButtons:"auto",children:[(0,se.jsx)(w.A,{label:"Pending",icon:(0,se.jsx)(R.A,{label:ce.length,color:"primary",variant:"light",size:"small"}),iconPosition:"end"}),(0,se.jsx)(w.A,{label:"Paid",iconPosition:"end",icon:(0,se.jsx)(R.A,{label:le.length,color:"primary",variant:"light",size:"small"})})]}),(0,se.jsx)(q.A,{sx:{width:250,display:{xs:"none",md:"flex"}},children:(0,se.jsx)(z.A,{size:"small",id:"header-search",startAdornment:(0,se.jsx)(_.A,{position:"start",sx:{mr:-.5},children:(0,se.jsx)(E.A,{})}),"aria-describedby":"header-search-text",inputProps:{"aria-label":"weight"},placeholder:"Search",value:he,onChange:e=>{ue(e.target.value)},autoComplete:"off"})})]}),(0,se.jsx)(W,{})]})})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/8846.0ebfcc74.chunk.js b/build/static/js/8846.0ebfcc74.chunk.js deleted file mode 100644 index a7e1d3c..0000000 --- a/build/static/js/8846.0ebfcc74.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8846],{11041:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Me});var o=r(89379),n=r(9950),i=r(26910),a=r(60010),l=r(36150),s=r(2235),c=r(41413),d=r(83274),u=r(16491),x=r(93230),h=r(82917),p=r(82053),m=r(55158),g=r(60899),f=r(77922),b=r(29925),v=r(82223),A=r(1320),j=r(15769),y=r(69780),w=r(9213),S=r(21671),k=r(34075),M=r(25333),D=r(74745),C=r(96583),I=r(40033),z=r(28170),P=r(25277),R=r(79739),W=r(31222),Y=r(43302),T=r(99810),L=r(49029),N=r(47113),O=r(33516),E=r(82215),F=r(2527),K=r.n(F),H=(r(55392),r(4159)),_=r.n(H),B=r(57560),q=r(14857),J=r(94826),Z=r(44414),U=r(36220);_().extend(U);const G=new(K().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),V=new(K().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),X=e=>{let{coordinates:t,additionalProps:r,order:o,setMapOpen:i}=e;console.log("additionalProps",r);const a=(0,n.useRef)(null),l=(0,q.A)(),[s,c]=(0,n.useState)([]),[d,h]=(0,n.useState)(!1);if((0,n.useEffect)((()=>{if(a.current&&t.length>0){const e=[[Math.min(...t.map((e=>e.lat))),Math.min(...t.map((e=>e.lng)))],[Math.max(...t.map((e=>e.lat))),Math.max(...t.map((e=>e.lng)))]];a.current.fitBounds(e)}}),[t]),(0,n.useEffect)((()=>{(async()=>{if(h(!0),t.length<2)return c([]),void h(!1);const e=(e,t)=>{if(e.length<=t)return e;const r=Math.ceil(e.length/t),o=e.filter(((e,t)=>t%r===0)),n=e[e.length-1];return o[o.length-1]!==n&&o.push(n),o};try{const r=e(t,90).map((e=>"".concat(e.lng,",").concat(e.lat))).join(";"),o="https://router.project-osrm.org/match/v1/driving/".concat(r,"?overview=full&geometries=geojson&gaps=ignore&tidy=true"),n=await fetch(o),i=await n.json();if(i.matchings&&i.matchings.length>0){const e=i.matchings.flatMap((e=>{var t;return((null===(t=e.geometry)||void 0===t?void 0:t.coordinates)||[]).map((e=>{let[t,r]=e;return{lat:r,lng:t}}))}));if(e.length>=2)return c(e),void h(!1)}}catch(r){console.warn("OSRM Match error, trying route fallback:",r)}try{const r=e(t,25).map((e=>"".concat(e.lng,",").concat(e.lat))).join(";"),o="https://router.project-osrm.org/route/v1/driving/".concat(r,"?overview=full&geometries=geojson"),n=await fetch(o),i=await n.json();if(i.routes&&i.routes[0]){const e=i.routes[0].geometry.coordinates.map((e=>{let[t,r]=e;return{lat:r,lng:t}}));c(e)}else c(t)}catch(o){console.error("OSRM Route fallback error:",o),c(t)}finally{h(!1)}})()}),[t]),!t||0===t.length)return null;const m=t[0],g=t[t.length-1],f=t[Math.floor(t.length/2)],b=e=>{let{label:t,value:r}=e;return(0,Z.jsxs)(x.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,Z.jsxs)(p.A,{variant:"subtitle1",sx:{fontWeight:600},children:[t,":"]}),(0,Z.jsx)(P.A,{label:r||"0.00",color:"primary",sx:{fontWeight:700}})]})};return(0,Z.jsxs)(u.A,{sx:{width:"100%",height:"100vh",position:"relative",overflow:"hidden"},children:[d&&(0,Z.jsx)(J.A,{}),(0,Z.jsx)(P.A,{label:"Close",icon:(0,Z.jsx)(B.A,{style:{fontSize:18}}),onClick:()=>i(!1),sx:{position:"absolute",top:12,right:12,zIndex:2e3,bgcolor:l.palette.error.main,color:"#fff",fontWeight:600,borderRadius:"12px",px:1.5,py:.5,boxShadow:l.shadows[4],cursor:"pointer","& .MuiChip-icon":{color:"#fff"}}}),(0,Z.jsxs)(T.W,{center:f,zoom:14,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},ref:a,children:[(0,Z.jsx)(L.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,Z.jsx)(N.p,{position:m,icon:G,children:(0,Z.jsx)(O.m,{direction:"bottom",children:"Pickup: ".concat(_()(r.riderStart).format("DD-MM-YYYY hh:mm A"))})}),(0,Z.jsx)(N.p,{position:g,icon:V,children:(0,Z.jsx)(O.m,{direction:"bottom",children:"Drop: ".concat(_()(r.riderEnd).format("DD-MM-YYYY hh:mm A"))})}),s.length>0&&(0,Z.jsx)(E.R,{positions:s,pathOptions:{color:"blue",weight:5}})]}),(0,Z.jsx)(u.A,{sx:{position:"absolute",bottom:0,width:"100%",bgcolor:"rgba(255,255,255,0.96)",p:2,boxShadow:l.shadows[3],zIndex:1500},children:(0,Z.jsxs)(x.A,{direction:"row",flexWrap:"wrap",rowGap:1.5,columnGap:3,alignItems:"center",children:[(0,Z.jsx)(b,{label:"Tenant",value:null===o||void 0===o?void 0:o.tenantname}),(0,Z.jsx)(b,{label:"Rider",value:null===o||void 0===o?void 0:o.ridername}),(0,Z.jsx)(b,{label:"Pickup",value:null===o||void 0===o?void 0:o.pickupcustomer}),(0,Z.jsx)(b,{label:"Drop",value:null===o||void 0===o?void 0:o.deliverycustomer}),(0,Z.jsx)(b,{label:"Kms",value:null===o||void 0===o?void 0:o.kms}),(0,Z.jsx)(b,{label:"Actual Kms",value:null===o||void 0===o?void 0:o.actualkms}),(0,Z.jsx)(b,{label:"Rider Kms",value:null===o||void 0===o?void 0:o.riderkms})]})})]})};var $=r(81425),Q=r(90376),ee=r(52351),te=r(8881),re=r(35678),oe=r(56311),ne=r(58691),ie=r(59212),ae=r(20466);function le(e){let{rows:t=5,columns:r=6,height:o=40}=e;return(0,Z.jsx)(Z.Fragment,{children:[...Array(t)].map(((e,t)=>(0,Z.jsx)(w.A,{children:[...Array(r)].map(((e,t)=>(0,Z.jsx)(S.A,{children:(0,Z.jsx)(h.A,{variant:"rectangular",height:o,width:70,animation:"wave"})},t)))},t)))})}var se=r(36220);_().extend(se);const ce=(e,t,r)=>{(0,te.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:r||1500})},de={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},ue=(e,t)=>"".concat(e).concat(t),xe=e=>ue(e,"08"),he=e=>ue(e,"18"),pe=e=>ue(e,"26"),me=e=>ue(e,"55"),ge="#662582",fe="#9255AB",be=e=>(0,Z.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:de.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ve=e=>{let{color:t,selected:r,size:o=24,children:n}=e;return(0,Z.jsx)(c.A,{sx:{width:o,height:o,bgcolor:r?t:he(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},Ae=e=>({"& .MuiOutlinedInput-root":{borderRadius:de.radiusPill+"px",bgcolor:xe(e),fontWeight:600,"& fieldset":{borderColor:me(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(pe(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}),je={all:{label:"All",color:ge,icon:W.YBc},pending:{label:"Pending",color:"#f59e0b",icon:W.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:W.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:W.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:W.gsJ},active:{label:"Active",color:"#14b8a6",icon:W.pk7},delivered:{label:"Delivered",color:"#10b981",icon:W.mU9},skipped:{label:"Skipped",color:"#f97316",icon:W.ivF},cancelled:{label:"Cancelled",color:"#ef4444",icon:W.uDv}},ye=["all","pending","accepted","arrived","picked","active","delivered","skipped","cancelled"],we=e=>{let{color:t,icon:r,label:o,tooltip:n}=e;return(0,Z.jsx)(d.A,{title:n||"",placement:"top",children:(0,Z.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:xe(t),border:"1px solid ".concat(me(t)),color:t,fontSize:11,fontWeight:800,minWidth:80,justifyContent:"center",whiteSpace:"nowrap"},children:[r,o]})})},Se=e=>{let{value:t,formatDate:r,formatTime:o,success:n}=e;return t?(0,Z.jsxs)(x.A,{spacing:.25,children:[(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary,fontWeight:600,whiteSpace:"nowrap"},children:r(t)}),(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textPrimary,fontWeight:800,whiteSpace:"nowrap"},children:o(t)}),n&&(0,Z.jsx)(Y.cxC,{style:{color:"#10b981",fontSize:12}})]})]}):(0,Z.jsxs)(x.A,{spacing:.5,children:[(0,Z.jsx)(h.A,{animation:!1,variant:"text",width:70,height:12}),(0,Z.jsx)(h.A,{animation:!1,variant:"text",width:55,height:14})]})};function ke(e,t){const r=e=>e*Math.PI/180,o=r(e[0]),n=r(t[0]),i=r(t[0]-e[0]),a=r(t[1]-e[1]),l=Math.sin(i/2)**2+Math.cos(o)*Math.cos(n)*Math.sin(a/2)**2;return 12742*Math.asin(Math.min(1,Math.sqrt(l)))}function Me(){const e=(0,n.useRef)(),t=(0,n.useRef)(),r=(0,n.useRef)(null),h=(0,n.useRef)(null),Y=localStorage.getItem("userid"),[T,L]=(0,n.useState)(0),[N,O]=(0,n.useState)(50),[E,F]=(0,n.useState)("All"),[K,H]=(0,n.useState)(_()().format("YYYY-MM-DD")),[B,q]=(0,n.useState)(_()().format("YYYY-MM-DD")),[U,G]=(0,n.useState)(!1),[V,se]=(0,n.useState)(!1),[ue,Me]=(0,n.useState)("Today"),[De,Ce]=(0,n.useState)(0),[Ie,ze]=(0,n.useState)(""),[Pe,Re]=(0,n.useState)(""),[We,Ye]=(0,n.useState)([]),[Te,Le]=(0,n.useState)(),[Ne,Oe]=(0,n.useState)(),[Ee,Fe]=(0,n.useState)({}),[Ke,He]=(0,n.useState)(!1);let[_e,Be]=(0,n.useState)(0),[qe,Je]=(0,n.useState)(0),[Ze,Ue]=(0,n.useState)(0),[Ge,Ve]=(0,n.useState)(0),[Xe,$e]=(0,n.useState)(0),[Qe,et]=(0,n.useState)(0),[tt,rt]=(0,n.useState)(0),[ot,nt]=(0,n.useState)(0),[it,at]=(0,n.useState)(0);const[lt,st]=(0,n.useState)("All"),[ct,dt]=(0,n.useState)(0),[ut,xt]=(0,n.useState)(0),[ht,pt]=(0,n.useState)(null),[mt,gt]=(0,n.useState)(null),[ft,bt]=(0,n.useState)(),[vt,At]=(0,n.useState)(null),[jt,yt]=(0,n.useState)(!1),[wt,St]=(0,n.useState)(!1),kt={all:_e,pending:Ze,accepted:Xe,arrived:ot,picked:Qe,active:tt,delivered:qe,skipped:it,cancelled:Ge};function Mt(e,t,r,o){const n=(r-e)*(Math.PI/180),i=(o-t)*(Math.PI/180),a=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*(Math.PI/180))*Math.cos(r*(Math.PI/180))*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}(0,n.useEffect)((()=>{xt(0),pt(null),dt(0),gt(null),bt(null),At(null)}),[De]),(0,n.useEffect)((()=>{dt(0),gt(null),At(null)}),[ut]),(0,n.useEffect)((()=>{At(null)}),[ct]);const Dt=async e=>{St(!0);try{const t=(await i.A.get("".concat("https://jupiter.nearle.app/live/api/v3","/deliveries/getdeliverylogs/?deliveryid=").concat(e))).data.details;if(Array.isArray(t)&&0!==t.length){const e=t.map((e=>{var t,r,o;const n=null!==e&&void 0!==e&&e.logdate?_()(e.logdate):null;return{lat:parseFloat(null!==(t=null===e||void 0===e?void 0:e.latitude)&&void 0!==t?t:null===e||void 0===e?void 0:e.lat),lng:parseFloat(null!==(r=null!==(o=null===e||void 0===e?void 0:e.longitude)&&void 0!==o?o:null===e||void 0===e?void 0:e.lng)&&void 0!==r?r:null===e||void 0===e?void 0:e.lon),logdate:null===e||void 0===e?void 0:e.logdate,_ts:n&&n.isValid()?n.valueOf():Number.MAX_SAFE_INTEGER}})).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng))).sort(((e,t)=>e._ts-t._ts));if(0!==e.length){Le(e[0].logdate),Oe(e[e.length-1].logdate);const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e)||0===e.length)return[];const r=e.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&(Math.abs(e.lat)>.1||Math.abs(e.lng)>.1)));if(0===r.length)return[];if(1===r.length)return[{lat:r[0].lat,lng:r[0].lng,logdate:r[0].logdate,_ts:r[0]._ts}];const o=null!=t.processNoise?t.processNoise:1e-10,n=null!=t.measurementNoise?t.measurementNoise:2e-9,i=null!=t.outlierGate?t.outlierGate:9,a=null!=t.maxSpeedKmh?t.maxSpeedKmh:120,l=e=>e._ts||(e.logdate?new Date(e.logdate).getTime():0);let s=0;for(;sa||(c.push(e),d=t)}if(c.length<2)return c.map((e=>({lat:e.lat,lng:e.lng,logdate:e.logdate,_ts:e._ts})));const u=e=>{const t=c.length,r=new Array(t),a=new Array(t),s=new Array(t),d=new Array(t),u=new Array(t),x=l(c[0]),h=l(c[1]),p=Math.max(.1,(h-x)/1e3),m=(c[1][e]-c[0][e])/p;r[0]=[c[0][e],m],a[0]=[n,0,0,1],s[0]=r[0].slice(),d[0]=a[0].slice(),u[0]=0;let g=x;for(let b=1;bi){r[b]=[m,f],a[b]=[k,M,D,C];continue}const P=k/z,R=D/z,W=m+P*I,Y=f+R*I;r[b]=[W,Y],a[b]=[(1-P)*k,(1-P)*M,D-R*k,C-R*M]}const f=new Array(t);f[t-1]=r[t-1].slice();for(let o=t-2;o>=0;o--){const e=u[o+1],[t,n,i,l]=a[o],c=t+e*n,x=n,h=i+e*l,p=l,[m,g,b,v]=d[o+1],A=m*v-g*b;if(!Number.isFinite(A)||Math.abs(A)<1e-30){f[o]=r[o].slice();continue}const j=v/A,y=-g/A,w=-b/A,S=m/A,k=c*j+x*w,M=c*y+x*S,D=h*j+p*w,C=h*y+p*S,I=f[o+1][0]-s[o+1][0],z=f[o+1][1]-s[o+1][1];f[o]=[r[o][0]+k*I+M*z,r[o][1]+D*I+C*z]}return f.map((e=>e[0]))},x=u("lat"),h=u("lng");return c.map(((e,t)=>({lat:x[t],lng:h[t],logdate:e.logdate,_ts:e._ts})))}(e),r=t.map((e=>({lat:e.lat,lng:e.lng})));Ye(r),function(e){let t=0;for(let r=0;r{var t;return null!==(t=e.nextPage)&&void 0!==t?t:void 0},refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0}),Tt=(null===Ct||void 0===Ct?void 0:Ct.pages.flatMap((e=>e.rows)))||[];(0,n.useEffect)((()=>{if(!Wt)return;const t=new IntersectionObserver((e=>{e[0].isIntersecting&&Rt()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}}),[Wt,Rt]);const{data:Lt,isLoading:Nt,isError:Ot,error:Et}=(0,l.I)({queryKey:["tenantlist",De],queryFn:()=>(0,$.Mn)(De),enabled:0!==De}),{data:Ft,isLoading:Kt,isError:Ht,error:_t}=(0,l.I)({queryKey:["fetchRidersList",De],queryFn:$.Sd,enabled:0!==De}),{data:Bt,isLoading:qt,isError:Jt,error:Zt}=(0,l.I)({queryKey:["gettenantlocations",ut],queryFn:()=>(0,$.DL)(ut),enabled:0!==ut});(0,n.useEffect)((()=>{(async()=>{He(!0);try{await i.A.get(0==De?"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?fromdate=").concat(K,"&todate=").concat(B):"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?applocationid=").concat(De,"&tenantid=").concat(ut,"&locationid=").concat(ct,"&fromdate=").concat(K,"&todate=").concat(B,"&userid=").concat((null===ft||void 0===ft?void 0:ft.userid)||0)).then((e=>{Be(e.data.details.total),Ue(e.data.details.pending),$e(e.data.details.accepted),nt(e.data.details.arrived),et(e.data.details.picked),rt(e.data.details.active),Je(e.data.details.delivered),at(e.data.details.skipped),Ve(e.data.details.cancelled)})).catch((e=>{(0,te.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(e){console.log(e)}finally{He(!1)}})()}),[De,K,B,lt,ut,ct,ft]);const Ut=null===Tt||void 0===Tt?void 0:Tt.map((e=>({tenantname:e.tenantname,tenantcity:e.tenantcity,tenantcontactno:e.tenantcontactno,rider:e.ridername,orderid:e.orderid,paymenttype:64==e.paymenttype?"Pay Later":42==e.paymenttype?"Pay on Delivery":"Digital",deliverydate:e.deliverydate,orderstatus:e.orderstatus,ordernotes:e.ordernotes,kms:e.kms,cumulativekms:e.cumulativekms,assigntime:e.assigntime,starttime:e.starttime,arrivaltime:e.arrivaltime,pickuptime:e.pickuptime,deliverytime:e.deliverytime,canceltime:e.canceltime,deliverycharge:e.deliverycharges,deliveryamt:e.deliveryamt,pickupcustomer:e.pickupcustomer,pickupcontactno:e.pickupcontactno,Pickupaddress:e.pickupaddress,pickupsuburb:e.pickupsuburb,pickupcity:e.applocation,pickuplat:e.pickuplat,pickuplong:e.pickuplon,deliverycustomer:e.deliverycustomer,deliverycontactno:e.deliverycontactno,deliveryaddress:e.deliveryaddress,deliverysuburb:e.locationsuburb,deliverylat:e.deliverylat,deliverylong:e.deliverylong,locationname:e.locationname,locationsuburb:e.pickuplocation,deliverylocation:e.deliverylocation,locationcontactno:e.locationcontactno})));function Gt(e){return _()(e).format("DD/MM/YYYY ")}function Vt(e){return _()(e).format(" hh:mm A")}const Xt=zt?"An error has occurred: (fetchDeliveries) ".concat(Pt.message):Ot?"An error has occurred: (getTenants) ".concat(Et.message):Jt?"An error has occurred: (gettenantlocations) ".concat(Zt.message):Ht?"An error has occurred: (getriderbydelivery) ".concat(_t.message):null;(0,n.useEffect)((()=>{Xt&&ce(Xt,"warning",2e3)}),[Xt]);const $t=[{key:"total",label:"Total Orders",color:ge,icon:W.F6S,value:_e},{key:"delivered",label:"Delivered",color:"#10b981",icon:W.mU9,value:qe},{key:"pending",label:"Pending",color:"#f59e0b",icon:W.tX0,value:Ze},{key:"cancelled",label:"Cancelled",color:"#ef4444",icon:W.uDv,value:Ge}];return(0,Z.jsxs)(Z.Fragment,{children:[(Ke||Nt||qt||wt||Kt||Yt)&&(0,Z.jsx)("div",{children:(0,Z.jsx)(ee.A,{})}),It&&(0,Z.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:It}),(0,Z.jsx)(s.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:de.radiusCard/8,border:"1px solid",borderColor:de.borderSubtle,background:"linear-gradient(135deg, ".concat(xe(ge)," 0%, ").concat(xe(fe)," 100%)"),boxShadow:de.shadowMd},children:(0,Z.jsxs)(x.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Z.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:ge,color:"#fff",boxShadow:"0 6px 18px ".concat(pe(ge))},children:(0,Z.jsx)(W.Z2J,{size:22})}),(0,Z.jsxs)(x.A,{children:[(0,Z.jsx)(p.A,{variant:"h3",sx:{fontWeight:800,color:de.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders Details"}),(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Z.jsx)(u.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Z.jsxs)(p.A,{variant:"caption",sx:{color:de.textSecondary,fontWeight:600},children:["Live \xb7 ",E||"All Zones"," \xb7 ",ue]})]})]})]}),(0,Z.jsx)(ie.A,{ref:r,locaName:E,setAppId:Ce,setLocoName:F,setPage:L,pill:!0,accentColor:ge,icon:(0,Z.jsx)(W.HPi,{size:14}),placeholder:"Select Zone",paperComponent:be,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,Z.jsx)(g.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:$t.map((e=>{const t=e.icon;return(0,Z.jsx)(g.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,Z.jsxs)(s.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:de.radiusCard/8,border:"1px solid",borderColor:de.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:de.shadowMd,borderColor:me(e.color)}},children:[(0,Z.jsx)(u.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(he(e.color)," 100%)")}}),(0,Z.jsxs)(x.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Z.jsxs)(x.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,Z.jsx)(p.A,{sx:{fontWeight:800,color:de.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:e.value})]}),(0,Z.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:he(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(me(e.color)),flexShrink:0},children:(0,Z.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,Z.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:de.radiusCard/8,border:"1px solid",borderColor:de.borderSubtle,background:"#fff",boxShadow:de.shadowSoft},children:(0,Z.jsxs)(g.Ay,{container:!0,spacing:1.25,alignItems:"center",children:[(0,Z.jsx)(g.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,Z.jsx)(f.A,{options:Lt||[],value:ht,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",PaperComponent:be,onOpen:e=>{De||(e.preventDefault(),(0,ae.k)("Please select a your app location first!","warning",3e3),setTimeout((()=>{var e;null===(e=r.current)||void 0===e||e.focus()}),0))},onChange:(e,t,r)=>{"clear"===r?(xt(0),pt(null),dt(0),gt(null)):(xt((null===t||void 0===t?void 0:t.tenantid)||0),pt(t),dt(t.locationid),gt(null))},renderInput:e=>(0,Z.jsx)(b.A,(0,o.A)((0,o.A)({},e),{},{inputRef:h,placeholder:"Select Tenant",size:"small",sx:Ae("#0ea5e9"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,Z.jsx)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,Z.jsx)(ve,{color:"#0ea5e9",size:22,selected:!0,children:(0,Z.jsx)(W.Itr,{size:13})})})})}))})}),(0,Z.jsx)(g.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,Z.jsx)(f.A,{options:Bt||[],getOptionLabel:e=>e?"".concat(e.locationname," (").concat(e.suburb,")"):"",value:mt,PaperComponent:be,onOpen:e=>{De||ut?ut||(e.preventDefault(),(0,ae.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=h.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,ae.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=r.current)||void 0===e||e.focus()}),0))},onChange:(e,t,r)=>{"clear"===r?(dt(0),gt(null)):(dt(t.locationid||0),gt(t))},renderInput:e=>(0,Z.jsx)(b.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Location",size:"small",sx:Ae("#10b981"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,Z.jsx)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,Z.jsx)(ve,{color:"#10b981",size:22,selected:!0,children:(0,Z.jsx)(W.JFD,{size:13})})})})}))})}),(0,Z.jsx)(g.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,Z.jsx)(f.A,{options:Ft||[],value:vt,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname),PaperComponent:be,onOpen:()=>{De||(0,ae.k)("Select App Location First","warning",2e3)},onChange:(e,t,r)=>{"clear"===r?(bt(null),At(null)):(bt(t),At(t))},renderInput:e=>(0,Z.jsx)(b.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Rider",size:"small",sx:Ae("#8b5cf6"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,Z.jsx)(x.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,Z.jsx)(ve,{color:"#8b5cf6",size:22,selected:!0,children:(0,Z.jsx)(W.bsz,{size:13})})})})}))})}),(0,Z.jsx)(g.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,Z.jsxs)(x.A,{direction:"row",spacing:1,alignItems:"center",justifyContent:{xs:"flex-start",md:"flex-end"},children:[(0,Z.jsx)(d.A,{title:"Date Filter",placement:"top",children:(0,Z.jsxs)(u.A,{onClick:()=>G(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:xe("#f59e0b"),border:"1.5px solid ".concat(me("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(pe("#f59e0b"))}},children:[(0,Z.jsx)(W.Ki0,{size:14}),_()(K).format("DD/MM/YY")," \u2013 ",_()(B).format("DD/MM/YY")]})}),(0,Z.jsx)(v.A,{variant:"contained",size:"small",startIcon:(0,Z.jsx)(W.S3Y,{}),onClick:()=>{yt(!0),setTimeout((()=>{O("")}),0)},sx:{borderRadius:999,px:1.5,py:.75,fontWeight:800,fontSize:12,textTransform:"none",background:"linear-gradient(135deg, ".concat(ge," 0%, ").concat(fe," 100%)"),boxShadow:"0 6px 18px ".concat(pe(ge)),"&:hover":{background:"linear-gradient(135deg, ".concat(ge," 0%, ").concat(fe," 100%)"),boxShadow:"0 8px 22px ".concat(pe(ge))}},children:"Export"})]})})]})}),(0,Z.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:de.radiusCard/8,borderTopRightRadius:de.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:de.borderSubtle,borderBottom:0,background:"#fff"},children:(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,Z.jsx)(x.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:de.borderSubtle,borderRadius:4}},children:ye.map((e=>{var t;const r=je[e],o=r.icon,n=lt.toLowerCase()===e,i=null!==(t=kt[e])&&void 0!==t?t:0;return(0,Z.jsxs)(u.A,{onClick:()=>st("all"===e?"All":e),sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?r.color:me(r.color)),bgcolor:n?r.color:xe(r.color),color:n?"#fff":r.color,fontWeight:700,boxShadow:n?"0 6px 18px ".concat(pe(r.color)):"none",transition:"all 0.18s","&:hover":{borderColor:r.color,boxShadow:n?"0 6px 18px ".concat(pe(r.color)):"0 0 0 3px ".concat(pe(r.color))}},children:[(0,Z.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:n?"rgba(255,255,255,0.22)":he(r.color),color:n?"#fff":r.color},children:(0,Z.jsx)(o,{size:13})}),(0,Z.jsx)(p.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,Z.jsx)(u.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:n?"rgba(255,255,255,0.22)":"#fff",color:n?"#fff":r.color,border:n?"none":"1px solid ".concat(me(r.color))},children:i})]},e)}))}),(0,Z.jsx)(u.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,Z.jsx)(oe.A,{value:Ie,onChange:ze,onDebouncedChange:Re,placeholder:"Search orders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:xe(ge),"& fieldset":{borderColor:me(ge),borderWidth:1.5},"&:hover fieldset":{borderColor:ge},"&.Mui-focused fieldset":{borderColor:ge,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(pe(ge))}}})})]})}),(0,Z.jsx)(s.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:de.radiusCard/8,borderBottomRightRadius:de.radiusCard/8,border:"1px solid",borderColor:de.borderSubtle,overflow:"hidden",background:"#fff"},children:(0,Z.jsxs)(A.A,{ref:t,onScroll:e=>{const{scrollTop:t,scrollHeight:r,clientHeight:o}=e.currentTarget;t+o>=r-50&&Wt&&!Yt&&Rt()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:me(ge),borderRadius:8,"&:hover":{backgroundColor:ge}},"&::-webkit-scrollbar-track":{backgroundColor:de.surfaceAlt}},children:[(0,Z.jsxs)(j.A,{stickyHeader:!0,sx:{minWidth:1600},children:[(0,Z.jsx)(y.A,{children:(0,Z.jsxs)(w.A,{sx:{"& th":{backgroundColor:de.surfaceAlt,color:de.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(de.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,Z.jsx)(S.A,{children:"#"}),(0,Z.jsx)(S.A,{children:"Map"}),(0,Z.jsx)(S.A,{children:"Client"}),(0,Z.jsx)(S.A,{children:"Pickup"}),(0,Z.jsx)(S.A,{children:"Drop"}),(0,Z.jsx)(S.A,{children:"Status / Rider"}),(0,Z.jsx)(S.A,{children:"Assigned"}),(0,Z.jsx)(S.A,{children:"Accepted"}),(0,Z.jsx)(S.A,{children:"Arrived"}),(0,Z.jsx)(S.A,{children:"Picked"}),(0,Z.jsx)(S.A,{children:"Active"}),(0,Z.jsx)(S.A,{children:"Delivered"}),(0,Z.jsx)(S.A,{children:"Cancelled"}),(0,Z.jsx)(S.A,{children:"Notes"}),(0,Z.jsx)(S.A,{align:"center",children:"KMS"}),(0,Z.jsx)(S.A,{align:"center",children:"Charges"})]})}),(0,Z.jsx)(k.A,{children:It?(0,Z.jsx)(le,{rows:16,columns:16,height:15}):0==(null===Tt||void 0===Tt?void 0:Tt.length)?(0,Z.jsx)(w.A,{children:(0,Z.jsx)(S.A,{colSpan:16,sx:{py:6},children:(0,Z.jsxs)(x.A,{alignItems:"center",spacing:1.5,children:[(0,Z.jsx)(c.A,{sx:{width:64,height:64,bgcolor:he("#94a3b8"),color:de.textMuted},children:(0,Z.jsx)(W.Z2J,{size:28})}),(0,Z.jsx)(p.A,{variant:"subtitle1",sx:{fontWeight:700,color:de.textPrimary},children:"No orders to show"}),(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary},children:Ie?"Try a different keyword.":"Adjust the filters above to load orders."})]})})}):null===Tt||void 0===Tt?void 0:Tt.map(((e,t)=>{var r;const o=String(e.orderstatus||"").toLowerCase(),n=je[o]||{label:e.orderstatus||"\u2014",color:ge,icon:W.Z2J},i=n.icon,a="cancelled"===o;return(0,Z.jsxs)(w.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(de.divider),py:{xs:1,md:1.25},px:{xs:1,md:1.5},verticalAlign:"top"},"&:hover":{backgroundColor:de.surfaceAlt}},children:[(0,Z.jsx)(S.A,{children:(0,Z.jsx)(p.A,{variant:"caption",sx:{fontWeight:700,color:de.textMuted},children:String(T*N+t+1).padStart(2,"0")})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(d.A,{title:"delivered"===e.orderstatus?"View rider route":"Available for delivered orders",placement:"top",children:(0,Z.jsx)("span",{children:(0,Z.jsx)(M.A,{size:"small",disabled:"delivered"!==e.orderstatus,onClick:()=>{"delivered"===e.orderstatus&&(Dt(e.deliveryid),Fe(e))},sx:{bgcolor:"delivered"===e.orderstatus?he(ge):he("#94a3b8"),color:"delivered"===e.orderstatus?ge:de.textMuted,border:"1px solid ".concat("delivered"===e.orderstatus?me(ge):me("#94a3b8")),"&:hover":{bgcolor:"delivered"===e.orderstatus?ge:he("#94a3b8"),color:"delivered"===e.orderstatus?"#fff":de.textMuted}},children:(0,Z.jsx)(W.Cd7,{size:14})})})})}),(0,Z.jsx)(S.A,{children:(0,Z.jsxs)(x.A,{direction:"row",alignItems:"flex-start",spacing:1,children:[(0,Z.jsx)(ve,{color:ge,size:32,children:(0,Z.jsx)(W.Itr,{size:16})}),(0,Z.jsxs)(x.A,{spacing:.25,sx:{minWidth:0},children:[(0,Z.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:de.textPrimary,whiteSpace:"nowrap"},children:e.tenantname}),(0,Z.jsx)(d.A,{title:"Order ID",placement:"top",children:(0,Z.jsxs)(p.A,{variant:"caption",sx:{color:de.textSecondary,fontWeight:700},children:["#",e.orderid]})}),(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textMuted},children:_()(e.deliverydate).utc().format("DD/MM/YYYY \xb7 hh:mm A")})]})]})}),(0,Z.jsx)(S.A,{children:(0,Z.jsxs)(x.A,{spacing:.25,children:[(0,Z.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:de.textPrimary,whiteSpace:"nowrap"},children:e.pickupcustomer||"\u2014"}),(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary},children:e.pickupcontactno}),(0,Z.jsx)(d.A,{title:e.Pickupaddress||e.pickupsuburb||"",children:(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary,cursor:"pointer",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.pickupsuburb||(e.Pickupaddress?e.Pickupaddress.slice(0,22)+"\u2026":"")})}),e.applocation&&(0,Z.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.75,py:.25,borderRadius:999,bgcolor:xe("#10b981"),border:"1px solid ".concat(me("#10b981")),color:"#10b981",fontSize:10,fontWeight:800,width:"fit-content"},children:[(0,Z.jsx)(W.JFD,{size:11})," ",e.applocation]})]})}),(0,Z.jsx)(S.A,{children:(0,Z.jsxs)(x.A,{spacing:.25,children:[(0,Z.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:de.textPrimary,whiteSpace:"nowrap"},children:e.deliverycustomer||"\u2014"}),(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary},children:e.deliverycontactno}),(0,Z.jsx)(d.A,{title:e.deliveryaddress||"",children:(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary,cursor:"pointer",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.deliverysuburb||(e.deliveryaddress?e.deliveryaddress.slice(0,22)+"\u2026":"")})})]})}),(0,Z.jsx)(S.A,{children:(0,Z.jsxs)(x.A,{spacing:.5,children:[(0,Z.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:xe(n.color),border:"1px solid ".concat(me(n.color)),color:n.color,fontSize:11,fontWeight:800,width:"fit-content"},children:[(0,Z.jsx)(i,{size:12})," ",n.label]}),e.ridername&&(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,Z.jsx)(W.bsz,{size:12,color:de.textMuted}),(0,Z.jsx)(d.A,{title:"Rider ID: ".concat(e.userid),children:(0,Z.jsx)(p.A,{variant:"caption",sx:{fontWeight:700,color:de.textPrimary,whiteSpace:"nowrap"},children:e.ridername})})]})]})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.assigntime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.acceptedtime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.arrivaltime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.pickuptime,formatDate:Gt,formatTime:Vt,success:"active"===e.deliverystatus})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.starttime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.deliverytime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{children:(0,Z.jsx)(Se,{value:e.canceltime,formatDate:Gt,formatTime:Vt})}),(0,Z.jsx)(S.A,{sx:{maxWidth:180},children:e.ordernotes?(0,Z.jsxs)(x.A,{direction:"row",spacing:.5,alignItems:"flex-start",children:[(0,Z.jsx)(W.NpB,{size:12,color:de.textMuted,style:{marginTop:2,flexShrink:0}}),(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textSecondary,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.ordernotes})]}):(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textMuted},children:"\u2014"})}),(0,Z.jsx)(S.A,{align:"center",children:(0,Z.jsxs)(x.A,{spacing:.5,alignItems:"center",children:[(0,Z.jsx)(we,{color:"#ef4444",icon:(0,Z.jsx)(W.xI$,{size:11}),label:a||""==e.kms?"0 km":"".concat(e.kms," km"),tooltip:"KMS"}),(0,Z.jsx)(we,{color:"#10b981",icon:(0,Z.jsx)(W.xI$,{size:11}),label:"".concat(null!==(r=e.cumulativekms)&&void 0!==r?r:0," km"),tooltip:"Actual KMS"}),(0,Z.jsx)(we,{color:"#0ea5e9",icon:(0,Z.jsx)(W.xI$,{size:11}),label:"".concat(e.previouskms||(a?"0.00":e.kms)||0," km"),tooltip:"Rider KMS"})]})}),(0,Z.jsx)(S.A,{align:"center",children:(0,Z.jsxs)(x.A,{spacing:.5,alignItems:"center",children:[(0,Z.jsx)(we,{color:"#ef4444",icon:(0,Z.jsx)(W.YHz,{size:11}),label:a||""==e.deliverycharges?"0.00":"".concat(e.deliverycharges,".00"),tooltip:"Delivery Charge"}),(0,Z.jsx)(we,{color:"#10b981",icon:(0,Z.jsx)(W.YHz,{size:11}),label:""==e.deliveryamt?"0.00":"".concat(e.deliveryamt,".00"),tooltip:"Delivery Amount"})]})})]},e.deliveryid||"".concat(e.orderid,"-").concat(t))}))})]}),(0,Z.jsx)(D.A,{}),0!==(null===Tt||void 0===Tt?void 0:Tt.length)&&(0,Z.jsx)(x.A,{justifyContent:"center",alignItems:"center",sx:{width:"100%",py:2},children:(0,Z.jsx)(x.A,{ref:e,style:{textAlign:"center",width:"100%"},children:Yt||Wt?(0,Z.jsx)(ne.A,{}):(0,Z.jsx)(p.A,{variant:"caption",sx:{color:de.textMuted,fontWeight:600},children:"No more orders"})})})]})}),(0,Z.jsxs)(C.A,{open:jt,onClose:()=>yt(!1),fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{borderRadius:2.5,overflow:"hidden"}},children:[(0,Z.jsx)(I.A,{sx:{background:"linear-gradient(135deg, ".concat(ge," 0%, ").concat(fe," 100%)"),color:"#fff",py:2},children:(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,Z.jsx)(c.A,{sx:{width:36,height:36,bgcolor:"rgba(255,255,255,0.22)",color:"#fff"},children:(0,Z.jsx)(W.S3Y,{size:20})}),(0,Z.jsxs)(x.A,{children:[(0,Z.jsx)(p.A,{sx:{fontSize:11,fontWeight:700,opacity:.85,letterSpacing:.6,textTransform:"uppercase",lineHeight:1},children:"Report"}),(0,Z.jsx)(p.A,{sx:{fontWeight:800,fontSize:{xs:"1.05rem",sm:"1.2rem"},lineHeight:1.2,mt:.25},children:"Export Orders"})]})]}),(0,Z.jsx)(M.A,{size:"small",onClick:()=>yt(!1),sx:{color:"#fff",bgcolor:"rgba(255,255,255,0.18)","&:hover":{bgcolor:"rgba(255,255,255,0.3)"}},children:(0,Z.jsx)(W.m6K,{size:16})})]})}),(0,Z.jsxs)(z.A,{sx:{p:2},children:[It&&(0,Z.jsx)(J.A,{}),[{label:"App Location",value:E,color:ge},{label:"Tenant",value:null===ht||void 0===ht?void 0:ht.tenantname,color:"#0ea5e9"},{label:"Business Location",value:null===mt||void 0===mt?void 0:mt.locationname,color:"#10b981"},{label:"Status",value:lt,color:"#f59e0b"},{label:"Rider",value:vt?"".concat(vt.firstname," ").concat(vt.lastname):null,color:"#8b5cf6"},{label:"Keyword",value:Ie,color:"#06b6d4"},{label:"Start Date",value:K,color:"#14b8a6"},{label:"End Date",value:B,color:"#ef4444"}].map(((e,t)=>(0,Z.jsxs)(x.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:1.5,py:1,borderRadius:2,bgcolor:xe(e.color),border:"1px solid ".concat(me(e.color)),mb:1},children:[(0,Z.jsx)(p.A,{variant:"body2",sx:{fontWeight:700,color:de.textPrimary},children:e.label}),(0,Z.jsx)(P.A,{size:"small",label:e.value||"None",sx:{fontWeight:700,bgcolor:e.value?e.color:he("#94a3b8"),color:e.value?"#fff":de.textMuted,border:"none"}})]},t)))]}),(0,Z.jsxs)(R.A,{sx:{p:2,bgcolor:de.surfaceAlt,gap:1},children:[(0,Z.jsx)(v.A,{color:"inherit",variant:"outlined",onClick:()=>yt(!1),sx:{borderRadius:999,px:2,textTransform:"none",fontWeight:700,borderColor:de.borderSubtle,color:de.textSecondary},children:"Cancel"}),(0,Z.jsx)(Q.pK,{data:Ut,filename:"Orders_Detail_".concat(_()().format("YYYY-MM-DD_HHmmss"),".csv"),label:"Download CSV",btnLoading:It,onClick:()=>{setTimeout((()=>yt(!1)),0)}})]})]}),(0,Z.jsx)(re.A,{open:U,onClose:()=>G(!1),onSelect:e=>{H(e.startDate),q(e.endDate),Me(e.label)}}),(0,Z.jsx)(C.A,{open:V,onClose:()=>{se(!1)},fullScreen:!0,fullWidth:!0,children:We&&(0,Z.jsx)("div",{children:(0,Z.jsx)(X,{coordinates:We,additionalProps:{riderStart:Te,riderEnd:Ne},order:Ee,setMapOpen:se})})})]})}},35678:(e,t,r)=>{r.d(t,{A:()=>j});var o=r(9950),n=r(96583),i=r(40033),a=r(82053),l=r(28170),s=r(93230),c=r(82223),d=r(55916),u=r(4159),x=r.n(u),h=r(56712),p=r(81417),m=r(96600),g=r(53132),f=r(94289),b=r(57326),v=r(50624),A=r(44414);const j=e=>{let{open:t,onClose:r,onSelect:u}=e;const[j,y]=(0,o.useState)(null);return(0,A.jsxs)(n.A,{open:t,onClose:r,children:[(0,A.jsx)(i.A,{align:"left",children:(0,A.jsx)(a.A,{variant:"h4",children:"Select Filter Options"})}),(0,A.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,A.jsx)(d.U,{open:t,toggle:r,id:"daterange1",onChange:e=>{y({startDate:x()(e.startDate).format("YYYY-MM-DD"),endDate:x()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,h.A)(new Date,-1),endDate:(0,h.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,h.A)(new Date,1),endDate:(0,h.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,g.A)(new Date,-1)),endDate:(0,m.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,f.A)(new Date),endDate:(0,b.A)(new Date)},{label:"Last Month",startDate:(0,f.A)((0,v.A)(new Date,-1)),endDate:(0,b.A)((0,v.A)(new Date,-1))}]})}),(0,A.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,A.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{j?(u(j),r()):r()},children:"OK"})})]})}},46639:(e,t,r)=>{r.d(t,{A:()=>R});var o=r(57528),n=r(98587),i=r(58168),a=r(9950),l=r(72004),s=r(3484),c=r(88283),d=r(89548),u=r(18463),x=r(59254),h=r(45558),p=r(1614);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,h.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var g,f,b,v,A=r(44414);const j=["className","color","disableShrink","size","style","thickness","value","variant"];let y,w,S,k;const M=44,D=(0,c.i7)(y||(y=g||(g=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),C=(0,c.i7)(w||(w=f||(f=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),I=(0,x.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t["color".concat((0,d.A)(r.color))]]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({display:"inline-block"},"determinate"===t.variant&&{transition:r.transitions.create("transform")},"inherit"!==t.color&&{color:(r.vars||r).palette[t.color].main})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&(0,c.AH)(S||(S=b||(b=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),D)})),z=(0,x.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),P=(0,x.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t["circle".concat((0,d.A)(r.variant))],r.disableShrink&&t.circleDisableShrink]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:r.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,c.AH)(k||(k=v||(v=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),C)})),R=a.forwardRef((function(e,t){const r=(0,u.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:a="primary",disableShrink:c=!1,size:x=40,style:h,thickness:p=3.6,value:g=0,variant:f="indeterminate"}=r,b=(0,n.A)(r,j),v=(0,i.A)({},r,{color:a,disableShrink:c,size:x,thickness:p,value:g,variant:f}),y=(e=>{const{classes:t,variant:r,color:o,disableShrink:n}=e,i={root:["root",r,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(r)),n&&"circleDisableShrink"]};return(0,s.A)(i,m,t)})(v),w={},S={},k={};if("determinate"===f){const e=2*Math.PI*((M-p)/2);w.strokeDasharray=e.toFixed(3),k["aria-valuenow"]=Math.round(g),w.strokeDashoffset="".concat(((100-g)/100*e).toFixed(3),"px"),S.transform="rotate(-90deg)"}return(0,A.jsx)(I,(0,i.A)({className:(0,l.A)(y.root,o),style:(0,i.A)({width:x,height:x},S,h),ownerState:v,ref:t,role:"progressbar"},k,b,{children:(0,A.jsx)(z,{className:y.svg,ownerState:v,viewBox:"".concat(22," ").concat(22," ").concat(M," ").concat(M),children:(0,A.jsx)(P,{className:y.circle,style:w,ownerState:v,cx:M,cy:M,r:(M-p)/2,fill:"none",strokeWidth:p})})}))}))},56311:(e,t,r)=>{r.d(t,{A:()=>h});var o=r(89379),n=r(9950),i=r(2660),a=r(2046),l=r(83274),s=r(25333),c=r(97125),d=r(7762),u=r(52097),x=r(44414);const h=e=>{let{value:t,onChange:r,onDebouncedChange:h,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const f=(0,n.useRef)(null),[b]=(0,u.d7)(t,p);return(0,n.useEffect)((()=>{h&&h(b)}),[b,h]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=f.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===f.current&&f.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,x.jsx)(i.A,{sx:(0,o.A)({},g),inputRef:f,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,x.jsx)(a.A,{position:"start",sx:{mr:-.5},children:(0,x.jsx)(c.A,{})}),endAdornment:(0,x.jsx)(l.A,{title:"Clear",children:(0,x.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>r(""),children:(0,x.jsx)(d.A,{})})})})}},58691:(e,t,r)=>{r.d(t,{A:()=>l});r(9950);var o=r(16491),n=r(46639),i=r(62217),a=r(44414);function l(e){let{size:t=70,imgSize:r=40,alt:l="loader"}=e;return(0,a.jsxs)(o.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,a.jsx)(n.A,{size:t}),(0,a.jsx)(o.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,a.jsx)("img",{src:i,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,t,r)=>{r.d(t,{A:()=>x});var o=r(89379),n=r(9950),i=r(93230),a=r(41413),l=r(77922),s=r(29925),c=r(26910),d=r(31222),u=r(44414);const x=(0,n.forwardRef)(((e,t)=>{let{setAppId:r,setLocoName:x,setPage:h,sx:p,textfeildSx:m,textfieldSx:g,pill:f=!1,accentColor:b="#6366f1",icon:v,placeholder:A="Select Zone",paperComponent:j}=e;const[y,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const S=e=>"".concat(b).concat(e),k=S("08"),M=S("26"),D=S("55"),C=S("18"),I=f?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:D,borderWidth:1.5},"&:hover fieldset":{borderColor:b},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(M)},"&.Mui-focused fieldset":{borderColor:b,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:b}}:{},z=f&&(0,u.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,u.jsx)(a.A,{sx:{width:24,height:24,bgcolor:C,color:b,transition:"background-color 0.15s, color 0.15s"},children:v||(0,u.jsx)(d.HPi,{size:14})})});return(0,u.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:j,sx:(0,o.A)({},p),onChange:(e,t,o)=>{"clear"===o?(null===r||void 0===r||r(0),null===x||void 0===x||x(""),null===h||void 0===h||h(0)):t&&(null===r||void 0===r||r(t.applocationid),null===x||void 0===x||x(t.locationname),null===h||void 0===h||h(0))},renderInput:e=>f?(0,u.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:A,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:z}),sx:(0,o.A)((0,o.A)({},I),g||m||{})})):(0,u.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},g||m||{})}))})}))}}]); \ No newline at end of file diff --git a/build/static/js/8846.23c0ba58.chunk.js b/build/static/js/8846.23c0ba58.chunk.js new file mode 100644 index 0000000..ab7d9e7 --- /dev/null +++ b/build/static/js/8846.23c0ba58.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8846],{11041:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ce});var o=r(89379),n=r(9950),i=r(26910),a=r(60010),l=r(36150),s=r(2235),c=r(41413),d=r(83274),x=r(16491),h=r(93230),u=r(82917),p=r(82053),m=r(47223),g=r(55158),f=r(60899),b=r(77922),v=r(29925),A=r(82223),j=r(1320),y=r(25333),w=r(15769),S=r(69780),k=r(9213),D=r(21671),M=r(34075),C=r(74745),z=r(96583),I=r(40033),W=r(28170),P=r(25277),R=r(79739),Y=r(14857),T=r(31222),L=r(43302),N=r(99810),O=r(49029),F=r(47113),E=r(33516),K=r(82215),H=r(2527),_=r.n(H),B=(r(55392),r(4159)),q=r.n(B),J=r(57560),Z=r(94826),G=r(44414),U=r(36220);q().extend(U);const V=new(_().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),$=new(_().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),X=e=>{let{coordinates:t,additionalProps:r,order:o,setMapOpen:i}=e;console.log("additionalProps",r);const a=(0,n.useRef)(null),l=(0,Y.A)(),[s,c]=(0,n.useState)([]),[d,u]=(0,n.useState)(!1);if((0,n.useEffect)((()=>{if(a.current&&t.length>0){const e=[[Math.min(...t.map((e=>e.lat))),Math.min(...t.map((e=>e.lng)))],[Math.max(...t.map((e=>e.lat))),Math.max(...t.map((e=>e.lng)))]];a.current.fitBounds(e)}}),[t]),(0,n.useEffect)((()=>{(async()=>{if(u(!0),t.length<2)return c([]),void u(!1);const e=(e,t)=>{if(e.length<=t)return e;const r=Math.ceil(e.length/t),o=e.filter(((e,t)=>t%r===0)),n=e[e.length-1];return o[o.length-1]!==n&&o.push(n),o};try{const r=e(t,90).map((e=>"".concat(e.lng,",").concat(e.lat))).join(";"),o="https://router.project-osrm.org/match/v1/driving/".concat(r,"?overview=full&geometries=geojson&gaps=ignore&tidy=true"),n=await fetch(o),i=await n.json();if(i.matchings&&i.matchings.length>0){const e=i.matchings.flatMap((e=>{var t;return((null===(t=e.geometry)||void 0===t?void 0:t.coordinates)||[]).map((e=>{let[t,r]=e;return{lat:r,lng:t}}))}));if(e.length>=2)return c(e),void u(!1)}}catch(r){console.warn("OSRM Match error, trying route fallback:",r)}try{const r=e(t,25).map((e=>"".concat(e.lng,",").concat(e.lat))).join(";"),o="https://router.project-osrm.org/route/v1/driving/".concat(r,"?overview=full&geometries=geojson"),n=await fetch(o),i=await n.json();if(i.routes&&i.routes[0]){const e=i.routes[0].geometry.coordinates.map((e=>{let[t,r]=e;return{lat:r,lng:t}}));c(e)}else c(t)}catch(o){console.error("OSRM Route fallback error:",o),c(t)}finally{u(!1)}})()}),[t]),!t||0===t.length)return null;const m=t[0],g=t[t.length-1],f=t[Math.floor(t.length/2)],b=e=>{let{label:t,value:r}=e;return(0,G.jsxs)(h.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,G.jsxs)(p.A,{variant:"subtitle1",sx:{fontWeight:600},children:[t,":"]}),(0,G.jsx)(P.A,{label:r||"0.00",color:"primary",sx:{fontWeight:700}})]})};return(0,G.jsxs)(x.A,{sx:{width:"100%",height:"100vh",position:"relative",overflow:"hidden"},children:[d&&(0,G.jsx)(Z.A,{}),(0,G.jsx)(P.A,{label:"Close",icon:(0,G.jsx)(J.A,{style:{fontSize:18}}),onClick:()=>i(!1),sx:{position:"absolute",top:12,right:12,zIndex:2e3,bgcolor:l.palette.error.main,color:"#fff",fontWeight:600,borderRadius:"12px",px:1.5,py:.5,boxShadow:l.shadows[4],cursor:"pointer","& .MuiChip-icon":{color:"#fff"}}}),(0,G.jsxs)(N.W,{center:f,zoom:14,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},ref:a,children:[(0,G.jsx)(O.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,G.jsx)(F.p,{position:m,icon:V,children:(0,G.jsx)(E.m,{direction:"bottom",children:"Pickup: ".concat(q()(r.riderStart).format("DD-MM-YYYY hh:mm A"))})}),(0,G.jsx)(F.p,{position:g,icon:$,children:(0,G.jsx)(E.m,{direction:"bottom",children:"Drop: ".concat(q()(r.riderEnd).format("DD-MM-YYYY hh:mm A"))})}),s.length>0&&(0,G.jsx)(K.R,{positions:s,pathOptions:{color:"blue",weight:5}})]}),(0,G.jsx)(x.A,{sx:{position:"absolute",bottom:0,width:"100%",bgcolor:"rgba(255,255,255,0.96)",p:2,boxShadow:l.shadows[3],zIndex:1500},children:(0,G.jsxs)(h.A,{direction:"row",flexWrap:"wrap",rowGap:1.5,columnGap:3,alignItems:"center",children:[(0,G.jsx)(b,{label:"Tenant",value:null===o||void 0===o?void 0:o.tenantname}),(0,G.jsx)(b,{label:"Rider",value:null===o||void 0===o?void 0:o.ridername}),(0,G.jsx)(b,{label:"Pickup",value:null===o||void 0===o?void 0:o.pickupcustomer}),(0,G.jsx)(b,{label:"Drop",value:null===o||void 0===o?void 0:o.deliverycustomer}),(0,G.jsx)(b,{label:"Kms",value:null===o||void 0===o?void 0:o.kms}),(0,G.jsx)(b,{label:"Actual Kms",value:null===o||void 0===o?void 0:o.actualkms}),(0,G.jsx)(b,{label:"Rider Kms",value:null===o||void 0===o?void 0:o.riderkms})]})})]})};var Q=r(81425),ee=r(90376),te=r(52351),re=r(8881),oe=r(35678),ne=r(56311),ie=r(58691),ae=r(59212),le=r(20466);function se(e){let{rows:t=5,columns:r=6,height:o=40}=e;return(0,G.jsx)(G.Fragment,{children:[...Array(t)].map(((e,t)=>(0,G.jsx)(k.A,{children:[...Array(r)].map(((e,t)=>(0,G.jsx)(D.A,{children:(0,G.jsx)(u.A,{variant:"rectangular",height:o,width:70,animation:"wave"})},t)))},t)))})}var ce=r(23787),de=r(36220);q().extend(de);const xe=(e,t,r)=>{(0,re.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:r||1500})},he={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},ue=(e,t)=>"".concat(e).concat(t),pe=e=>ue(e,"08"),me=e=>ue(e,"18"),ge=e=>ue(e,"26"),fe=e=>ue(e,"55"),be="#662582",ve="#9255AB",Ae=e=>(0,G.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:he.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),je=e=>{let{color:t,selected:r,size:o=24,children:n}=e;return(0,G.jsx)(c.A,{sx:{width:o,height:o,bgcolor:r?t:me(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},ye=e=>({"& .MuiOutlinedInput-root":{borderRadius:he.radiusPill+"px",bgcolor:pe(e),fontWeight:600,"& fieldset":{borderColor:fe(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ge(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}),we={all:{label:"All",color:be,icon:T.YBc},pending:{label:"Pending",color:"#f59e0b",icon:T.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:T.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:T.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:T.gsJ},active:{label:"Active",color:"#14b8a6",icon:T.pk7},delivered:{label:"Delivered",color:"#10b981",icon:T.mU9},skipped:{label:"Skipped",color:"#f97316",icon:T.ivF},cancelled:{label:"Cancelled",color:"#ef4444",icon:T.uDv}},Se=["all","pending","accepted","arrived","picked","active","delivered","skipped","cancelled"],ke=e=>{let{color:t,icon:r,label:o,tooltip:n}=e;return(0,G.jsx)(d.A,{title:n||"",placement:"top",children:(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:pe(t),border:"1px solid ".concat(fe(t)),color:t,fontSize:11,fontWeight:800,minWidth:80,justifyContent:"center",whiteSpace:"nowrap"},children:[r,o]})})},De=e=>{let{value:t,formatDate:r,formatTime:o,success:n}=e;return t?(0,G.jsxs)(h.A,{spacing:.25,children:[(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,fontWeight:600,whiteSpace:"nowrap"},children:r(t)}),(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textPrimary,fontWeight:800,whiteSpace:"nowrap"},children:o(t)}),n&&(0,G.jsx)(L.cxC,{style:{color:"#10b981",fontSize:12}})]})]}):(0,G.jsxs)(h.A,{spacing:.5,children:[(0,G.jsx)(u.A,{animation:!1,variant:"text",width:70,height:12}),(0,G.jsx)(u.A,{animation:!1,variant:"text",width:55,height:14})]})};function Me(e,t){const r=e=>e*Math.PI/180,o=r(e[0]),n=r(t[0]),i=r(t[0]-e[0]),a=r(t[1]-e[1]),l=Math.sin(i/2)**2+Math.cos(o)*Math.cos(n)*Math.sin(a/2)**2;return 12742*Math.asin(Math.min(1,Math.sqrt(l)))}function Ce(){const e=(0,Y.A)(),t=(0,m.A)(e.breakpoints.down("md")),r=(0,n.useRef)(),u=(0,n.useRef)(),L=(0,n.useRef)(null),N=(0,n.useRef)(null),O=localStorage.getItem("userid"),[F,E]=(0,n.useState)(0),[K,H]=(0,n.useState)(50),[_,B]=(0,n.useState)("All"),[J,U]=(0,n.useState)(q()().format("YYYY-MM-DD")),[V,$]=(0,n.useState)(q()().format("YYYY-MM-DD")),[de,ue]=(0,n.useState)(!1),[Ce,ze]=(0,n.useState)(!1),[Ie,We]=(0,n.useState)("Today"),[Pe,Re]=(0,n.useState)(0),[Ye,Te]=(0,n.useState)(""),[Le,Ne]=(0,n.useState)(""),[Oe,Fe]=(0,n.useState)([]),[Ee,Ke]=(0,n.useState)(),[He,_e]=(0,n.useState)(),[Be,qe]=(0,n.useState)({}),[Je,Ze]=(0,n.useState)(!1);let[Ge,Ue]=(0,n.useState)(0),[Ve,$e]=(0,n.useState)(0),[Xe,Qe]=(0,n.useState)(0),[et,tt]=(0,n.useState)(0),[rt,ot]=(0,n.useState)(0),[nt,it]=(0,n.useState)(0),[at,lt]=(0,n.useState)(0),[st,ct]=(0,n.useState)(0),[dt,xt]=(0,n.useState)(0);const[ht,ut]=(0,n.useState)("All"),[pt,mt]=(0,n.useState)(0),[gt,ft]=(0,n.useState)(0),[bt,vt]=(0,n.useState)(null),[At,jt]=(0,n.useState)(null),[yt,wt]=(0,n.useState)(),[St,kt]=(0,n.useState)(null),[Dt,Mt]=(0,n.useState)(!1),[Ct,zt]=(0,n.useState)(!1),It={all:Ge,pending:Xe,accepted:rt,arrived:st,picked:nt,active:at,delivered:Ve,skipped:dt,cancelled:et};function Wt(e,t,r,o){const n=(r-e)*(Math.PI/180),i=(o-t)*(Math.PI/180),a=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*(Math.PI/180))*Math.cos(r*(Math.PI/180))*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}(0,n.useEffect)((()=>{ft(0),vt(null),mt(0),jt(null),wt(null),kt(null)}),[Pe]),(0,n.useEffect)((()=>{mt(0),jt(null),kt(null)}),[gt]),(0,n.useEffect)((()=>{kt(null)}),[pt]);const Pt=async e=>{zt(!0);try{const t=(await i.A.get("".concat("https://jupiter.nearle.app/live/api/v3","/deliveries/getdeliverylogs/?deliveryid=").concat(e))).data.details;if(Array.isArray(t)&&0!==t.length){const e=t.map((e=>{var t,r,o;const n=null!==e&&void 0!==e&&e.logdate?q()(e.logdate):null;return{lat:parseFloat(null!==(t=null===e||void 0===e?void 0:e.latitude)&&void 0!==t?t:null===e||void 0===e?void 0:e.lat),lng:parseFloat(null!==(r=null!==(o=null===e||void 0===e?void 0:e.longitude)&&void 0!==o?o:null===e||void 0===e?void 0:e.lng)&&void 0!==r?r:null===e||void 0===e?void 0:e.lon),logdate:null===e||void 0===e?void 0:e.logdate,_ts:n&&n.isValid()?n.valueOf():Number.MAX_SAFE_INTEGER}})).filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng))).sort(((e,t)=>e._ts-t._ts));if(0!==e.length){Ke(e[0].logdate),_e(e[e.length-1].logdate);const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e)||0===e.length)return[];const r=e.filter((e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&(Math.abs(e.lat)>.1||Math.abs(e.lng)>.1)));if(0===r.length)return[];if(1===r.length)return[{lat:r[0].lat,lng:r[0].lng,logdate:r[0].logdate,_ts:r[0]._ts}];const o=null!=t.processNoise?t.processNoise:1e-10,n=null!=t.measurementNoise?t.measurementNoise:2e-9,i=null!=t.outlierGate?t.outlierGate:9,a=null!=t.maxSpeedKmh?t.maxSpeedKmh:120,l=e=>e._ts||(e.logdate?new Date(e.logdate).getTime():0);let s=0;for(;sa||(c.push(e),d=t)}if(c.length<2)return c.map((e=>({lat:e.lat,lng:e.lng,logdate:e.logdate,_ts:e._ts})));const x=e=>{const t=c.length,r=new Array(t),a=new Array(t),s=new Array(t),d=new Array(t),x=new Array(t),h=l(c[0]),u=l(c[1]),p=Math.max(.1,(u-h)/1e3),m=(c[1][e]-c[0][e])/p;r[0]=[c[0][e],m],a[0]=[n,0,0,1],s[0]=r[0].slice(),d[0]=a[0].slice(),x[0]=0;let g=h;for(let b=1;bi){r[b]=[m,f],a[b]=[k,D,M,C];continue}const W=k/I,P=M/I,R=m+W*z,Y=f+P*z;r[b]=[R,Y],a[b]=[(1-W)*k,(1-W)*D,M-P*k,C-P*D]}const f=new Array(t);f[t-1]=r[t-1].slice();for(let o=t-2;o>=0;o--){const e=x[o+1],[t,n,i,l]=a[o],c=t+e*n,h=n,u=i+e*l,p=l,[m,g,b,v]=d[o+1],A=m*v-g*b;if(!Number.isFinite(A)||Math.abs(A)<1e-30){f[o]=r[o].slice();continue}const j=v/A,y=-g/A,w=-b/A,S=m/A,k=c*j+h*w,D=c*y+h*S,M=u*j+p*w,C=u*y+p*S,z=f[o+1][0]-s[o+1][0],I=f[o+1][1]-s[o+1][1];f[o]=[r[o][0]+k*z+D*I,r[o][1]+M*z+C*I]}return f.map((e=>e[0]))},h=x("lat"),u=x("lng");return c.map(((e,t)=>({lat:h[t],lng:u[t],logdate:e.logdate,_ts:e._ts})))}(e),r=t.map((e=>({lat:e.lat,lng:e.lng})));Fe(r),function(e){let t=0;for(let r=0;r{var t;return null!==(t=e.nextPage)&&void 0!==t?t:void 0},refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0}),Et=(null===Rt||void 0===Rt?void 0:Rt.pages.flatMap((e=>e.rows)))||[];(0,n.useEffect)((()=>{if(!Ot)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Nt()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return r.current&&e.observe(r.current),()=>{r.current&&e.unobserve(r.current)}}),[Ot,Nt]);const{data:Kt,isLoading:Ht,isError:_t,error:Bt}=(0,l.I)({queryKey:["tenantlist",Pe],queryFn:()=>(0,Q.Mn)(Pe),enabled:0!==Pe}),{data:qt,isLoading:Jt,isError:Zt,error:Gt}=(0,l.I)({queryKey:["fetchRidersList",Pe],queryFn:Q.Sd,enabled:0!==Pe}),{data:Ut,isLoading:Vt,isError:$t,error:Xt}=(0,l.I)({queryKey:["gettenantlocations",gt],queryFn:()=>(0,Q.DL)(gt),enabled:0!==gt});(0,n.useEffect)((()=>{(async()=>{Ze(!0);try{await i.A.get(0==Pe?"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?fromdate=").concat(J,"&todate=").concat(V):"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?applocationid=").concat(Pe,"&tenantid=").concat(gt,"&locationid=").concat(pt,"&fromdate=").concat(J,"&todate=").concat(V,"&userid=").concat((null===yt||void 0===yt?void 0:yt.userid)||0)).then((e=>{Ue(e.data.details.total),Qe(e.data.details.pending),ot(e.data.details.accepted),ct(e.data.details.arrived),it(e.data.details.picked),lt(e.data.details.active),$e(e.data.details.delivered),xt(e.data.details.skipped),tt(e.data.details.cancelled)})).catch((e=>{(0,re.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(e){console.log(e)}finally{Ze(!1)}})()}),[Pe,J,V,ht,gt,pt,yt]);const Qt=null===Et||void 0===Et?void 0:Et.map((e=>({tenantname:e.tenantname,tenantcity:e.tenantcity,tenantcontactno:e.tenantcontactno,rider:e.ridername,orderid:e.orderid,paymenttype:64==e.paymenttype?"Pay Later":42==e.paymenttype?"Pay on Delivery":"Digital",deliverydate:e.deliverydate,orderstatus:e.orderstatus,ordernotes:e.ordernotes,kms:e.kms,cumulativekms:e.cumulativekms,assigntime:e.assigntime,starttime:e.starttime,arrivaltime:e.arrivaltime,pickuptime:e.pickuptime,deliverytime:e.deliverytime,canceltime:e.canceltime,deliverycharge:e.deliverycharges,deliveryamt:e.deliveryamt,pickupcustomer:e.pickupcustomer,pickupcontactno:e.pickupcontactno,Pickupaddress:e.pickupaddress,pickupsuburb:e.pickupsuburb,pickupcity:e.applocation,pickuplat:e.pickuplat,pickuplong:e.pickuplon,deliverycustomer:e.deliverycustomer,deliverycontactno:e.deliverycontactno,deliveryaddress:e.deliveryaddress,deliverysuburb:e.locationsuburb,deliverylat:e.deliverylat,deliverylong:e.deliverylong,locationname:e.locationname,locationsuburb:e.pickuplocation,deliverylocation:e.deliverylocation,locationcontactno:e.locationcontactno})));function er(e){return q()(e).format("DD/MM/YYYY ")}function tr(e){return q()(e).format(" hh:mm A")}const rr=Tt?"An error has occurred: (fetchDeliveries) ".concat(Lt.message):_t?"An error has occurred: (getTenants) ".concat(Bt.message):$t?"An error has occurred: (gettenantlocations) ".concat(Xt.message):Zt?"An error has occurred: (getriderbydelivery) ".concat(Gt.message):null;(0,n.useEffect)((()=>{rr&&xe(rr,"warning",2e3)}),[rr]);const or=[{key:"total",label:"Total Orders",color:be,icon:T.F6S,value:Ge},{key:"delivered",label:"Delivered",color:"#10b981",icon:T.mU9,value:Ve},{key:"pending",label:"Pending",color:"#f59e0b",icon:T.tX0,value:Xe},{key:"cancelled",label:"Cancelled",color:"#ef4444",icon:T.uDv,value:et}];return(0,G.jsxs)(G.Fragment,{children:[(Je||Ht||Vt||Ct||Jt||Ft)&&(0,G.jsx)("div",{children:(0,G.jsx)(te.A,{})}),Yt&&(0,G.jsx)(g.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Yt}),(0,G.jsx)(s.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:he.radiusCard/8,border:"1px solid",borderColor:he.borderSubtle,background:"linear-gradient(135deg, ".concat(pe(be)," 0%, ").concat(pe(ve)," 100%)"),boxShadow:he.shadowMd},children:(0,G.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,G.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:be,color:"#fff",boxShadow:"0 6px 18px ".concat(ge(be))},children:(0,G.jsx)(T.Z2J,{size:22})}),(0,G.jsxs)(h.A,{children:[(0,G.jsx)(p.A,{variant:"h3",sx:{fontWeight:800,color:he.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders Details"}),(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,G.jsx)(x.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,G.jsxs)(p.A,{variant:"caption",sx:{color:he.textSecondary,fontWeight:600},children:["Live \xb7 ",_||"All Zones"," \xb7 ",Ie]})]})]})]}),(0,G.jsx)(ae.A,{ref:L,locaName:_,setAppId:Re,setLocoName:B,setPage:E,pill:!0,accentColor:be,icon:(0,G.jsx)(T.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Ae,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,G.jsx)(f.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:or.map((e=>{const t=e.icon;return(0,G.jsx)(f.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,G.jsxs)(s.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:he.radiusCard/8,border:"1px solid",borderColor:he.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:he.shadowMd,borderColor:fe(e.color)}},children:[(0,G.jsx)(x.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(me(e.color)," 100%)")}}),(0,G.jsxs)(h.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,G.jsxs)(h.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,G.jsx)(p.A,{sx:{fontWeight:800,color:he.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:e.value})]}),(0,G.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:me(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(fe(e.color)),flexShrink:0},children:(0,G.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,G.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:he.radiusCard/8,border:"1px solid",borderColor:he.borderSubtle,background:"#fff",boxShadow:he.shadowSoft},children:(0,G.jsxs)(f.Ay,{container:!0,spacing:1.25,alignItems:"center",children:[(0,G.jsx)(f.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,G.jsx)(b.A,{options:Kt||[],value:bt,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",PaperComponent:Ae,onOpen:e=>{Pe||(e.preventDefault(),(0,le.k)("Please select a your app location first!","warning",3e3),setTimeout((()=>{var e;null===(e=L.current)||void 0===e||e.focus()}),0))},onChange:(e,t,r)=>{"clear"===r?(ft(0),vt(null),mt(0),jt(null)):(ft((null===t||void 0===t?void 0:t.tenantid)||0),vt(t),mt(t.locationid),jt(null))},renderInput:e=>(0,G.jsx)(v.A,(0,o.A)((0,o.A)({},e),{},{inputRef:N,placeholder:"Select Tenant",size:"small",sx:ye("#0ea5e9"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,G.jsx)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,G.jsx)(je,{color:"#0ea5e9",size:22,selected:!0,children:(0,G.jsx)(T.Itr,{size:13})})})})}))})}),(0,G.jsx)(f.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,G.jsx)(b.A,{options:Ut||[],getOptionLabel:e=>e?"".concat(e.locationname," (").concat(e.suburb,")"):"",value:At,PaperComponent:Ae,onOpen:e=>{Pe||gt?gt||(e.preventDefault(),(0,le.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=N.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,le.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=L.current)||void 0===e||e.focus()}),0))},onChange:(e,t,r)=>{"clear"===r?(mt(0),jt(null)):(mt(t.locationid||0),jt(t))},renderInput:e=>(0,G.jsx)(v.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Location",size:"small",sx:ye("#10b981"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,G.jsx)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,G.jsx)(je,{color:"#10b981",size:22,selected:!0,children:(0,G.jsx)(T.JFD,{size:13})})})})}))})}),(0,G.jsx)(f.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,G.jsx)(b.A,{options:qt||[],value:St,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname),PaperComponent:Ae,onOpen:()=>{Pe||(0,le.k)("Select App Location First","warning",2e3)},onChange:(e,t,r)=>{"clear"===r?(wt(null),kt(null)):(wt(t),kt(t))},renderInput:e=>(0,G.jsx)(v.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Rider",size:"small",sx:ye("#8b5cf6"),InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,G.jsx)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,G.jsx)(je,{color:"#8b5cf6",size:22,selected:!0,children:(0,G.jsx)(T.bsz,{size:13})})})})}))})}),(0,G.jsx)(f.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,G.jsxs)(h.A,{direction:"row",spacing:1,alignItems:"center",justifyContent:{xs:"flex-start",md:"flex-end"},children:[(0,G.jsx)(d.A,{title:"Date Filter",placement:"top",children:(0,G.jsxs)(x.A,{onClick:()=>ue(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:pe("#f59e0b"),border:"1.5px solid ".concat(fe("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(ge("#f59e0b"))}},children:[(0,G.jsx)(T.Ki0,{size:14}),q()(J).format("DD/MM/YY")," \u2013 ",q()(V).format("DD/MM/YY")]})}),(0,G.jsx)(A.A,{variant:"contained",size:"small",startIcon:(0,G.jsx)(T.S3Y,{}),onClick:()=>{Mt(!0),setTimeout((()=>{H("")}),0)},sx:{borderRadius:999,px:1.5,py:.75,fontWeight:800,fontSize:12,textTransform:"none",background:"linear-gradient(135deg, ".concat(be," 0%, ").concat(ve," 100%)"),boxShadow:"0 6px 18px ".concat(ge(be)),"&:hover":{background:"linear-gradient(135deg, ".concat(be," 0%, ").concat(ve," 100%)"),boxShadow:"0 8px 22px ".concat(ge(be))}},children:"Export"})]})})]})}),(0,G.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:he.radiusCard/8,borderTopRightRadius:he.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:he.borderSubtle,borderBottom:0,background:"#fff"},children:(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,G.jsx)(h.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:he.borderSubtle,borderRadius:4}},children:Se.map((e=>{var t;const r=we[e],o=r.icon,n=ht.toLowerCase()===e,i=null!==(t=It[e])&&void 0!==t?t:0;return(0,G.jsxs)(x.A,{onClick:()=>ut("all"===e?"All":e),sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?r.color:fe(r.color)),bgcolor:n?r.color:pe(r.color),color:n?"#fff":r.color,fontWeight:700,boxShadow:n?"0 6px 18px ".concat(ge(r.color)):"none",transition:"all 0.18s","&:hover":{borderColor:r.color,boxShadow:n?"0 6px 18px ".concat(ge(r.color)):"0 0 0 3px ".concat(ge(r.color))}},children:[(0,G.jsx)(c.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:n?"rgba(255,255,255,0.22)":me(r.color),color:n?"#fff":r.color},children:(0,G.jsx)(o,{size:13})}),(0,G.jsx)(p.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,G.jsx)(x.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:n?"rgba(255,255,255,0.22)":"#fff",color:n?"#fff":r.color,border:n?"none":"1px solid ".concat(fe(r.color))},children:i})]},e)}))}),(0,G.jsx)(x.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,G.jsx)(ne.A,{value:Ye,onChange:Te,onDebouncedChange:Ne,placeholder:"Search orders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:pe(be),"& fieldset":{borderColor:fe(be),borderWidth:1.5},"&:hover fieldset":{borderColor:be},"&.Mui-focused fieldset":{borderColor:be,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(ge(be))}}})})]})}),(0,G.jsx)(s.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:he.radiusCard/8,borderBottomRightRadius:he.radiusCard/8,border:"1px solid",borderColor:he.borderSubtle,overflow:"hidden",background:"#fff"},children:(0,G.jsxs)(j.A,{ref:u,onScroll:e=>{const{scrollTop:t,scrollHeight:r,clientHeight:o}=e.currentTarget;t+o>=r-50&&Ot&&!Ft&&Nt()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:fe(be),borderRadius:8,"&:hover":{backgroundColor:be}},"&::-webkit-scrollbar-track":{backgroundColor:he.surfaceAlt}},children:[t?(0,G.jsx)(ce.nV,{sx:{p:1.25},children:Yt?(0,G.jsxs)(h.A,{alignItems:"center",sx:{py:6},children:[(0,G.jsx)(ie.A,{}),(0,G.jsx)(p.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading orders\u2026"})]}):0==(null===Et||void 0===Et?void 0:Et.length)?(0,G.jsxs)(h.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,G.jsx)(c.A,{sx:{width:64,height:64,bgcolor:me("#94a3b8"),color:he.textMuted},children:(0,G.jsx)(T.Z2J,{size:28})}),(0,G.jsx)(p.A,{variant:"subtitle1",sx:{fontWeight:700,color:he.textPrimary},children:"No orders to show"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,textAlign:"center",px:2},children:Ye?"Try a different keyword.":"Adjust the filters above to load orders."})]}):null===Et||void 0===Et?void 0:Et.map(((e,t)=>{var r;const o=String(e.orderstatus||"").toLowerCase(),n=we[o]||{label:e.orderstatus||"\u2014",color:be,icon:T.Z2J},i=n.icon,a="cancelled"===o,l="delivered"===e.orderstatus;return(0,G.jsx)(ce.pg,{accent:n.color,header:(0,G.jsxs)(h.A,{spacing:1.25,children:[(0,G.jsxs)(h.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[(0,G.jsx)(p.A,{variant:"caption",sx:{fontWeight:700,color:he.textMuted},children:String(F*K+t+1).padStart(2,"0")}),(0,G.jsx)(je,{color:be,size:32,children:(0,G.jsx)(T.Itr,{size:16})}),(0,G.jsxs)(h.A,{spacing:.25,sx:{minWidth:0},children:[(0,G.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:he.textPrimary},noWrap:!0,children:e.tenantname}),(0,G.jsxs)(p.A,{variant:"caption",sx:{color:he.textSecondary,fontWeight:700},children:["#",e.orderid]})]})]}),(0,G.jsx)(d.A,{title:l?"View rider route":"Available for delivered orders",placement:"top",children:(0,G.jsx)("span",{children:(0,G.jsx)(y.A,{size:"small",disabled:!l,onClick:()=>{l&&(Pt(e.deliveryid),qe(e))},sx:{flexShrink:0,bgcolor:me(l?be:"#94a3b8"),color:l?be:he.textMuted,border:"1px solid ".concat(fe(l?be:"#94a3b8")),"&:hover":{bgcolor:l?be:me("#94a3b8"),color:l?"#fff":he.textMuted}},children:(0,G.jsx)(T.Cd7,{size:14})})})})]}),(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{flexWrap:"wrap",gap:.5},children:[(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:pe(n.color),border:"1px solid ".concat(fe(n.color)),color:n.color,fontSize:11,fontWeight:800},children:[(0,G.jsx)(i,{size:12})," ",n.label]}),e.ridername&&(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:pe("#8b5cf6"),border:"1px solid ".concat(fe("#8b5cf6")),color:"#8b5cf6",fontSize:11,fontWeight:800},children:[(0,G.jsx)(T.bsz,{size:12})," ",e.ridername]}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textMuted,fontWeight:600},children:q()(e.deliverydate).utc().format("DD/MM/YYYY \xb7 hh:mm A")})]})]}),children:(0,G.jsxs)(ce.FG,{children:[(0,G.jsx)(ce.pY,{label:"Pickup",children:(0,G.jsxs)(h.A,{spacing:.25,sx:{minWidth:0},children:[(0,G.jsx)(p.A,{sx:{fontSize:13,fontWeight:700,color:he.textPrimary},noWrap:!0,children:e.pickupcustomer||"\u2014"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},noWrap:!0,children:e.pickupcontactno}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},noWrap:!0,children:e.pickupsuburb||(e.Pickupaddress?e.Pickupaddress.slice(0,22)+"\u2026":"")}),e.applocation&&(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.75,py:.25,borderRadius:999,bgcolor:pe("#10b981"),border:"1px solid ".concat(fe("#10b981")),color:"#10b981",fontSize:10,fontWeight:800,width:"fit-content"},children:[(0,G.jsx)(T.JFD,{size:11})," ",e.applocation]})]})}),(0,G.jsx)(ce.pY,{label:"Drop",children:(0,G.jsxs)(h.A,{spacing:.25,sx:{minWidth:0},children:[(0,G.jsx)(p.A,{sx:{fontSize:13,fontWeight:700,color:he.textPrimary},noWrap:!0,children:e.deliverycustomer||"\u2014"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},noWrap:!0,children:e.deliverycontactno}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},noWrap:!0,children:e.deliverysuburb||(e.deliveryaddress?e.deliveryaddress.slice(0,22)+"\u2026":"")})]})}),(0,G.jsx)(ce.pY,{label:"Assigned",children:(0,G.jsx)(De,{value:e.assigntime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"Accepted",children:(0,G.jsx)(De,{value:e.acceptedtime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"Arrived",children:(0,G.jsx)(De,{value:e.arrivaltime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"Picked",children:(0,G.jsx)(De,{value:e.pickuptime,formatDate:er,formatTime:tr,success:"active"===e.deliverystatus})}),(0,G.jsx)(ce.pY,{label:"Active",children:(0,G.jsx)(De,{value:e.starttime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"Delivered",children:(0,G.jsx)(De,{value:e.deliverytime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"Cancelled",children:(0,G.jsx)(De,{value:e.canceltime,formatDate:er,formatTime:tr})}),(0,G.jsx)(ce.pY,{label:"KMS \xb7 plan / act / rider",full:!0,children:(0,G.jsxs)(h.A,{direction:"row",spacing:.5,sx:{flexWrap:"wrap",gap:.5},children:[(0,G.jsx)(ke,{color:"#ef4444",icon:(0,G.jsx)(T.xI$,{size:11}),label:a||""==e.kms?"0 km":"".concat(e.kms," km"),tooltip:"KMS"}),(0,G.jsx)(ke,{color:"#10b981",icon:(0,G.jsx)(T.xI$,{size:11}),label:"".concat(null!==(r=e.cumulativekms)&&void 0!==r?r:0," km"),tooltip:"Actual KMS"}),(0,G.jsx)(ke,{color:"#0ea5e9",icon:(0,G.jsx)(T.xI$,{size:11}),label:"".concat(e.previouskms||(a?"0.00":e.kms)||0," km"),tooltip:"Rider KMS"})]})}),(0,G.jsx)(ce.pY,{label:"Charges \xb7 chg / amt",full:!0,children:(0,G.jsxs)(h.A,{direction:"row",spacing:.5,sx:{flexWrap:"wrap",gap:.5},children:[(0,G.jsx)(ke,{color:"#ef4444",icon:(0,G.jsx)(T.YHz,{size:11}),label:a||""==e.deliverycharges?"0.00":"".concat(e.deliverycharges,".00"),tooltip:"Delivery Charge"}),(0,G.jsx)(ke,{color:"#10b981",icon:(0,G.jsx)(T.YHz,{size:11}),label:""==e.deliveryamt?"0.00":"".concat(e.deliveryamt,".00"),tooltip:"Delivery Amount"})]})}),e.ordernotes&&(0,G.jsx)(ce.pY,{label:"Notes",full:!0,children:(0,G.jsxs)(h.A,{direction:"row",spacing:.5,alignItems:"flex-start",children:[(0,G.jsx)(T.NpB,{size:12,color:he.textMuted,style:{marginTop:2,flexShrink:0}}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},children:e.ordernotes})]})})]})},e.deliveryid||"".concat(e.orderid,"-").concat(t))}))}):(0,G.jsxs)(w.A,{stickyHeader:!0,sx:{minWidth:1600},children:[(0,G.jsx)(S.A,{children:(0,G.jsxs)(k.A,{sx:{"& th":{backgroundColor:he.surfaceAlt,color:he.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(he.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,G.jsx)(D.A,{children:"#"}),(0,G.jsx)(D.A,{children:"Map"}),(0,G.jsx)(D.A,{children:"Client"}),(0,G.jsx)(D.A,{children:"Pickup"}),(0,G.jsx)(D.A,{children:"Drop"}),(0,G.jsx)(D.A,{children:"Status / Rider"}),(0,G.jsx)(D.A,{children:"Assigned"}),(0,G.jsx)(D.A,{children:"Accepted"}),(0,G.jsx)(D.A,{children:"Arrived"}),(0,G.jsx)(D.A,{children:"Picked"}),(0,G.jsx)(D.A,{children:"Active"}),(0,G.jsx)(D.A,{children:"Delivered"}),(0,G.jsx)(D.A,{children:"Cancelled"}),(0,G.jsx)(D.A,{children:"Notes"}),(0,G.jsx)(D.A,{align:"center",children:"KMS"}),(0,G.jsx)(D.A,{align:"center",children:"Charges"})]})}),(0,G.jsx)(M.A,{children:Yt?(0,G.jsx)(se,{rows:16,columns:16,height:15}):0==(null===Et||void 0===Et?void 0:Et.length)?(0,G.jsx)(k.A,{children:(0,G.jsx)(D.A,{colSpan:16,sx:{py:6},children:(0,G.jsxs)(h.A,{alignItems:"center",spacing:1.5,children:[(0,G.jsx)(c.A,{sx:{width:64,height:64,bgcolor:me("#94a3b8"),color:he.textMuted},children:(0,G.jsx)(T.Z2J,{size:28})}),(0,G.jsx)(p.A,{variant:"subtitle1",sx:{fontWeight:700,color:he.textPrimary},children:"No orders to show"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},children:Ye?"Try a different keyword.":"Adjust the filters above to load orders."})]})})}):null===Et||void 0===Et?void 0:Et.map(((e,t)=>{var r;const o=String(e.orderstatus||"").toLowerCase(),n=we[o]||{label:e.orderstatus||"\u2014",color:be,icon:T.Z2J},i=n.icon,a="cancelled"===o;return(0,G.jsxs)(k.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(he.divider),py:{xs:1,md:1.25},px:{xs:1,md:1.5},verticalAlign:"top"},"&:hover":{backgroundColor:he.surfaceAlt}},children:[(0,G.jsx)(D.A,{children:(0,G.jsx)(p.A,{variant:"caption",sx:{fontWeight:700,color:he.textMuted},children:String(F*K+t+1).padStart(2,"0")})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(d.A,{title:"delivered"===e.orderstatus?"View rider route":"Available for delivered orders",placement:"top",children:(0,G.jsx)("span",{children:(0,G.jsx)(y.A,{size:"small",disabled:"delivered"!==e.orderstatus,onClick:()=>{"delivered"===e.orderstatus&&(Pt(e.deliveryid),qe(e))},sx:{bgcolor:"delivered"===e.orderstatus?me(be):me("#94a3b8"),color:"delivered"===e.orderstatus?be:he.textMuted,border:"1px solid ".concat("delivered"===e.orderstatus?fe(be):fe("#94a3b8")),"&:hover":{bgcolor:"delivered"===e.orderstatus?be:me("#94a3b8"),color:"delivered"===e.orderstatus?"#fff":he.textMuted}},children:(0,G.jsx)(T.Cd7,{size:14})})})})}),(0,G.jsx)(D.A,{children:(0,G.jsxs)(h.A,{direction:"row",alignItems:"flex-start",spacing:1,children:[(0,G.jsx)(je,{color:be,size:32,children:(0,G.jsx)(T.Itr,{size:16})}),(0,G.jsxs)(h.A,{spacing:.25,sx:{minWidth:0},children:[(0,G.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:he.textPrimary,whiteSpace:"nowrap"},children:e.tenantname}),(0,G.jsx)(d.A,{title:"Order ID",placement:"top",children:(0,G.jsxs)(p.A,{variant:"caption",sx:{color:he.textSecondary,fontWeight:700},children:["#",e.orderid]})}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textMuted},children:q()(e.deliverydate).utc().format("DD/MM/YYYY \xb7 hh:mm A")})]})]})}),(0,G.jsx)(D.A,{children:(0,G.jsxs)(h.A,{spacing:.25,children:[(0,G.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:he.textPrimary,whiteSpace:"nowrap"},children:e.pickupcustomer||"\u2014"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},children:e.pickupcontactno}),(0,G.jsx)(d.A,{title:e.Pickupaddress||e.pickupsuburb||"",children:(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,cursor:"pointer",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.pickupsuburb||(e.Pickupaddress?e.Pickupaddress.slice(0,22)+"\u2026":"")})}),e.applocation&&(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.75,py:.25,borderRadius:999,bgcolor:pe("#10b981"),border:"1px solid ".concat(fe("#10b981")),color:"#10b981",fontSize:10,fontWeight:800,width:"fit-content"},children:[(0,G.jsx)(T.JFD,{size:11})," ",e.applocation]})]})}),(0,G.jsx)(D.A,{children:(0,G.jsxs)(h.A,{spacing:.25,children:[(0,G.jsx)(p.A,{variant:"subtitle2",sx:{fontWeight:700,color:he.textPrimary,whiteSpace:"nowrap"},children:e.deliverycustomer||"\u2014"}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary},children:e.deliverycontactno}),(0,G.jsx)(d.A,{title:e.deliveryaddress||"",children:(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,cursor:"pointer",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.deliverysuburb||(e.deliveryaddress?e.deliveryaddress.slice(0,22)+"\u2026":"")})})]})}),(0,G.jsx)(D.A,{children:(0,G.jsxs)(h.A,{spacing:.5,children:[(0,G.jsxs)(x.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:pe(n.color),border:"1px solid ".concat(fe(n.color)),color:n.color,fontSize:11,fontWeight:800,width:"fit-content"},children:[(0,G.jsx)(i,{size:12})," ",n.label]}),e.ridername&&(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,G.jsx)(T.bsz,{size:12,color:he.textMuted}),(0,G.jsx)(d.A,{title:"Rider ID: ".concat(e.userid),children:(0,G.jsx)(p.A,{variant:"caption",sx:{fontWeight:700,color:he.textPrimary,whiteSpace:"nowrap"},children:e.ridername})})]})]})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.assigntime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.acceptedtime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.arrivaltime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.pickuptime,formatDate:er,formatTime:tr,success:"active"===e.deliverystatus})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.starttime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.deliverytime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{children:(0,G.jsx)(De,{value:e.canceltime,formatDate:er,formatTime:tr})}),(0,G.jsx)(D.A,{sx:{maxWidth:180},children:e.ordernotes?(0,G.jsxs)(h.A,{direction:"row",spacing:.5,alignItems:"flex-start",children:[(0,G.jsx)(T.NpB,{size:12,color:he.textMuted,style:{marginTop:2,flexShrink:0}}),(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textSecondary,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.ordernotes})]}):(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textMuted},children:"\u2014"})}),(0,G.jsx)(D.A,{align:"center",children:(0,G.jsxs)(h.A,{spacing:.5,alignItems:"center",children:[(0,G.jsx)(ke,{color:"#ef4444",icon:(0,G.jsx)(T.xI$,{size:11}),label:a||""==e.kms?"0 km":"".concat(e.kms," km"),tooltip:"KMS"}),(0,G.jsx)(ke,{color:"#10b981",icon:(0,G.jsx)(T.xI$,{size:11}),label:"".concat(null!==(r=e.cumulativekms)&&void 0!==r?r:0," km"),tooltip:"Actual KMS"}),(0,G.jsx)(ke,{color:"#0ea5e9",icon:(0,G.jsx)(T.xI$,{size:11}),label:"".concat(e.previouskms||(a?"0.00":e.kms)||0," km"),tooltip:"Rider KMS"})]})}),(0,G.jsx)(D.A,{align:"center",children:(0,G.jsxs)(h.A,{spacing:.5,alignItems:"center",children:[(0,G.jsx)(ke,{color:"#ef4444",icon:(0,G.jsx)(T.YHz,{size:11}),label:a||""==e.deliverycharges?"0.00":"".concat(e.deliverycharges,".00"),tooltip:"Delivery Charge"}),(0,G.jsx)(ke,{color:"#10b981",icon:(0,G.jsx)(T.YHz,{size:11}),label:""==e.deliveryamt?"0.00":"".concat(e.deliveryamt,".00"),tooltip:"Delivery Amount"})]})})]},e.deliveryid||"".concat(e.orderid,"-").concat(t))}))})]}),(0,G.jsx)(C.A,{}),0!==(null===Et||void 0===Et?void 0:Et.length)&&(0,G.jsx)(h.A,{justifyContent:"center",alignItems:"center",sx:{width:"100%",py:2},children:(0,G.jsx)(h.A,{ref:r,style:{textAlign:"center",width:"100%"},children:Ft||Ot?(0,G.jsx)(ie.A,{}):(0,G.jsx)(p.A,{variant:"caption",sx:{color:he.textMuted,fontWeight:600},children:"No more orders"})})})]})}),(0,G.jsxs)(z.A,{open:Dt,onClose:()=>Mt(!1),fullWidth:!0,maxWidth:"sm",fullScreen:t,PaperProps:{sx:{borderRadius:{xs:0,sm:3},overflow:"hidden"}},children:[(0,G.jsx)(I.A,{sx:{background:"linear-gradient(135deg, ".concat(be," 0%, ").concat(ve," 100%)"),color:"#fff",py:2},children:(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,G.jsx)(c.A,{sx:{width:36,height:36,bgcolor:"rgba(255,255,255,0.22)",color:"#fff"},children:(0,G.jsx)(T.S3Y,{size:20})}),(0,G.jsxs)(h.A,{children:[(0,G.jsx)(p.A,{sx:{fontSize:11,fontWeight:700,opacity:.85,letterSpacing:.6,textTransform:"uppercase",lineHeight:1},children:"Report"}),(0,G.jsx)(p.A,{sx:{fontWeight:800,fontSize:{xs:"1.05rem",sm:"1.2rem"},lineHeight:1.2,mt:.25},children:"Export Orders"})]})]}),(0,G.jsx)(y.A,{size:"small",onClick:()=>Mt(!1),sx:{color:"#fff",bgcolor:"rgba(255,255,255,0.18)","&:hover":{bgcolor:"rgba(255,255,255,0.3)"}},children:(0,G.jsx)(T.m6K,{size:16})})]})}),(0,G.jsxs)(W.A,{sx:{p:2},children:[Yt&&(0,G.jsx)(Z.A,{}),[{label:"App Location",value:_,color:be},{label:"Tenant",value:null===bt||void 0===bt?void 0:bt.tenantname,color:"#0ea5e9"},{label:"Business Location",value:null===At||void 0===At?void 0:At.locationname,color:"#10b981"},{label:"Status",value:ht,color:"#f59e0b"},{label:"Rider",value:St?"".concat(St.firstname," ").concat(St.lastname):null,color:"#8b5cf6"},{label:"Keyword",value:Ye,color:"#06b6d4"},{label:"Start Date",value:J,color:"#14b8a6"},{label:"End Date",value:V,color:"#ef4444"}].map(((e,t)=>(0,G.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:1.5,py:1,borderRadius:2,bgcolor:pe(e.color),border:"1px solid ".concat(fe(e.color)),mb:1},children:[(0,G.jsx)(p.A,{variant:"body2",sx:{fontWeight:700,color:he.textPrimary},children:e.label}),(0,G.jsx)(P.A,{size:"small",label:e.value||"None",sx:{fontWeight:700,bgcolor:e.value?e.color:me("#94a3b8"),color:e.value?"#fff":he.textMuted,border:"none"}})]},t)))]}),(0,G.jsxs)(R.A,{sx:{p:2,bgcolor:he.surfaceAlt,gap:1},children:[(0,G.jsx)(A.A,{color:"inherit",variant:"outlined",onClick:()=>Mt(!1),sx:{borderRadius:999,px:2,textTransform:"none",fontWeight:700,borderColor:he.borderSubtle,color:he.textSecondary},children:"Cancel"}),(0,G.jsx)(ee.pK,{data:Qt,filename:"Orders_Detail_".concat(q()().format("YYYY-MM-DD_HHmmss"),".csv"),label:"Download CSV",btnLoading:Yt,onClick:()=>{setTimeout((()=>Mt(!1)),0)}})]})]}),(0,G.jsx)(oe.A,{open:de,onClose:()=>ue(!1),onSelect:e=>{U(e.startDate),$(e.endDate),We(e.label)}}),(0,G.jsx)(z.A,{open:Ce,onClose:()=>{ze(!1)},fullScreen:!0,fullWidth:!0,children:Oe&&(0,G.jsx)("div",{children:(0,G.jsx)(X,{coordinates:Oe,additionalProps:{riderStart:Ee,riderEnd:He},order:Be,setMapOpen:ze})})})]})}},23787:(e,t,r)=>{r.d(t,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var o=r(89379),n=r(80045),i=r(93230),a=r(2235),l=r(16491),s=r(82053),c=r(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:r=!1,onScroll:a,sx:l}=e,s=(0,n.A)(e,d);return(0,c.jsx)(i.A,(0,o.A)((0,o.A)({spacing:1.25,onScroll:a,sx:(0,o.A)((0,o.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},s),{},{children:t}))},h=e=>{let{accent:t="#662582",header:r,footer:n,selected:i=!1,onClick:s,children:d,sx:x}=e;return(0,c.jsxs)(a.A,{elevation:0,onClick:s,sx:(0,o.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?t:"#e2e8f0",background:i?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[r,d,n]})]})},u=e=>{let{children:t,columns:r=2,sx:n}=e;return(0,c.jsx)(l.A,{sx:(0,o.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:t})},p=e=>{let{label:t,value:r,children:o,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(s.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==o?o:(0,c.jsx)(s.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},35678:(e,t,r)=>{r.d(t,{A:()=>j});var o=r(9950),n=r(96583),i=r(40033),a=r(82053),l=r(28170),s=r(93230),c=r(82223),d=r(55916),x=r(4159),h=r.n(x),u=r(56712),p=r(81417),m=r(96600),g=r(53132),f=r(94289),b=r(57326),v=r(50624),A=r(44414);const j=e=>{let{open:t,onClose:r,onSelect:x}=e;const[j,y]=(0,o.useState)(null);return(0,A.jsxs)(n.A,{open:t,onClose:r,children:[(0,A.jsx)(i.A,{align:"left",children:(0,A.jsx)(a.A,{variant:"h4",children:"Select Filter Options"})}),(0,A.jsx)(l.A,{sx:{width:"100%"},className:"datedialog",children:(0,A.jsx)(d.U,{open:t,toggle:r,id:"daterange1",onChange:e=>{y({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,g.A)(new Date,-1)),endDate:(0,m.A)((0,g.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,g.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,f.A)(new Date),endDate:(0,b.A)(new Date)},{label:"Last Month",startDate:(0,f.A)((0,v.A)(new Date,-1)),endDate:(0,b.A)((0,v.A)(new Date,-1))}]})}),(0,A.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,A.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{j?(x(j),r()):r()},children:"OK"})})]})}},46639:(e,t,r)=>{r.d(t,{A:()=>P});var o=r(57528),n=r(98587),i=r(58168),a=r(9950),l=r(72004),s=r(3484),c=r(88283),d=r(89548),x=r(18463),h=r(59254),u=r(45558),p=r(1614);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,u.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var g,f,b,v,A=r(44414);const j=["className","color","disableShrink","size","style","thickness","value","variant"];let y,w,S,k;const D=44,M=(0,c.i7)(y||(y=g||(g=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),C=(0,c.i7)(w||(w=f||(f=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),z=(0,h.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t["color".concat((0,d.A)(r.color))]]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({display:"inline-block"},"determinate"===t.variant&&{transition:r.transitions.create("transform")},"inherit"!==t.color&&{color:(r.vars||r).palette[t.color].main})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&(0,c.AH)(S||(S=b||(b=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),M)})),I=(0,h.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),W=(0,h.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t["circle".concat((0,d.A)(r.variant))],r.disableShrink&&t.circleDisableShrink]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:r.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,c.AH)(k||(k=v||(v=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),C)})),P=a.forwardRef((function(e,t){const r=(0,x.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:a="primary",disableShrink:c=!1,size:h=40,style:u,thickness:p=3.6,value:g=0,variant:f="indeterminate"}=r,b=(0,n.A)(r,j),v=(0,i.A)({},r,{color:a,disableShrink:c,size:h,thickness:p,value:g,variant:f}),y=(e=>{const{classes:t,variant:r,color:o,disableShrink:n}=e,i={root:["root",r,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(r)),n&&"circleDisableShrink"]};return(0,s.A)(i,m,t)})(v),w={},S={},k={};if("determinate"===f){const e=2*Math.PI*((D-p)/2);w.strokeDasharray=e.toFixed(3),k["aria-valuenow"]=Math.round(g),w.strokeDashoffset="".concat(((100-g)/100*e).toFixed(3),"px"),S.transform="rotate(-90deg)"}return(0,A.jsx)(z,(0,i.A)({className:(0,l.A)(y.root,o),style:(0,i.A)({width:h,height:h},S,u),ownerState:v,ref:t,role:"progressbar"},k,b,{children:(0,A.jsx)(I,{className:y.svg,ownerState:v,viewBox:"".concat(22," ").concat(22," ").concat(D," ").concat(D),children:(0,A.jsx)(W,{className:y.circle,style:w,ownerState:v,cx:D,cy:D,r:(D-p)/2,fill:"none",strokeWidth:p})})}))}))},56311:(e,t,r)=>{r.d(t,{A:()=>u});var o=r(89379),n=r(9950),i=r(2660),a=r(2046),l=r(83274),s=r(25333),c=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:t,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const f=(0,n.useRef)(null),[b]=(0,x.d7)(t,p);return(0,n.useEffect)((()=>{u&&u(b)}),[b,u]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=f.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===f.current&&f.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},g),inputRef:f,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(a.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,t,r)=>{r.d(t,{A:()=>l});r(9950);var o=r(16491),n=r(46639),i=r(62217),a=r(44414);function l(e){let{size:t=70,imgSize:r=40,alt:l="loader"}=e;return(0,a.jsxs)(o.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,a.jsx)(n.A,{size:t}),(0,a.jsx)(o.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,a.jsx)("img",{src:i,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,t,r)=>{r.d(t,{A:()=>h});var o=r(89379),n=r(9950),i=r(93230),a=r(41413),l=r(77922),s=r(29925),c=r(26910),d=r(31222),x=r(44414);const h=(0,n.forwardRef)(((e,t)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:g,pill:f=!1,accentColor:b="#6366f1",icon:v,placeholder:A="Select Zone",paperComponent:j}=e;const[y,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const S=e=>"".concat(b).concat(e),k=S("08"),D=S("26"),M=S("55"),C=S("18"),z=f?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:M,borderWidth:1.5},"&:hover fieldset":{borderColor:b},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(D)},"&.Mui-focused fieldset":{borderColor:b,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:b}}:{},I=f&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(a.A,{sx:{width:24,height:24,bgcolor:C,color:b,transition:"background-color 0.15s, color 0.15s"},children:v||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:j,sx:(0,o.A)({},p),onChange:(e,t,o)=>{"clear"===o?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===r||void 0===r||r(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>f?(0,x.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:A,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:I}),sx:(0,o.A)((0,o.A)({},z),g||m||{})})):(0,x.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},g||m||{})}))})}))}}]); \ No newline at end of file diff --git a/build/static/js/8954.4813af23.chunk.js b/build/static/js/8954.4813af23.chunk.js new file mode 100644 index 0000000..63936e2 --- /dev/null +++ b/build/static/js/8954.4813af23.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8954],{62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},88954:(e,a,t)=>{t.r(a),t.d(a,{default:()=>T});var l=t(89379),n=t(9950),o=t(28429),s=t(14857),i=t(47223),r=t(93230),c=t(82053),d=t(82223),h=t(16491),p=t(60899),A=t(19647),m=t(29925),u=t(70006),x=t(23266),g=t(77922),v=t(63189),j=t(81831),f=t(95359),y=t(30633),C=t(50027),b=t(26910),S=t(56713),k=t(52351),W=t(99459),Y=t(8881),F=t(4159),N=t.n(F),R=t(94826),B=t(44414);const T=()=>{const e=(0,s.A)(),a=(0,i.A)(e.breakpoints.down("md")),t=(0,o.zy)(),[F,T]=(0,n.useState)(null),w=(0,o.Zp)(),[I,J]=(0,n.useState)(""),[M,P]=(0,n.useState)(""),[z,D]=(0,n.useState)(""),[K,L]=(0,n.useState)(""),[V,H]=(0,n.useState)({}),[E,Z]=(0,n.useState)([]),[G,U]=(0,n.useState)([]),[q,O]=(0,n.useState)([]),[Q,X]=(0,n.useState)([]),[_,$]=(0,n.useState)(),ee=localStorage.getItem("userid");W.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[ae,te]=(0,n.useState)(!1);(0,n.useEffect)((()=>{(async e=>{try{let a=await b.A.get("https://jupiter.nearle.app/live/api/v1/partners/getriderdetail/?userid=".concat(e));console.log("riderdataresponse",a.data.details),T(a.data.details),se(a.data.details.applocationid)}catch(a){console.log("fetchmanagerList",a)}})(t.state.riderdata.userid)}),[]),(0,n.useEffect)((()=>{console.log("riderdata",F)}),[F,I]),(0,n.useEffect)((()=>{J(t.state.riderdata.address),P(t.state.riderdata.suburb),D(t.state.riderdata.city),L(t.state.riderdata.state)}),[]),(0,n.useEffect)((()=>{localStorage.getItem("tenantid")&&le(localStorage.getItem("tenantid")),ne(),oe()}),[]),(0,n.useEffect)((()=>{V.applocationid&&se(V.applocationid)}),[V.applocationid]);const le=async e=>{te(!0),await b.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&setTenantinfo(e.data.details),te(!1)})).catch((e=>{console.log(e),te(!1)}))},ne=async()=>{te(!0),await b.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapptypes?tag=vehicle")).then((e=>{console.log("fetchvehicle",e);let a=[];e.data.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.typename}))})),Z([...a]),te(!1)})).catch((e=>{console.log(e),te(!1)}))},oe=async()=>{te(!0),await b.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapptypes?tag=accounttype")).then((e=>{console.log(e);let a=[];e.data.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.typename}))})),U([...a]),console.log(a),te(!1)})).catch((e=>{console.log(e),te(!1)}))};(0,n.useEffect)((()=>{(async()=>{try{const e=await b.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(ee));console.log("fetchAppLocations",e.data.details),O(e.data.details)}catch(e){console.log("locationRes",e)}})()}),[]);const se=async e=>{te(!0),await b.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getridershifts/?applocationid=").concat(e)).then((e=>{console.log("fetchridershifts",e);let a=[];e.data.details.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.shiftname}))})),X([...a]),console.log(a),te(!1)})).catch((e=>{console.log(e),te(!1)}))};(0,n.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:ie}=(0,S.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let a,t,l,n;console.log(e),J(e.formatted_address);for(let o=0;o{T(null),w("/nearle/riders")},children:"Back to Riders"})]}),children:(0,B.jsx)(h.A,{sx:{maxHeight:"calc(100vh - 280px)",overflowY:"auto",overflowX:"hidden",scrollbarGutter:"stable",scrollBehavior:"smooth"},children:(0,B.jsxs)(r.A,{display:"flex",spacing:{xs:2.5,sm:5},children:[(0,B.jsx)(C.A,{title:(0,B.jsx)(c.A,{variant:"h4",sx:{m:2},children:"Contact Information"}),children:(0,B.jsxs)(p.Ay,{container:!0,spacing:{xs:2,sm:3},children:[(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-last-name",children:"First Name"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-last-name",value:null===F||void 0===F?void 0:F.firstname,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{firstname:e.target.value}))},placeholder:"Name",autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-last-name",children:"Last Name"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-last-name",placeholder:"Name",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{lastname:e.target.value}))},value:null===F||void 0===F?void 0:F.lastname,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,B.jsxs)(r.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,B.jsx)(u.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,B.jsx)(x.A,{value:"+1",children:"+91"})}),(0,B.jsx)(m.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{contactno:e.target.value}))},value:null===F||void 0===F?void 0:F.contactno,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-email",children:"Email Address"}),(0,B.jsx)(m.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{email:e.target.value}))},value:null===F||void 0===F?void 0:F.email,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-address",children:"Address"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:I,onChange:e=>{J(e.target.value)},inputRef:ie})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Location"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{suburb:e.target.value})),P(e.target.value)},value:M,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-zipcode",children:"City"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{city:e.target.value})),D(e.target.value)},value:z,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"State"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{state:e.target.value})),L(e.target.value)},value:K,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Identification No"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Identification No",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{identificationno:e.target.value}))},value:null===F||void 0===F?void 0:F.identificationno,autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Choose Partner"}),(0,B.jsx)(g.A,{disablePortal:!0,id:"combo-box-demo",options:q,getOptionLabel:e=>"".concat(e.locationname),sx:{width:{xs:"100%",sm:300},height:"30px",ml:{xs:0,sm:3},zIndex:"100"},onChange:(e,a)=>{a?(console.log(a),$(a.locationname),se(a.applocationid),T((0,l.A)((0,l.A)({},F),{},{partnerid:a.partnerid,applocationid:a.applocationid}))):H({})},renderInput:e=>(0,B.jsx)(m.A,(0,l.A)((0,l.A)({},e),{},{label:_||(null===F||void 0===F?void 0:F.city)}))})]})})]})}),(0,B.jsx)(C.A,{title:(0,B.jsx)(c.A,{variant:"h4",sx:{m:2},children:"Charges"}),children:(0,B.jsxs)(p.Ay,{container:!0,spacing:{xs:2,sm:3},children:[(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Shift Type"}),(0,B.jsx)(g.A,{renderInput:e=>(0,B.jsx)(m.A,(0,l.A)((0,l.A)({},e),{},{label:null!==F&&void 0!==F&&F.starttime&&null!==F&&void 0!==F&&F.endtime?"".concat(null===F||void 0===F?void 0:F.starttime," - ").concat(null===F||void 0===F?void 0:F.endtime):"Choose"})),options:Q,onChange:(e,a)=>{a?(console.log("shift",a),T((0,l.A)((0,l.A)({},F),{},{shiftid:a.shiftid,additionalkm:a.additionalkm,additionalcharges:a.additionalcharges,basefare:a.basefare,starttime:a.starttime,endtime:a.endtime})),setBasefare(a.basefare),setAdditionalkms(a.additionalkm),setOthercharges(a.additionalcharges),setShift(a)):(setBasefare(""),setAdditionalkms(""),setOthercharges(""),setShift({}))},freeSolo:!0})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Base Fare"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Base Fare",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{basefare:e.target.value})),setBasefare(e.target.value)},value:null===F||void 0===F?void 0:F.basefare,autoComplete:"off",disabled:!0})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Additional Kms"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Additional Kms",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{additionalkm:e.target.value})),setAdditionalkms(e.target.value)},value:null===F||void 0===F?void 0:F.additionalkm,autoComplete:"off",disabled:!0})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Other Charges"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Other Charges",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{additionalcharges:e.target.value})),setOthercharges(e.target.value)},value:null===F||void 0===F?void 0:F.additionalcharges,autoComplete:"off",disabled:!0})]})})]})}),(0,B.jsx)(C.A,{title:(0,B.jsx)(c.A,{variant:"h4",sx:{m:2},children:"Bank Details"}),children:(0,B.jsxs)(p.Ay,{container:!0,spacing:{xs:2,sm:3},children:[" ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Account No"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Account No",value:null===F||void 0===F?void 0:F.accountno,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{accountno:e.target.value})),setAccountno(e.target.value)},autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Account Name"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Account Name",value:null===F||void 0===F?void 0:F.accountname,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{accountname:e.target.value})),setAccountname(e.target.value)},autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Account Type"}),(0,B.jsx)(g.A,{renderInput:e=>(0,B.jsx)(m.A,(0,l.A)((0,l.A)({},e),{},{label:""==(null===F||void 0===F?void 0:F.accounttype)?"Choose":null===F||void 0===F?void 0:F.accounttype})),options:G,onChange:(e,a)=>{console.log("ac type",a),a?(T((0,l.A)((0,l.A)({},F),{},{accounttype:a.label})),setAccount(a),setAccountType(a.label)):setAccount({})},freeSolo:!0})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Bank Name"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Bank Name",value:null===F||void 0===F?void 0:F.bankname,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{bankname:e.target.value})),setBankname(e.target.value)},autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"IFSC Code"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"IFSC Code",value:null===F||void 0===F?void 0:F.ifsccode,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{ifsccode:e.target.value})),setIfsc(e.target.value)},autoComplete:"off"})]})}),(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Branch"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Branch",value:null===F||void 0===F?void 0:F.branch,onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{branch:e.target.value})),setBranch(e.target.value)},autoComplete:"off"})]})})]})}),(0,B.jsx)(C.A,{title:(0,B.jsx)(c.A,{variant:"h4",sx:{m:2},children:"Vehicle Details"}),children:(0,B.jsxs)(p.Ay,{container:!0,spacing:{xs:2,sm:3},children:[(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Vehicle Name"}),(0,B.jsx)(g.A,{renderInput:e=>(0,B.jsx)(m.A,(0,l.A)((0,l.A)({},e),{},{label:""==(null===F||void 0===F?void 0:F.vehiclename)?"Choose":null===F||void 0===F?void 0:F.vehiclename})),options:E,onChange:(e,a)=>{a?(console.log("vehi",a),setVehicle(a),T((0,l.A)((0,l.A)({},F),{},{vehiclename:a.label,vehicleid:a.apptypeid}))):setVehicle({})},freeSolo:!0})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Vehicle No"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Vehicle No",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{vehicleno:e.target.value}))},value:null===F||void 0===F?void 0:F.vehicleno,autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Model Year"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Model Year",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{model:e.target.value})),setModelyear(e.target.value)},value:null===F||void 0===F?void 0:F.model,autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Vehicle Color"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Vehicle Color",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{color:e.target.value})),setVehiclecolor(e.target.value)},value:null===F||void 0===F?void 0:F.color,autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"License No"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"License No",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{licenseno:e.target.value}))},value:null===F||void 0===F?void 0:F.licenseno,autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Insurance No"}),(0,B.jsx)(m.A,{fullWidth:!0,id:"personal-location",placeholder:"Insurance No",onChange:e=>{T((0,l.A)((0,l.A)({},F),{},{insuranceno:e.target.value}))},value:null===F||void 0===F?void 0:F.insuranceno,autoComplete:"off"})]})})," ",(0,B.jsx)(p.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsxs)(r.A,{spacing:1.25,children:[(0,B.jsx)(A.A,{htmlFor:"personal-location",children:"Insurance Expiry Date"}),(0,B.jsx)(j.$,{dateAdapter:f.R,children:(0,B.jsx)(y.l,{label:"Date",value:N()(null===F||void 0===F?void 0:F.insurancedate),onChange:e=>{setExpirydate(N()(e.$d).format("YYYY-MM-DD 00:00:00")),T((0,l.A)((0,l.A)({},F),{},{insurancedate:N()(e.$d).format("YYYY-MM-DD 00:00:00")}))},sx:{width:"100%"}})})]})})]})})]})})}),(0,B.jsx)(h.A,{sx:{position:"sticky",bottom:0,backgroundColor:"secondary.lighter",p:2,zIndex:10,border:" 1px solid ",borderColor:"#E6EBF1",borderTop:"none"},children:(0,B.jsxs)(r.A,{direction:{xs:"column-reverse",sm:"row"},justifyContent:"flex-end",spacing:2,children:[(0,B.jsx)(d.A,{startIcon:(0,B.jsx)(v.A,{}),variant:"outlined",fullWidth:a,onClick:()=>w("/nearle/riders"),children:"Back to Riders"}),(0,B.jsx)(d.A,{variant:"contained",fullWidth:a,onClick:()=>{(async()=>{te(!0),console.log("updated riderData",F),await b.A.put("https://jupiter.nearle.app/live/api/v1/partners/updaterider",{userid:F.userid,contactno:F.contactno,firstname:F.firstname,lastname:F.lastname,email:F.email,address:F.address,suburb:F.suburb,city:F.city,state:F.state,partnerid:F.partnerid,applocationid:F.applocationid,ridersettings:{riderid:F.riderid,userid:F.userid,partnerid:F.partnerid,shiftid:F.shiftid,identificationno:F.identificationno,basefare:F.basefare,additionalkm:F.additionalkm,othercharges:F.othercharges,accountno:F.accountno,accountname:F.accountname,accounttypeid:F.accounttypeid,accounttype:F.accounttype,bankname:F.bankname,ifsccode:F.ifsccode,Branch:F.branch,vehicleid:F.vehicleid,vehiclename:F.vehiclename,vehicleno:F.vehicleno,model:F.model,color:F.color,licenseno:F.licenseno,insurancedate:N()(F.insurancedate).format("YYYY-MM-DD HH:mm:ss")}}).then((e=>{console.log("post response",e),200==e.status?((0,Y.M8)("Updated Sucessfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),T(null),w("/nearle/riders"),te(!1)):((0,Y.M8)("Update Failed",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),te(!1))}))})()},children:"Update"})]})})]})}},94826:(e,a,t)=>{t.d(a,{A:()=>c});var l=t(59254),n=t(46639),o=t(62217),s=t(44414);const i=(0,l.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),r=(0,l.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,s.jsxs)(i,{children:[(0,s.jsx)(n.A,{color:"primary",size:80,thickness:6}),(0,s.jsx)(r,{children:(0,s.jsx)("img",{src:o,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/8954.4c6f4fd3.chunk.js b/build/static/js/8954.4c6f4fd3.chunk.js deleted file mode 100644 index c0b72a6..0000000 --- a/build/static/js/8954.4c6f4fd3.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8954],{62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},88954:(e,a,t)=>{t.r(a),t.d(a,{default:()=>R});var l=t(89379),n=t(9950),o=t(28429),i=t(93230),s=t(82053),r=t(82223),c=t(16491),d=t(60899),h=t(19647),p=t(29925),A=t(70006),u=t(23266),m=t(77922),x=t(63189),g=t(81831),v=t(95359),j=t(30633),f=t(50027),y=t(26910),C=t(56713),S=t(52351),b=t(99459),k=t(8881),Y=t(4159),W=t.n(Y),F=t(94826),N=t(44414);const R=()=>{const e=(0,o.zy)(),[a,t]=(0,n.useState)(null),Y=(0,o.Zp)(),[R,B]=(0,n.useState)(""),[T,w]=(0,n.useState)(""),[I,J]=(0,n.useState)(""),[M,P]=(0,n.useState)(""),[z,D]=(0,n.useState)({}),[K,L]=(0,n.useState)([]),[V,H]=(0,n.useState)([]),[E,Z]=(0,n.useState)([]),[G,U]=(0,n.useState)([]),[q,O]=(0,n.useState)(),Q=localStorage.getItem("userid");b.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const[X,_]=(0,n.useState)(!1);(0,n.useEffect)((()=>{(async e=>{try{let a=await y.A.get("https://jupiter.nearle.app/live/api/v1/partners/getriderdetail/?userid=".concat(e));console.log("riderdataresponse",a.data.details),t(a.data.details),te(a.data.details.applocationid)}catch(a){console.log("fetchmanagerList",a)}})(e.state.riderdata.userid)}),[]),(0,n.useEffect)((()=>{console.log("riderdata",a)}),[a,R]),(0,n.useEffect)((()=>{B(e.state.riderdata.address),w(e.state.riderdata.suburb),J(e.state.riderdata.city),P(e.state.riderdata.state)}),[]),(0,n.useEffect)((()=>{localStorage.getItem("tenantid")&&$(localStorage.getItem("tenantid")),ee(),ae()}),[]),(0,n.useEffect)((()=>{z.applocationid&&te(z.applocationid)}),[z.applocationid]);const $=async e=>{_(!0),await y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(e)).then((e=>{console.log(e),e.data.status&&setTenantinfo(e.data.details),_(!1)})).catch((e=>{console.log(e),_(!1)}))},ee=async()=>{_(!0),await y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapptypes?tag=vehicle")).then((e=>{console.log("fetchvehicle",e);let a=[];e.data.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.typename}))})),L([...a]),_(!1)})).catch((e=>{console.log(e),_(!1)}))},ae=async()=>{_(!0),await y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapptypes?tag=accounttype")).then((e=>{console.log(e);let a=[];e.data.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.typename}))})),H([...a]),console.log(a),_(!1)})).catch((e=>{console.log(e),_(!1)}))};(0,n.useEffect)((()=>{(async()=>{try{const e=await y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(Q));console.log("fetchAppLocations",e.data.details),Z(e.data.details)}catch(e){console.log("locationRes",e)}})()}),[]);const te=async e=>{_(!0),await y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getridershifts/?applocationid=").concat(e)).then((e=>{console.log("fetchridershifts",e);let a=[];e.data.details.map((e=>{a.push((0,l.A)((0,l.A)({},e),{},{label:e.shiftname}))})),U([...a]),console.log(a),_(!1)})).catch((e=>{console.log(e),_(!1)}))};(0,n.useEffect)((()=>{selectedImage&&setAvatar(URL.createObjectURL(selectedImage))}),[selectedImage]);const{ref:le}=(0,C.usePlacesWidget)({apiKey:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",onPlaceSelected:e=>{let a,t,l,n;console.log(e),B(e.formatted_address);for(let o=0;o{t(null),Y("/nearle/riders")},children:"Back to Riders"})]}),children:(0,N.jsx)(c.A,{sx:{maxHeight:"calc(100vh - 280px)",overflowY:"auto",overflowX:"hidden",scrollbarGutter:"stable",scrollBehavior:"smooth"},children:(0,N.jsxs)(i.A,{display:"flex",spacing:5,children:[(0,N.jsx)(f.A,{title:(0,N.jsx)(s.A,{variant:"h4",sx:{m:2},children:"Contact Information"}),children:(0,N.jsxs)(d.Ay,{container:!0,spacing:3,children:[(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-last-name",children:"First Name"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-last-name",value:null===a||void 0===a?void 0:a.firstname,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{firstname:e.target.value}))},placeholder:"Name",autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-last-name",children:"Last Name"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-last-name",placeholder:"Name",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{lastname:e.target.value}))},value:null===a||void 0===a?void 0:a.lastname,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-phone",children:"Phone Number"}),(0,N.jsxs)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,N.jsx)(A.A,{defaultValue:"+1",disabled:!0,sx:{cursor:"not-allowed"},children:(0,N.jsx)(u.A,{value:"+1",children:"+91"})}),(0,N.jsx)(p.A,{type:"number",id:"personal-phone",fullWidth:!0,placeholder:"Phone Number",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{contactno:e.target.value}))},value:null===a||void 0===a?void 0:a.contactno,autoComplete:"off",sx:{cursor:"not-allowed"}})]})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-email",children:"Email Address"}),(0,N.jsx)(p.A,{type:"email",fullWidth:!0,id:"personal-email",placeholder:"Email Address",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{email:e.target.value}))},value:null===a||void 0===a?void 0:a.email,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-address",children:"Address"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-address",placeholder:"Address",value:R,onChange:e=>{B(e.target.value)},inputRef:le})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Location"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Location",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{suburb:e.target.value})),w(e.target.value)},value:T,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-zipcode",children:"City"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-zipcode",placeholder:"City",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{city:e.target.value})),J(e.target.value)},value:I,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"State"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"State",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{state:e.target.value})),P(e.target.value)},value:M,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Identification No"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Identification No",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{identificationno:e.target.value}))},value:null===a||void 0===a?void 0:a.identificationno,autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Choose Partner"}),(0,N.jsx)(m.A,{disablePortal:!0,id:"combo-box-demo",options:E,getOptionLabel:e=>"".concat(e.locationname),sx:{width:300,height:"30px",ml:3,zIndex:"100"},onChange:(e,n)=>{n?(console.log(n),O(n.locationname),te(n.applocationid),t((0,l.A)((0,l.A)({},a),{},{partnerid:n.partnerid,applocationid:n.applocationid}))):D({})},renderInput:e=>(0,N.jsx)(p.A,(0,l.A)((0,l.A)({},e),{},{label:q||(null===a||void 0===a?void 0:a.city)}))})]})})]})}),(0,N.jsx)(f.A,{title:(0,N.jsx)(s.A,{variant:"h4",sx:{m:2},children:"Charges"}),children:(0,N.jsxs)(d.Ay,{container:!0,spacing:3,children:[(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Shift Type"}),(0,N.jsx)(m.A,{renderInput:e=>(0,N.jsx)(p.A,(0,l.A)((0,l.A)({},e),{},{label:null!==a&&void 0!==a&&a.starttime&&null!==a&&void 0!==a&&a.endtime?"".concat(null===a||void 0===a?void 0:a.starttime," - ").concat(null===a||void 0===a?void 0:a.endtime):"Choose"})),options:G,onChange:(e,n)=>{n?(console.log("shift",n),t((0,l.A)((0,l.A)({},a),{},{shiftid:n.shiftid,additionalkm:n.additionalkm,additionalcharges:n.additionalcharges,basefare:n.basefare,starttime:n.starttime,endtime:n.endtime})),setBasefare(n.basefare),setAdditionalkms(n.additionalkm),setOthercharges(n.additionalcharges),setShift(n)):(setBasefare(""),setAdditionalkms(""),setOthercharges(""),setShift({}))},freeSolo:!0})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Base Fare"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Base Fare",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{basefare:e.target.value})),setBasefare(e.target.value)},value:null===a||void 0===a?void 0:a.basefare,autoComplete:"off",disabled:!0})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Additional Kms"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Additional Kms",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{additionalkm:e.target.value})),setAdditionalkms(e.target.value)},value:null===a||void 0===a?void 0:a.additionalkm,autoComplete:"off",disabled:!0})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Other Charges"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Other Charges",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{additionalcharges:e.target.value})),setOthercharges(e.target.value)},value:null===a||void 0===a?void 0:a.additionalcharges,autoComplete:"off",disabled:!0})]})})]})}),(0,N.jsx)(f.A,{title:(0,N.jsx)(s.A,{variant:"h4",sx:{m:2},children:"Bank Details"}),children:(0,N.jsxs)(d.Ay,{container:!0,spacing:3,children:[" ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Account No"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Account No",value:null===a||void 0===a?void 0:a.accountno,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{accountno:e.target.value})),setAccountno(e.target.value)},autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Account Name"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Account Name",value:null===a||void 0===a?void 0:a.accountname,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{accountname:e.target.value})),setAccountname(e.target.value)},autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Account Type"}),(0,N.jsx)(m.A,{renderInput:e=>(0,N.jsx)(p.A,(0,l.A)((0,l.A)({},e),{},{label:""==(null===a||void 0===a?void 0:a.accounttype)?"Choose":null===a||void 0===a?void 0:a.accounttype})),options:V,onChange:(e,n)=>{console.log("ac type",n),n?(t((0,l.A)((0,l.A)({},a),{},{accounttype:n.label})),setAccount(n),setAccountType(n.label)):setAccount({})},freeSolo:!0})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Bank Name"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Bank Name",value:null===a||void 0===a?void 0:a.bankname,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{bankname:e.target.value})),setBankname(e.target.value)},autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"IFSC Code"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"IFSC Code",value:null===a||void 0===a?void 0:a.ifsccode,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{ifsccode:e.target.value})),setIfsc(e.target.value)},autoComplete:"off"})]})}),(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Branch"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Branch",value:null===a||void 0===a?void 0:a.branch,onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{branch:e.target.value})),setBranch(e.target.value)},autoComplete:"off"})]})})]})}),(0,N.jsx)(f.A,{title:(0,N.jsx)(s.A,{variant:"h4",sx:{m:2},children:"Vehicle Details"}),children:(0,N.jsxs)(d.Ay,{container:!0,spacing:3,children:[(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Vehicle Name"}),(0,N.jsx)(m.A,{renderInput:e=>(0,N.jsx)(p.A,(0,l.A)((0,l.A)({},e),{},{label:""==(null===a||void 0===a?void 0:a.vehiclename)?"Choose":null===a||void 0===a?void 0:a.vehiclename})),options:K,onChange:(e,n)=>{n?(console.log("vehi",n),setVehicle(n),t((0,l.A)((0,l.A)({},a),{},{vehiclename:n.label,vehicleid:n.apptypeid}))):setVehicle({})},freeSolo:!0})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Vehicle No"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Vehicle No",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{vehicleno:e.target.value}))},value:null===a||void 0===a?void 0:a.vehicleno,autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Model Year"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Model Year",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{model:e.target.value})),setModelyear(e.target.value)},value:null===a||void 0===a?void 0:a.model,autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Vehicle Color"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Vehicle Color",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{color:e.target.value})),setVehiclecolor(e.target.value)},value:null===a||void 0===a?void 0:a.color,autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"License No"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"License No",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{licenseno:e.target.value}))},value:null===a||void 0===a?void 0:a.licenseno,autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Insurance No"}),(0,N.jsx)(p.A,{fullWidth:!0,id:"personal-location",placeholder:"Insurance No",onChange:e=>{t((0,l.A)((0,l.A)({},a),{},{insuranceno:e.target.value}))},value:null===a||void 0===a?void 0:a.insuranceno,autoComplete:"off"})]})})," ",(0,N.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,N.jsxs)(i.A,{spacing:1.25,children:[(0,N.jsx)(h.A,{htmlFor:"personal-location",children:"Insurance Expiry Date"}),(0,N.jsx)(g.$,{dateAdapter:v.R,children:(0,N.jsx)(j.l,{label:"Date",value:W()(null===a||void 0===a?void 0:a.insurancedate),onChange:e=>{setExpirydate(W()(e.$d).format("YYYY-MM-DD 00:00:00")),t((0,l.A)((0,l.A)({},a),{},{insurancedate:W()(e.$d).format("YYYY-MM-DD 00:00:00")}))},sx:{width:"100%"}})})]})})]})})]})})}),(0,N.jsx)(c.A,{sx:{position:"sticky",bottom:0,backgroundColor:"secondary.lighter",p:2,zIndex:10,border:" 1px solid ",borderColor:"#E6EBF1",borderTop:"none"},children:(0,N.jsxs)(i.A,{direction:"row",justifyContent:"flex-end",spacing:2,children:[(0,N.jsx)(r.A,{startIcon:(0,N.jsx)(x.A,{}),variant:"outlined",onClick:()=>Y("/nearle/riders"),children:"Back to Riders"}),(0,N.jsx)(r.A,{variant:"contained",onClick:()=>{(async()=>{_(!0),console.log("updated riderData",a),await y.A.put("https://jupiter.nearle.app/live/api/v1/partners/updaterider",{userid:a.userid,contactno:a.contactno,firstname:a.firstname,lastname:a.lastname,email:a.email,address:a.address,suburb:a.suburb,city:a.city,state:a.state,partnerid:a.partnerid,applocationid:a.applocationid,ridersettings:{riderid:a.riderid,userid:a.userid,partnerid:a.partnerid,shiftid:a.shiftid,identificationno:a.identificationno,basefare:a.basefare,additionalkm:a.additionalkm,othercharges:a.othercharges,accountno:a.accountno,accountname:a.accountname,accounttypeid:a.accounttypeid,accounttype:a.accounttype,bankname:a.bankname,ifsccode:a.ifsccode,Branch:a.branch,vehicleid:a.vehicleid,vehiclename:a.vehiclename,vehicleno:a.vehicleno,model:a.model,color:a.color,licenseno:a.licenseno,insurancedate:W()(a.insurancedate).format("YYYY-MM-DD HH:mm:ss")}}).then((e=>{console.log("post response",e),200==e.status?((0,k.M8)("Updated Sucessfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),t(null),Y("/nearle/riders"),_(!1)):((0,k.M8)("Update Failed",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),_(!1))}))})()},children:"Update"})]})})]})}},94826:(e,a,t)=>{t.d(a,{A:()=>c});var l=t(59254),n=t(46639),o=t(62217),i=t(44414);const s=(0,l.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),r=(0,l.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,i.jsxs)(s,{children:[(0,i.jsx)(n.A,{color:"primary",size:80,thickness:6}),(0,i.jsx)(r,{children:(0,i.jsx)("img",{src:o,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); \ No newline at end of file diff --git a/build/static/js/9521.15393fd8.chunk.js b/build/static/js/9521.15393fd8.chunk.js new file mode 100644 index 0000000..6f6cdab --- /dev/null +++ b/build/static/js/9521.15393fd8.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9521],{19521:(e,t,o)=>{o.r(t),o.d(t,{default:()=>re});var r=o(89379),s=o(9950),n=o(26910),i=o(54826),l=o(58691),a=o(2235),c=o(41413),d=o(14857),x=o(47223),h=o(93230),u=o(82053),p=o(16491),m=o(60899),g=o(83274),A=o(25333),f=o(1320),j=o(15769),b=o(69780),v=o(9213),S=o(21671),w=o(34075),y=o(96583),k=o(40033),C=o(28170),W=o(29925),R=o(77922),z=o(79739),P=o(82223),T=o(31222),Y=o(99459),I=o(28217),M=o(55471),L=o.n(M),E=o(21209),J=o(52351),N=o(56311),H=o(59212),B=o(60010),K=o(36150),Z=o(81425),F=o(20466),q=o(96646),D=o(23787),O=o(44414);const V={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},G=(e,t)=>"".concat(e).concat(t),U=e=>G(e,"08"),Q=e=>G(e,"18"),X=e=>G(e,"26"),_=e=>G(e,"55"),$=e=>(0,O.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:V.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),ee=e=>{let{color:t,selected:o,size:r=24,children:s}=e;return(0,O.jsx)(c.A,{sx:{width:r,height:r,bgcolor:o?t:Q(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:s})},te="AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8";const oe={current:null};function re(){var e,t;const o=(0,d.A)(),M=(0,x.A)(o.breakpoints.down("md")),G=(0,s.useRef)(),re=(0,s.useRef)(),[se]=(0,s.useState)(50),[ne]=(0,s.useState)(0),[ie,le]=(0,s.useState)(0),[ae,ce]=(0,s.useState)("All"),[de,xe]=(0,s.useState)({}),[he,ue]=(0,s.useState)(!1),[pe,me]=(0,s.useState)(""),[ge,Ae]=(0,s.useState)({}),[fe,je]=(0,s.useState)(""),[be,ve]=(0,s.useState)(""),[Se,we]=(0,s.useState)(""),[ye,ke]=(0,s.useState)(""),[Ce,We]=(0,s.useState)(""),[Re,ze]=(0,s.useState)(""),[Pe,Te]=(0,s.useState)(null),[Ye,Ie]=(0,s.useState)(""),[Me,Le]=(0,s.useState)([]),Ee=(0,s.useRef)(!1);"undefined"===typeof window||Ee.current||(document.querySelector("#google-maps")||function(e,t,o){if(!t)return;const r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("id",o),r.src=e,t.appendChild(r)}("https://maps.googleapis.com/maps/api/js?key=".concat(te,"&libraries=places"),document.querySelector("head"),"google-maps"),Ee.current=!0);const Je=(0,s.useMemo)((()=>(0,E.A)(((e,t)=>{oe.current.getPlacePredictions(e,t)}),400)),[]);(0,s.useEffect)((()=>{let e=!0;if(!oe.current&&window.google&&(oe.current=new window.google.maps.places.AutocompleteService),oe.current){if(""!==Ye)return Je({input:Ye},(t=>{if(e){let e=[];Pe&&(e=[Pe]),t&&(e=[...e,...t]),Le(e)}})),()=>{e=!1};Le(Pe?[Pe]:[])}}),[Pe,Ye,Je]),Y.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,s.useEffect)((()=>{try{console.log("selected address =>",pe),Y.A.fromAddress(pe).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:o}=e.results[0].geometry.location;if(Ae({lat:t,lng:o}),e.results[0].address_components){let s,n,i,l,a=e.results[0];for(let e=0;e(0,r.A)((0,r.A)({},e),{},{city:s||"",state:i||"",postcode:n||"",suburb:l||"",latitude:t||"",longitude:o||""})))}}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[pe]);const{data:Ne,isLoading:He,isFetchingNextPage:Be,fetchNextPage:Ke,hasNextPage:Ze,refetch:Fe}=(0,B.q)({queryKey:["getAllCustomers",ie,Re,se],queryFn:Z.jO,getNextPageParam:e=>e.nextPage,keepPreviousData:!0}),qe=(null===Ne||void 0===Ne?void 0:Ne.pages.flatMap((e=>e.data)))||[];(0,s.useEffect)((()=>{if(!Ze)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Ke()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return re.current&&e.observe(re.current),()=>{re.current&&e.unobserve(re.current)}}),[Ze,Ke]);const De=e=>{const{scrollTop:t,scrollHeight:o,clientHeight:r}=e.currentTarget;t+r>=o-50&&Ze&&!Be&&Ke()},{data:Oe,isLoading:Ve}=(0,K.I)({queryKey:["customersummary",ie],queryFn:Z.zf});(0,s.useEffect)((()=>{console.log("pageCount",Oe)}),[Oe]);const Ge=[{key:"total",label:"Total Customers",color:"#662582",icon:T.Itr,value:null!==(e=null===Oe||void 0===Oe?void 0:Oe.Total)&&void 0!==e?e:0},{key:"loaded",label:"Loaded in View",color:"#0ea5e9",icon:T.lbm,value:qe.length},{key:"zone",label:"Active Zone",color:"#10b981",icon:T.JFD,value:ae||"All Zones"}];return(0,O.jsxs)(O.Fragment,{children:[(Ve||He)&&(0,O.jsx)(J.A,{}),(0,O.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:V.radiusCard/8,border:"1px solid",borderColor:V.borderSubtle,background:"linear-gradient(135deg, ".concat(U("#662582")," 0%, ").concat(U("#9255AB")," 100%)"),boxShadow:V.shadowMd},children:(0,O.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,O.jsx)(c.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#662582",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,O.jsx)(T._pN,{size:22})}),(0,O.jsxs)(h.A,{children:[(0,O.jsx)(u.A,{variant:"h3",sx:{fontWeight:800,color:V.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Customers"}),(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,O.jsx)(p.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,O.jsxs)(u.A,{variant:"caption",sx:{color:V.textSecondary,fontWeight:600},children:["Live \xb7 ",ae||"All Zones"]})]})]})]}),(0,O.jsx)(H.A,{locaName:ae,setAppId:le,setLocoName:ce,pill:!0,accentColor:"#662582",icon:(0,O.jsx)(T.HPi,{size:14}),placeholder:"Select Zone",paperComponent:$,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,O.jsx)(m.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ge.map((e=>{const t=e.icon;return(0,O.jsx)(m.Ay,{item:!0,xs:6,sm:4,children:(0,O.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:V.radiusCard/8,border:"1px solid",borderColor:V.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:V.shadowMd,borderColor:_(e.color)}},children:[(0,O.jsx)(p.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(Q(e.color)," 100%)")}}),(0,O.jsxs)(h.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,O.jsxs)(h.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,O.jsx)(u.A,{sx:{fontWeight:800,color:V.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,O.jsx)(c.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:Q(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(_(e.color)),flexShrink:0},children:(0,O.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,O.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:V.radiusCard/8,borderTopRightRadius:V.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:V.borderSubtle,borderBottom:0,background:"#fff"},children:(0,O.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,O.jsx)(ee,{color:"#662582",size:32,children:(0,O.jsx)(T.Itr,{size:18})}),(0,O.jsxs)(h.A,{children:[(0,O.jsx)(u.A,{variant:"caption",sx:{fontWeight:800,color:V.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Directory"}),(0,O.jsxs)(u.A,{variant:"body2",sx:{color:V.textPrimary,fontWeight:700},children:[null!==(t=null===Oe||void 0===Oe?void 0:Oe.Total)&&void 0!==t?t:0," total \xb7 ",qe.length," loaded"]})]})]}),(0,O.jsx)(p.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,O.jsx)(N.A,{value:Ce,onChange:We,onDebouncedChange:ze,placeholder:"Search customers (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:U("#662582"),"& fieldset":{borderColor:_("#662582"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#662582"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(X("#662582"))}}})})]})}),(0,O.jsx)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:V.radiusCard/8,borderBottomRightRadius:V.radiusCard/8,border:"1px solid",borderColor:V.borderSubtle,overflow:"hidden",background:"#fff"},children:M?(0,O.jsxs)(D.nV,{scroll:!0,onScroll:De,children:[He&&(0,O.jsx)(l.A,{}),0!==(null===qe||void 0===qe?void 0:qe.length)||He?null===qe||void 0===qe?void 0:qe.map(((e,t)=>(0,O.jsx)(D.pg,{accent:"#662582",header:(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,O.jsx)(ee,{color:"#662582",size:36,children:(0,O.jsx)(T.Azs,{size:18})}),(0,O.jsxs)(h.A,{sx:{minWidth:0},children:[(0,O.jsx)(u.A,{variant:"subtitle2",sx:{fontWeight:700,color:V.textPrimary},noWrap:!0,children:e.firstname||"\u2014"}),(0,O.jsxs)(u.A,{variant:"caption",sx:{color:V.textSecondary},children:["ID #",e.customerid]})]})]}),(0,O.jsx)(g.A,{title:"Edit customer",placement:"top",children:(0,O.jsx)(A.A,{size:"small",onClick:()=>{xe(e),setTimeout((()=>ue(!0)),0)},sx:{bgcolor:Q("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(_("#8b5cf6")),flexShrink:0,"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},children:(0,O.jsx)(T.Yvo,{size:16})})})]}),children:(0,O.jsxs)(D.FG,{children:[(0,O.jsx)(D.pY,{label:"Contact",value:e.contactno||"\u2014"}),(0,O.jsx)(D.pY,{label:"Location",children:e.suburb?(0,O.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:U("#10b981"),border:"1px solid ".concat(_("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,O.jsx)(T.gwi,{size:12})," ",e.suburb]}):(0,O.jsx)(u.A,{sx:{fontSize:13,fontWeight:600,color:V.textMuted},children:"\u2014"})}),(0,O.jsx)(D.pY,{label:"Address",full:!0,children:(0,O.jsx)(u.A,{sx:{fontSize:13,fontWeight:600,color:V.textPrimary},children:e.address||"\u2014"})})]})},e.customerid||"".concat(e.firstname,"-").concat(t)))):(0,O.jsxs)(h.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,O.jsx)(c.A,{sx:{width:64,height:64,bgcolor:Q("#94a3b8"),color:V.textMuted},children:(0,O.jsx)(T.Itr,{size:28})}),(0,O.jsx)(u.A,{variant:"subtitle1",sx:{fontWeight:700,color:V.textPrimary},children:"No customers to show"}),(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textSecondary,textAlign:"center"},children:Ce?"Try a different keyword.":"Pick a zone above to load the directory."})]}),0!==(null===qe||void 0===qe?void 0:qe.length)&&(0,O.jsx)("div",{ref:re,style:{height:40,textAlign:"center"},children:Be||Ze?(0,O.jsx)(l.A,{}):(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textMuted,fontWeight:600},children:"No more customers"})})]}):(0,O.jsx)(f.A,{ref:G,onScroll:De,sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:_("#662582"),borderRadius:8,"&:hover":{backgroundColor:"#662582"}},"&::-webkit-scrollbar-track":{backgroundColor:V.surfaceAlt}},children:(0,O.jsxs)(j.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,O.jsx)(b.A,{children:(0,O.jsxs)(v.A,{sx:{"& th":{backgroundColor:V.surfaceAlt,color:V.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(V.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,O.jsx)(S.A,{children:"#"}),(0,O.jsx)(S.A,{children:"Customer"}),(0,O.jsx)(S.A,{children:"Contact"}),(0,O.jsx)(S.A,{children:"Address"}),(0,O.jsx)(S.A,{children:"Location"}),(0,O.jsx)(S.A,{align:"right",children:"Action"})]})}),(0,O.jsxs)(w.A,{children:[He&&(0,O.jsx)(q.r,{}),0!==(null===qe||void 0===qe?void 0:qe.length)||He?null===qe||void 0===qe?void 0:qe.map(((e,t)=>(0,O.jsxs)(v.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(V.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:V.surfaceAlt}},children:[(0,O.jsx)(S.A,{children:(0,O.jsx)(u.A,{variant:"caption",sx:{fontWeight:700,color:V.textMuted},children:String(t+1+ne*se).padStart(2,"0")})}),(0,O.jsx)(S.A,{children:(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,O.jsx)(ee,{color:"#662582",size:36,children:(0,O.jsx)(T.Azs,{size:18})}),(0,O.jsxs)(h.A,{children:[(0,O.jsx)(u.A,{variant:"subtitle2",sx:{fontWeight:700,color:V.textPrimary,whiteSpace:"nowrap"},children:e.firstname||"\u2014"}),(0,O.jsxs)(u.A,{variant:"caption",sx:{color:V.textSecondary},children:["ID #",e.customerid]})]})]})}),(0,O.jsx)(S.A,{children:(0,O.jsxs)(h.A,{children:[(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,O.jsx)(T.EZw,{size:12,color:V.textMuted}),(0,O.jsx)(u.A,{variant:"subtitle2",sx:{fontWeight:700,color:V.textPrimary,whiteSpace:"nowrap"},children:e.contactno||"\u2014"})]}),e.email&&(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textSecondary},children:e.email})]})}),(0,O.jsx)(S.A,{sx:{maxWidth:280},children:(0,O.jsx)(g.A,{title:e.address||"",placement:"top",children:(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textSecondary,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,O.jsx)(S.A,{children:e.suburb?(0,O.jsxs)(p.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:U("#10b981"),border:"1px solid ".concat(_("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,O.jsx)(T.gwi,{size:12})," ",e.suburb]}):(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textMuted},children:"\u2014"})}),(0,O.jsx)(S.A,{align:"right",children:(0,O.jsx)(g.A,{title:"Edit customer",placement:"top",children:(0,O.jsx)(A.A,{size:"small",onClick:()=>{xe(e),setTimeout((()=>ue(!0)),0)},sx:{bgcolor:Q("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(_("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},children:(0,O.jsx)(T.Yvo,{size:16})})})})]},e.customerid||"".concat(e.firstname,"-").concat(t)))):(0,O.jsx)(v.A,{children:(0,O.jsx)(S.A,{colSpan:6,sx:{py:6},children:(0,O.jsxs)(h.A,{alignItems:"center",spacing:1.5,children:[(0,O.jsx)(c.A,{sx:{width:64,height:64,bgcolor:Q("#94a3b8"),color:V.textMuted},children:(0,O.jsx)(T.Itr,{size:28})}),(0,O.jsx)(u.A,{variant:"subtitle1",sx:{fontWeight:700,color:V.textPrimary},children:"No customers to show"}),(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textSecondary},children:Ce?"Try a different keyword.":"Pick a zone above to load the directory."})]})})}),0!==(null===qe||void 0===qe?void 0:qe.length)&&(0,O.jsx)(v.A,{children:(0,O.jsx)(S.A,{colSpan:6,sx:{borderBottom:"none"},children:(0,O.jsx)("div",{ref:re,style:{height:40,textAlign:"center"},children:Be||Ze?(0,O.jsx)(l.A,{}):(0,O.jsx)(u.A,{variant:"caption",sx:{color:V.textMuted,fontWeight:600},children:"No more customers"})})})})]})]})})}),(0,O.jsxs)(y.A,{open:he,onClose:()=>ue(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"lg",fullWidth:!0,fullScreen:M,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,O.jsx)(k.A,{id:"alert-dialog-title",sx:{background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"#fff",py:2},children:(0,O.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,O.jsx)(c.A,{sx:{width:36,height:36,bgcolor:"rgba(255,255,255,0.2)",color:"#fff"},children:(0,O.jsx)(i.wwX,{style:{fontSize:18}})}),(0,O.jsxs)(h.A,{children:[(0,O.jsx)(u.A,{sx:{fontSize:11,fontWeight:700,opacity:.85,letterSpacing:.6,textTransform:"uppercase",lineHeight:1},children:"Customer"}),(0,O.jsxs)(u.A,{sx:{fontWeight:800,fontSize:{xs:"1.05rem",sm:"1.2rem"},lineHeight:1.2,mt:.25},children:["Edit ",(null===de||void 0===de?void 0:de.firstname)||"Customer"]})]})]})}),(0,O.jsx)(C.A,{children:(0,O.jsxs)(m.Ay,{container:!0,spacing:2,sx:{mt:2},children:[(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Customer Name"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,defaultValue:null===de||void 0===de?void 0:de.firstname,onChange:e=>{xe((0,r.A)((0,r.A)({},de),{},{firstname:e.target.value}))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Contact Number"}),(0,O.jsxs)(h.A,{direction:"row",spacing:1,children:[(0,O.jsx)(W.A,{readonly:!0,variant:"outlined",value:"+91",sx:{width:60}}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,type:"text",value:(null===de||void 0===de?void 0:de.contactno)||"",inputProps:{maxLength:10,inputMode:"numeric",pattern:"[0-9]*"},onChange:e=>{const t=e.target.value.replace(/\D/g,"");xe((e=>(0,r.A)((0,r.A)({},e),{},{contactno:t})))}})]})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:12,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Address"}),(0,O.jsx)(R.A,{id:"google-map-demo",sx:{},fullWidth:!0,getOptionLabel:e=>"string"===typeof e?e:(null===e||void 0===e?void 0:e.description)||"",filterOptions:e=>e,options:Me,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:null===de||void 0===de?void 0:de.address,noOptionsText:"No locations",onChange:(e,t)=>{Le(t?[t,...Me]:Me),Te(t),console.log("newValue",t||""),me(null===t||void 0===t?void 0:t.description),xe((0,r.A)((0,r.A)({},de),{},{address:null===t||void 0===t?void 0:t.description}))},onInputChange:(e,t)=>{Ie(t)},renderInput:e=>(0,O.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{fullWidth:!0})),renderOption:(e,t)=>{const o=t.structured_formatting.main_text_matched_substrings||[],s=L()(t.structured_formatting.main_text,o.map((e=>[e.offset,e.offset+e.length])));return(0,O.jsx)("li",(0,r.A)((0,r.A)({},e),{},{children:(0,O.jsxs)(m.Ay,{container:!0,alignItems:"center",children:[(0,O.jsx)(m.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,O.jsx)(I.A,{sx:{color:"text.secondary"}})}),(0,O.jsxs)(m.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[null===s||void 0===s?void 0:s.map(((e,t)=>(0,O.jsx)(p.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,O.jsx)(u.A,{variant:"body2",color:"text.secondary",children:null===t||void 0===t?void 0:t.structured_formatting.secondary_text})]})]})}))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Location"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,value:null===de||void 0===de?void 0:de.suburb,onChange:e=>{const t=e.target.value;xe((e=>(0,r.A)((0,r.A)({},e),{},{suburb:t})))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"City"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,value:de.city||fe||"",onChange:e=>{const t=e.target.value;xe((e=>(0,r.A)((0,r.A)({},e),{},{city:t})))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"State"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,value:de.state||Se||"",onChange:e=>{const t=e.target.value;xe((e=>(0,r.A)((0,r.A)({},e),{},{state:t})))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Postcode"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,value:""==be?de.postcode:be,onChange:e=>{const t=e.target.value;xe((e=>(0,r.A)((0,r.A)({},e),{},{postcode:t})))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:12,children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Landmark"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,defaultValue:de.landmark,onChange:e=>{xe((0,r.A)((0,r.A)({},de),{},{landmark:e.target.value}))}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,sx:{cursor:"not-allowed"},children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Latitude"}),(0,O.jsx)(W.A,{variant:"outlined",fullWidth:!0,value:ge.lat,sx:{cursor:"not-allowed"}})]}),(0,O.jsxs)(m.Ay,{item:!0,xs:6,sx:{cursor:"not-allowed"},children:[(0,O.jsx)(u.A,{sx:{mb:1},children:"Longitude"}),(0,O.jsx)(W.A,{readonly:!0,variant:"outlined",fullWidth:!0,value:ge.lng})]})]})}),(0,O.jsxs)(z.A,{sx:{mr:2,mb:2},children:[(0,O.jsx)(P.A,{onClick:()=>ue(!1),variant:"contained",color:"error",sx:{mr:2},children:"Close"}),(0,O.jsx)(P.A,{onClick:()=>{(async()=>{if(console.log("selectedCustomer",de),de.firstname)if(de.contactno)if(de.address)if(de.suburb)if(de.city)if(de.state)if(de.postcode)if(de.landmark)if(de.latitude)if(de.longitude)try{const e=await n.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/customers/update"),{customerid:de.customerid,configid:1,firstname:de.firstname,applocationid:de.applocationid,profileimage:"",dialcode:"+91",contactno:de.contactno,devicetype:"",deviceid:"",customertoken:"123",address:de.address,suburb:ye,city:fe,state:Se,postcode:be,landmark:de.landmark,doorno:de.doorno,latitude:de.latitude.toString(),longitude:de.longitude.toString()});console.log("postUpdateResponse",e),e.data.status&&((0,F.k)(e.data.message,"success",1500),ue(!1),Fe())}catch(e){console.log("postUpdate error",e)}else(0,F.k)("Enter Longitude","warning",1500);else(0,F.k)("Enter Latitude","warning",1500);else(0,F.k)("Enter Landmark","warning",1500);else(0,F.k)("Enter PostCode","warning",1500);else(0,F.k)("Enter State","warning",1500);else(0,F.k)("Enter City ","warning",1500);else(0,F.k)("Enter Suburb","warning",1500);else(0,F.k)("Enter Valid Address","warning",1500);else(0,F.k)("Enter Contact Number ","warning",1500);else(0,F.k)("Enter Door NO","warning",1500)})()},variant:"contained",autoFocus:!0,children:"Update"})]})]})]})}},23787:(e,t,o)=>{o.d(t,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var r=o(89379),s=o(80045),n=o(93230),i=o(2235),l=o(16491),a=o(82053),c=o(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:o=!1,onScroll:i,sx:l}=e,a=(0,s.A)(e,d);return(0,c.jsx)(n.A,(0,r.A)((0,r.A)({spacing:1.25,onScroll:i,sx:(0,r.A)((0,r.A)({p:1.5},o&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},h=e=>{let{accent:t="#662582",header:o,footer:s,selected:n=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(i.A,{elevation:0,onClick:a,sx:(0,r.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:n?t:"#e2e8f0",background:n?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[o,d,s]})]})},u=e=>{let{children:t,columns:o=2,sx:s}=e;return(0,c.jsx)(l.A,{sx:(0,r.A)({display:"grid",gridTemplateColumns:"repeat(".concat(o,", minmax(0, 1fr))"),gap:1,mt:1.25},s),children:t})},p=e=>{let{label:t,value:o,children:r,full:s=!1,align:n="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:s?"1 / -1":"auto",minWidth:0,textAlign:n},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==r?r:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==o&&void 0!==o?o:"\u2014"})})]})}},56311:(e,t,o)=>{o.d(t,{A:()=>u});var r=o(89379),s=o(9950),n=o(2660),i=o(2046),l=o(83274),a=o(25333),c=o(97125),d=o(7762),x=o(52097),h=o(44414);const u=e=>{let{value:t,onChange:o,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const A=(0,s.useRef)(null),[f]=(0,x.d7)(t,p);return(0,s.useEffect)((()=>{u&&u(f)}),[f,u]),(0,s.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=A.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===A.current&&A.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(n.A,{sx:(0,r.A)({},g),inputRef:A,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(i.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},58691:(e,t,o)=>{o.d(t,{A:()=>l});o(9950);var r=o(16491),s=o(46639),n=o(62217),i=o(44414);function l(e){let{size:t=70,imgSize:o=40,alt:l="loader"}=e;return(0,i.jsxs)(r.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(s.A,{size:t}),(0,i.jsx)(r.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:o,height:o},children:(0,i.jsx)("img",{src:n,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,t,o)=>{o.d(t,{A:()=>h});var r=o(89379),s=o(9950),n=o(93230),i=o(41413),l=o(77922),a=o(29925),c=o(26910),d=o(31222),x=o(44414);const h=(0,s.forwardRef)(((e,t)=>{let{setAppId:o,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:g,pill:A=!1,accentColor:f="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,s.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,s.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(f).concat(e),k=y("08"),C=y("26"),W=y("55"),R=y("18"),z=A?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:f},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:f,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:f}}:{},P=A&&(0,x.jsx)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(i.A,{sx:{width:24,height:24,bgcolor:R,color:f,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,r.A)({},p),onChange:(e,t,r)=>{"clear"===r?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===o||void 0===o||o(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>A?(0,x.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,r.A)((0,r.A)({},z),g||m||{})})):(0,x.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,r.A)({},g||m||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},96646:(e,t,o)=>{o.d(t,{r:()=>a});var r=o(9213),s=o(21671),n=o(82917),i=o(93230),l=o(44414);const a=e=>{let{rowsPerPage:t=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(r.A,{children:[(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,t)=>(0,l.jsx)(s.A,{children:(0,l.jsxs)(i.A,{spacing:.5,children:[(0,l.jsx)(n.A,{variant:"text",width:100}),(0,l.jsx)(n.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"text",width:150})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(s.A,{align:"center",children:(0,l.jsxs)(i.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(n.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(n.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/9521.e16f3399.chunk.js b/build/static/js/9521.e16f3399.chunk.js deleted file mode 100644 index ee2c758..0000000 --- a/build/static/js/9521.e16f3399.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9521],{19521:(e,t,o)=>{o.r(t),o.d(t,{default:()=>ee});var r=o(89379),s=o(9950),n=o(26910),i=o(54826),l=o(58691),a=o(2235),d=o(41413),c=o(93230),x=o(82053),u=o(16491),h=o(60899),p=o(1320),m=o(15769),g=o(69780),A=o(9213),f=o(21671),j=o(34075),b=o(83274),v=o(25333),S=o(96583),w=o(40033),y=o(28170),k=o(29925),C=o(77922),W=o(79739),R=o(82223),P=o(31222),T=o(99459),z=o(28217),Y=o(55471),I=o.n(Y),L=o(21209),M=o(52351),J=o(56311),E=o(59212),N=o(60010),B=o(36150),H=o(81425),K=o(20466),Z=o(96646),q=o(44414);const F={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},O=(e,t)=>"".concat(e).concat(t),D=e=>O(e,"08"),V=e=>O(e,"18"),G=e=>O(e,"26"),U=e=>O(e,"55"),Q=e=>(0,q.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:F.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),X=e=>{let{color:t,selected:o,size:r=24,children:s}=e;return(0,q.jsx)(d.A,{sx:{width:r,height:r,bgcolor:o?t:V(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:s})},_="AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8";const $={current:null};function ee(){var e,t;const o=(0,s.useRef)(),Y=(0,s.useRef)(),[O]=(0,s.useState)(50),[ee]=(0,s.useState)(0),[te,oe]=(0,s.useState)(0),[re,se]=(0,s.useState)("All"),[ne,ie]=(0,s.useState)({}),[le,ae]=(0,s.useState)(!1),[de,ce]=(0,s.useState)(""),[xe,ue]=(0,s.useState)({}),[he,pe]=(0,s.useState)(""),[me,ge]=(0,s.useState)(""),[Ae,fe]=(0,s.useState)(""),[je,be]=(0,s.useState)(""),[ve,Se]=(0,s.useState)(""),[we,ye]=(0,s.useState)(""),[ke,Ce]=(0,s.useState)(null),[We,Re]=(0,s.useState)(""),[Pe,Te]=(0,s.useState)([]),ze=(0,s.useRef)(!1);"undefined"===typeof window||ze.current||(document.querySelector("#google-maps")||function(e,t,o){if(!t)return;const r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("id",o),r.src=e,t.appendChild(r)}("https://maps.googleapis.com/maps/api/js?key=".concat(_,"&libraries=places"),document.querySelector("head"),"google-maps"),ze.current=!0);const Ye=(0,s.useMemo)((()=>(0,L.A)(((e,t)=>{$.current.getPlacePredictions(e,t)}),400)),[]);(0,s.useEffect)((()=>{let e=!0;if(!$.current&&window.google&&($.current=new window.google.maps.places.AutocompleteService),$.current){if(""!==We)return Ye({input:We},(t=>{if(e){let e=[];ke&&(e=[ke]),t&&(e=[...e,...t]),Te(e)}})),()=>{e=!1};Te(ke?[ke]:[])}}),[ke,We,Ye]),T.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,s.useEffect)((()=>{try{console.log("selected address =>",de),T.A.fromAddress(de).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:o}=e.results[0].geometry.location;if(ue({lat:t,lng:o}),e.results[0].address_components){let s,n,i,l,a=e.results[0];for(let e=0;e(0,r.A)((0,r.A)({},e),{},{city:s||"",state:i||"",postcode:n||"",suburb:l||"",latitude:t||"",longitude:o||""})))}}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[de]);const{data:Ie,isLoading:Le,isFetchingNextPage:Me,fetchNextPage:Je,hasNextPage:Ee,refetch:Ne}=(0,N.q)({queryKey:["getAllCustomers",te,we,O],queryFn:H.jO,getNextPageParam:e=>e.nextPage,keepPreviousData:!0}),Be=(null===Ie||void 0===Ie?void 0:Ie.pages.flatMap((e=>e.data)))||[];(0,s.useEffect)((()=>{if(!Ee)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Je()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return Y.current&&e.observe(Y.current),()=>{Y.current&&e.unobserve(Y.current)}}),[Ee,Je]);const{data:He,isLoading:Ke}=(0,B.I)({queryKey:["customersummary",te],queryFn:H.zf});(0,s.useEffect)((()=>{console.log("pageCount",He)}),[He]);const Ze=[{key:"total",label:"Total Customers",color:"#662582",icon:P.Itr,value:null!==(e=null===He||void 0===He?void 0:He.Total)&&void 0!==e?e:0},{key:"loaded",label:"Loaded in View",color:"#0ea5e9",icon:P.lbm,value:Be.length},{key:"zone",label:"Active Zone",color:"#10b981",icon:P.JFD,value:re||"All Zones"}];return(0,q.jsxs)(q.Fragment,{children:[(Ke||Le)&&(0,q.jsx)(M.A,{}),(0,q.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"linear-gradient(135deg, ".concat(D("#662582")," 0%, ").concat(D("#9255AB")," 100%)"),boxShadow:F.shadowMd},children:(0,q.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,q.jsx)(d.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#662582",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,q.jsx)(P._pN,{size:22})}),(0,q.jsxs)(c.A,{children:[(0,q.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Customers"}),(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,q.jsx)(u.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,q.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:600},children:["Live \xb7 ",re||"All Zones"]})]})]})]}),(0,q.jsx)(E.A,{locaName:re,setAppId:oe,setLocoName:se,pill:!0,accentColor:"#662582",icon:(0,q.jsx)(P.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Q,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,q.jsx)(h.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ze.map((e=>{const t=e.icon;return(0,q.jsx)(h.Ay,{item:!0,xs:12,sm:4,children:(0,q.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:F.shadowMd,borderColor:U(e.color)}},children:[(0,q.jsx)(u.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(V(e.color)," 100%)")}}),(0,q.jsxs)(c.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,q.jsxs)(c.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,q.jsx)(x.A,{sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,q.jsx)(d.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:V(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(U(e.color)),flexShrink:0},children:(0,q.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,q.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:F.radiusCard/8,borderTopRightRadius:F.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:F.borderSubtle,borderBottom:0,background:"#fff"},children:(0,q.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,q.jsx)(X,{color:"#662582",size:32,children:(0,q.jsx)(P.Itr,{size:18})}),(0,q.jsxs)(c.A,{children:[(0,q.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Directory"}),(0,q.jsxs)(x.A,{variant:"body2",sx:{color:F.textPrimary,fontWeight:700},children:[null!==(t=null===He||void 0===He?void 0:He.Total)&&void 0!==t?t:0," total \xb7 ",Be.length," loaded"]})]})]}),(0,q.jsx)(u.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,q.jsx)(J.A,{value:ve,onChange:Se,onDebouncedChange:ye,placeholder:"Search customers (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:D("#662582"),"& fieldset":{borderColor:U("#662582"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#662582"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(G("#662582"))}}})})]})}),(0,q.jsx)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:F.radiusCard/8,borderBottomRightRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,overflow:"hidden",background:"#fff"},children:(0,q.jsx)(p.A,{ref:o,onScroll:e=>{const{scrollTop:t,scrollHeight:o,clientHeight:r}=e.currentTarget;t+r>=o-50&&Ee&&!Me&&Je()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:U("#662582"),borderRadius:8,"&:hover":{backgroundColor:"#662582"}},"&::-webkit-scrollbar-track":{backgroundColor:F.surfaceAlt}},children:(0,q.jsxs)(m.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,q.jsx)(g.A,{children:(0,q.jsxs)(A.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,q.jsx)(f.A,{children:"#"}),(0,q.jsx)(f.A,{children:"Customer"}),(0,q.jsx)(f.A,{children:"Contact"}),(0,q.jsx)(f.A,{children:"Address"}),(0,q.jsx)(f.A,{children:"Location"}),(0,q.jsx)(f.A,{align:"right",children:"Action"})]})}),(0,q.jsxs)(j.A,{children:[Le&&(0,q.jsx)(Z.r,{}),0!==(null===Be||void 0===Be?void 0:Be.length)||Le?null===Be||void 0===Be?void 0:Be.map(((e,t)=>(0,q.jsxs)(A.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(F.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:F.surfaceAlt}},children:[(0,q.jsx)(f.A,{children:(0,q.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F.textMuted},children:String(t+1+ee*O).padStart(2,"0")})}),(0,q.jsx)(f.A,{children:(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,q.jsx)(X,{color:"#662582",size:36,children:(0,q.jsx)(P.Azs,{size:18})}),(0,q.jsxs)(c.A,{children:[(0,q.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:e.firstname||"\u2014"}),(0,q.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:["ID #",e.customerid]})]})]})}),(0,q.jsx)(f.A,{children:(0,q.jsxs)(c.A,{children:[(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,q.jsx)(P.EZw,{size:12,color:F.textMuted}),(0,q.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:e.contactno||"\u2014"})]}),e.email&&(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:e.email})]})}),(0,q.jsx)(f.A,{sx:{maxWidth:280},children:(0,q.jsx)(b.A,{title:e.address||"",placement:"top",children:(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,q.jsx)(f.A,{children:e.suburb?(0,q.jsxs)(u.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:D("#10b981"),border:"1px solid ".concat(U("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,q.jsx)(P.gwi,{size:12})," ",e.suburb]}):(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted},children:"\u2014"})}),(0,q.jsx)(f.A,{align:"right",children:(0,q.jsx)(b.A,{title:"Edit customer",placement:"top",children:(0,q.jsx)(v.A,{size:"small",onClick:()=>{ie(e),setTimeout((()=>ae(!0)),0)},sx:{bgcolor:V("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(U("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},children:(0,q.jsx)(P.Yvo,{size:16})})})})]},e.customerid||"".concat(e.firstname,"-").concat(t)))):(0,q.jsx)(A.A,{children:(0,q.jsx)(f.A,{colSpan:6,sx:{py:6},children:(0,q.jsxs)(c.A,{alignItems:"center",spacing:1.5,children:[(0,q.jsx)(d.A,{sx:{width:64,height:64,bgcolor:V("#94a3b8"),color:F.textMuted},children:(0,q.jsx)(P.Itr,{size:28})}),(0,q.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:F.textPrimary},children:"No customers to show"}),(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:ve?"Try a different keyword.":"Pick a zone above to load the directory."})]})})}),0!==(null===Be||void 0===Be?void 0:Be.length)&&(0,q.jsx)(A.A,{children:(0,q.jsx)(f.A,{colSpan:6,sx:{borderBottom:"none"},children:(0,q.jsx)("div",{ref:Y,style:{height:40,textAlign:"center"},children:Me||Ee?(0,q.jsx)(l.A,{}):(0,q.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted,fontWeight:600},children:"No more customers"})})})})]})]})})}),(0,q.jsxs)(S.A,{open:le,onClose:()=>ae(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"lg",fullWidth:!0,children:[(0,q.jsx)(w.A,{id:"alert-dialog-title",sx:{background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"#fff",py:2},children:(0,q.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,q.jsx)(d.A,{sx:{width:36,height:36,bgcolor:"rgba(255,255,255,0.2)",color:"#fff"},children:(0,q.jsx)(i.wwX,{style:{fontSize:18}})}),(0,q.jsxs)(c.A,{children:[(0,q.jsx)(x.A,{sx:{fontSize:11,fontWeight:700,opacity:.85,letterSpacing:.6,textTransform:"uppercase",lineHeight:1},children:"Customer"}),(0,q.jsxs)(x.A,{sx:{fontWeight:800,fontSize:{xs:"1.05rem",sm:"1.2rem"},lineHeight:1.2,mt:.25},children:["Edit ",(null===ne||void 0===ne?void 0:ne.firstname)||"Customer"]})]})]})}),(0,q.jsx)(y.A,{children:(0,q.jsxs)(h.Ay,{container:!0,spacing:2,sx:{mt:2},children:[(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Customer Name"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,defaultValue:null===ne||void 0===ne?void 0:ne.firstname,onChange:e=>{ie((0,r.A)((0,r.A)({},ne),{},{firstname:e.target.value}))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Contact Number"}),(0,q.jsxs)(c.A,{direction:"row",spacing:1,children:[(0,q.jsx)(k.A,{readonly:!0,variant:"outlined",value:"+91",sx:{width:60}}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,type:"text",value:(null===ne||void 0===ne?void 0:ne.contactno)||"",inputProps:{maxLength:10,inputMode:"numeric",pattern:"[0-9]*"},onChange:e=>{const t=e.target.value.replace(/\D/g,"");ie((e=>(0,r.A)((0,r.A)({},e),{},{contactno:t})))}})]})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:12,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Address"}),(0,q.jsx)(C.A,{id:"google-map-demo",sx:{},fullWidth:!0,getOptionLabel:e=>"string"===typeof e?e:(null===e||void 0===e?void 0:e.description)||"",filterOptions:e=>e,options:Pe,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:null===ne||void 0===ne?void 0:ne.address,noOptionsText:"No locations",onChange:(e,t)=>{Te(t?[t,...Pe]:Pe),Ce(t),console.log("newValue",t||""),ce(null===t||void 0===t?void 0:t.description),ie((0,r.A)((0,r.A)({},ne),{},{address:null===t||void 0===t?void 0:t.description}))},onInputChange:(e,t)=>{Re(t)},renderInput:e=>(0,q.jsx)(k.A,(0,r.A)((0,r.A)({},e),{},{fullWidth:!0})),renderOption:(e,t)=>{const o=t.structured_formatting.main_text_matched_substrings||[],s=I()(t.structured_formatting.main_text,o.map((e=>[e.offset,e.offset+e.length])));return(0,q.jsx)("li",(0,r.A)((0,r.A)({},e),{},{children:(0,q.jsxs)(h.Ay,{container:!0,alignItems:"center",children:[(0,q.jsx)(h.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,q.jsx)(z.A,{sx:{color:"text.secondary"}})}),(0,q.jsxs)(h.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[null===s||void 0===s?void 0:s.map(((e,t)=>(0,q.jsx)(u.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,q.jsx)(x.A,{variant:"body2",color:"text.secondary",children:null===t||void 0===t?void 0:t.structured_formatting.secondary_text})]})]})}))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Location"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,value:null===ne||void 0===ne?void 0:ne.suburb,onChange:e=>{const t=e.target.value;ie((e=>(0,r.A)((0,r.A)({},e),{},{suburb:t})))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"City"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,value:ne.city||he||"",onChange:e=>{const t=e.target.value;ie((e=>(0,r.A)((0,r.A)({},e),{},{city:t})))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"State"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,value:ne.state||Ae||"",onChange:e=>{const t=e.target.value;ie((e=>(0,r.A)((0,r.A)({},e),{},{state:t})))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Postcode"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,value:""==me?ne.postcode:me,onChange:e=>{const t=e.target.value;ie((e=>(0,r.A)((0,r.A)({},e),{},{postcode:t})))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:12,children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Landmark"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,defaultValue:ne.landmark,onChange:e=>{ie((0,r.A)((0,r.A)({},ne),{},{landmark:e.target.value}))}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,sx:{cursor:"not-allowed"},children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Latitude"}),(0,q.jsx)(k.A,{variant:"outlined",fullWidth:!0,value:xe.lat,sx:{cursor:"not-allowed"}})]}),(0,q.jsxs)(h.Ay,{item:!0,xs:6,sx:{cursor:"not-allowed"},children:[(0,q.jsx)(x.A,{sx:{mb:1},children:"Longitude"}),(0,q.jsx)(k.A,{readonly:!0,variant:"outlined",fullWidth:!0,value:xe.lng})]})]})}),(0,q.jsxs)(W.A,{sx:{mr:2,mb:2},children:[(0,q.jsx)(R.A,{onClick:()=>ae(!1),variant:"contained",color:"error",sx:{mr:2},children:"Close"}),(0,q.jsx)(R.A,{onClick:()=>{(async()=>{if(console.log("selectedCustomer",ne),ne.firstname)if(ne.contactno)if(ne.address)if(ne.suburb)if(ne.city)if(ne.state)if(ne.postcode)if(ne.landmark)if(ne.latitude)if(ne.longitude)try{const e=await n.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/customers/update"),{customerid:ne.customerid,configid:1,firstname:ne.firstname,applocationid:ne.applocationid,profileimage:"",dialcode:"+91",contactno:ne.contactno,devicetype:"",deviceid:"",customertoken:"123",address:ne.address,suburb:je,city:he,state:Ae,postcode:me,landmark:ne.landmark,doorno:ne.doorno,latitude:ne.latitude.toString(),longitude:ne.longitude.toString()});console.log("postUpdateResponse",e),e.data.status&&((0,K.k)(e.data.message,"success",1500),ae(!1),Ne())}catch(e){console.log("postUpdate error",e)}else(0,K.k)("Enter Longitude","warning",1500);else(0,K.k)("Enter Latitude","warning",1500);else(0,K.k)("Enter Landmark","warning",1500);else(0,K.k)("Enter PostCode","warning",1500);else(0,K.k)("Enter State","warning",1500);else(0,K.k)("Enter City ","warning",1500);else(0,K.k)("Enter Suburb","warning",1500);else(0,K.k)("Enter Valid Address","warning",1500);else(0,K.k)("Enter Contact Number ","warning",1500);else(0,K.k)("Enter Door NO","warning",1500)})()},variant:"contained",autoFocus:!0,children:"Update"})]})]})]})}},56311:(e,t,o)=>{o.d(t,{A:()=>h});var r=o(89379),s=o(9950),n=o(2660),i=o(2046),l=o(83274),a=o(25333),d=o(97125),c=o(7762),x=o(52097),u=o(44414);const h=e=>{let{value:t,onChange:o,onDebouncedChange:h,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:g}=e;const A=(0,s.useRef)(null),[f]=(0,x.d7)(t,p);return(0,s.useEffect)((()=>{h&&h(f)}),[f,h]),(0,s.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=A.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===A.current&&A.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,u.jsx)(n.A,{sx:(0,r.A)({},g),inputRef:A,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,u.jsx)(i.A,{position:"start",sx:{mr:-.5},children:(0,u.jsx)(d.A,{})}),endAdornment:(0,u.jsx)(l.A,{title:"Clear",children:(0,u.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>o(""),children:(0,u.jsx)(c.A,{})})})})}},58691:(e,t,o)=>{o.d(t,{A:()=>l});o(9950);var r=o(16491),s=o(46639),n=o(62217),i=o(44414);function l(e){let{size:t=70,imgSize:o=40,alt:l="loader"}=e;return(0,i.jsxs)(r.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(s.A,{size:t}),(0,i.jsx)(r.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:o,height:o},children:(0,i.jsx)("img",{src:n,alt:l,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,t,o)=>{o.d(t,{A:()=>u});var r=o(89379),s=o(9950),n=o(93230),i=o(41413),l=o(77922),a=o(29925),d=o(26910),c=o(31222),x=o(44414);const u=(0,s.forwardRef)(((e,t)=>{let{setAppId:o,setLocoName:u,setPage:h,sx:p,textfeildSx:m,textfieldSx:g,pill:A=!1,accentColor:f="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[S,w]=(0,s.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,s.useEffect)((()=>{0===S.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await d.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const y=e=>"".concat(f).concat(e),k=y("08"),C=y("26"),W=y("55"),R=y("18"),P=A?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:k,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:W,borderWidth:1.5},"&:hover fieldset":{borderColor:f},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:f,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:f}}:{},T=A&&(0,x.jsx)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(i.A,{sx:{width:24,height:24,bgcolor:R,color:f,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(c.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:S||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,r.A)({},p),onChange:(e,t,r)=>{"clear"===r?(null===o||void 0===o||o(0),null===u||void 0===u||u(""),null===h||void 0===h||h(0)):t&&(null===o||void 0===o||o(t.applocationid),null===u||void 0===u||u(t.locationname),null===h||void 0===h||h(0))},renderInput:e=>A?(0,x.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:T}),sx:(0,r.A)((0,r.A)({},P),g||m||{})})):(0,x.jsx)(a.A,(0,r.A)((0,r.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,r.A)({},g||m||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3MlRdsjSWycOA+VLv79YpY5Ork6V5efY59s/JJVHznH/+dMymLz7v0Rm71oWtK2GIDSJ7ew6kMxJlCjytI8u+Qddm4+93bPBIfqiiG96KG5RPouljokuZT3b/2avf7EB6ylsZ1dM2MsG5OfxU7RAFSWVbMAObUphRMTtsc7CpdMh6c3kqe8gN117Yh5W4627GljFmGZ+C/ynx/flzSkDPW2Aqj2+lV/Y5mj0tljG3/GFhQXspkLpnBJVx85yyq/OGWJPAANgzkd2/utOMXJzxp965vlF3YFrPRHZtYgSZq6vi/p2TT6VrF+1Vt8/yiRhnoLiIHAftc7h0kDzlp6HgYcfTAgVwmEPmIWzTeZxPEQaeWkkhJJk1eJk8vWLGBz75nBrAIqfmDrN2zhqjlsetGkftddKU6WQ2qPe6AZVuwdGPP9kWw4+ZWKnVXiVO6M4UXtR1rKDiZrm4g4J70871cTnMzzd3ESNn3bgz9mdgC7hmoufeKWuB4/c1QGV3nYfP7Msfy/FYB8rM1LC6YNm72lonXv+UTtEqr60qVLJTcbvEv8h20tfOhGZgeQtpBiZnZ6wnuhEUDFnlPMDhaSMCbNilohc0kp61mEW1y1j0u8hLR78Ff5xX3t2i5AHLjegvqOIdtHXK/8oorZRfGLiw3aJM1dkVeynA5kCsGm98cjLhNxh4O5nxEnoOJW4rQRkDRUF3adTNoAEprRRB7tfJ09zA7Qt3mGCCMz+dmioiLKcSRTjvGISw/kPbNcSDtzdLotDy6A+AyYObR4KCjK53ur3t2I+ct7s0b0Pfds4U04RuLV914z4rjJ4ZSc94sTSBrsShvYv62S76frZKwAYQ2orWpidoEExyh1tzPl6SlTpjhJ6v3u7Utcgm0vHf/wePKUc8TJS5E21LWu6gKbRBmalXwcgHp70yISg8QR3oTWWAWk3gtpbp6/cCiLRK8Y9k7jHzgCGh3n8om/ibpueHKr0vZT5lVZFvHItVWRaALVQ4pqxcYfL3opeoxcvlr3D4BVc4HU4eFFeMt0ZsHJvUzcFKPkY4gvW7YMGiC7ZfcicW723dalXUsS3lSyNeZcBUmsmaS/5p0Vlp4BVccADsvOYP6uAM/yKsqq7PkJmv8L4k7mmEu7DcRNIfIqkedu3qjq0pkzZ/DfITE5quZjp2Qxu0Dnha1iX1fdxD55fW/CNjANYN49s7jKI5O788E5kfY0oHZQcEuvT5GY8wbaye+//36MqsfY+JEjR6QlY1cX0CHvNdQmZ/JIZhUtjW3RzkNqsG90Hti2cS8fgGSoqz7Pp6loi/uH6wNnJ7zBNA0ZYvrdY1aMZ6hdGHQ9RuL473KmDBUnUB+zAyE1dP6me2fxpMUYljat3Zb0GfvJodWRRz9Aic/utw+Ts/NG1L/L0qQrCoRggVTXUGRPMULmNo44h0CflZXlcGiuXLPGdoDOo7Pw0EYpC5W/c9Wcfm3EoAGiSAF4h0QiQmtDmyUHKZAzZSSrPam/W5MgzJgUlo+CrgFSU1OT5GTOseKi7UytsT2GiJlqW1X5aB+IrJfCYXNDO7MDYwh1yA4kYvKMGTNkkcxw4ghjdJLfQ9ntJRcgWxqsFUCsqDzg1e0U5FtsEvfGVIQ4J9nv90fNXEhcgmPLyEAh49KJW4WZlzezYSE172BvjDbZhc5JPn78eH/nlpubK7e1tcWQtjtRaDXpnLHaYkRflTdbSEhN65V4a4Plclo/IC/TDyV9ixCnNJWFw2EpPT2dBcKBBtHA3+FndmCmjsueuJnIf8/0/mQq79UlDkdpV+LGOnxQ7aljOmFwBTjxY8eOSXV1day9vV1SlFCHaFB3wroT8sdZ+kE4QuXFDMkSG7+ucZmUxdmdqrbU9WpIINQuiPO5CM5x4pTVYMdTucbgt8ejjeutj3K8Tg0jaU2aMY4nJWYQKm+mLT7d7kUW2GrDwRmFFpD8Xax3xSUmZcUfPhL7L2yvp9XJTv7ijgAv4ltBPK8rHNRCPf00QzKVRzs8p7Y6YRktCqy99foMrWN73bsnWJ/ZmTGbUVlkADRFDUarlIYKZkKYeWUjUYSm+0sWmraFxHdTaTkRhtnI2bHwKBBUA3iwSv6LcxPnjV4dI6J5vV61W+04JM5X7LBG3Mwr9820oPLxZln+zsQpac6kkdG5QDLs+7AyetwRat0FTvqsLEpeJDBaTU2NQocqBXl1f9PnH4uGmN5ZcSpmqu41KSUvffwWy4UJIzCIxlQ2bj/ILxnX1mq6Tx0EJwrVKlVjNFF8NKasbMSIEeqgQYOUWl91W0gNlIvGu0oPJH2h31Ti/VNeqP8dJrm6KQnDYIp5erKwZpR2j9JTfrRldy1x4mZMCYwWk7mxiPjVixcvqt3d3WpKSopS6z/9J/GA3ZsOJZW6mRp640h2Pk1bsWhoBzAToLo8fhES0t4fo+YXoblhWZbDtOcaLa5FbZziGyc/ZMgQpaenJ7yz4b1DqhpuxDV492RSNxuYeF4cWF6yiNmB8OyJ1B3SFlFI1ZSGj2o3grjS2dnJSescYyswa9eu5cQ7OjpwE0YodLGn/jVxHVJPFNfNc21PQiKiSJEIxgGFZ49XfETfthk+HGiO9B08wsOHD8deNd4fJa7rPi6G09LSeINPm97cHFT9R3gHSOqlT25m8WCWXCRzYvMpqUmkFYBxQOHZYedmNXdj36Cp6LvOJdTc3KzS4oKqC5cjSlz3dvhRurq6Qh6PJ0SDETrefvQP4h54y76fYwhg+ffRjfeRCi/kkrx+0Q9oVSRx2SpRbI8S7+iVuAiP+KrCiK0bvozx5Idat68KBoMhCmNBcKFQrYC4KDQC0SqrfhIS56oeCASC5ORCh5o/Pz7aO279CE/Oo7hvG70EBYrCPrX26CzM+uoxh0hnUWYyJd4VmSihWvvJxkheX2uY1e0qPRij4q09TW98/Z8D59B3CmNBUnMFoVpMTgT6LigI44eqB2kwMNxBchJvk8ofFTdtempLTNi4XCCdjWcWqLwgrH3w0g4eCaBVq1/6Kb+GPrz3u+3Re31K95cfnHv1dfSZPDn6HoKq06qvqvVZPey3Po6RKSsr49cwVWWRwXE2+M7tyxs87VZZktNwsZJSWVRhJxTksMsFPgyY85MZbGrhBJqDe5kzxRGd20MjOlq6qNqawSOBWDcHaQhAQCG7Pty66+l29WKz0+n0k8ZCVQITJ04M7dy5U1m3bl0M8XjVFgyIizYP2ckgUpnBdJw6OeOHuYWZC191ys6o8WJtepHNNXMrgDeHE0MuALLG9Bc2bVTvsBo+v6/ls1+ebDv8Ham4j8IxZmPdtMEzhljvPCSKeMT5wmF2dra7sbExlY4H0QZJe4n82L7ksWRT/OJdl1yVtQqELHhvoyMjSZ//V4T0WbfbHSCnxklTxdhPxdMgaXjY6NSMBPtBX0ODikPqbto4eXpwKj0Y5MfMHHbzI6mOtJhADOkXLikY8AGA9JFA7S49FDMZCij+ih31bz3V2FPbqpOGlLH5aION94vfAnELi3qtHddBHJ7Hy3Sp0+YhO3Ivzl65Yrgn+wFjO3j82UumDcgAxCMMNPnPbdhc98a7LpcLThikYdOQNrdtcmhhKrD0U3GBZBVVieKfg5wdJJ+Smprq9fl8kH4qvdATCoVc+ekFo28YvvgVh0H1BWACWGLGBzpjLK7KoGSEGgC2Pl8wckDK/247+MrR1t2YL8N+IVmfThh7YdcKS/Cda1LiqFHRJufk5LioLuch8h6dvJfIpxB5aITzjtE/v32kZ/wDTpMBAJC+YkkKWmD8ktlHCQqKmrUnL7BWIh3vs23YcmPgu798Wv/Xz0CM3h2mdwd0wnwjn9QzatSoEJXKw1pEZeMTYxagq73w9FB7Suw8XlVVvaRi+A/yuO64bfR9t2eljL09xeEtYAOAQNhfcabrm9J/XtyGPIKn1Lp6B3X19tN6gJ/m29ymSUgKUlMzh2aEncUDmdRe1tXeaPce/dilbxgAOT99evbEQdOuHebJvsHrSC2gpec0Ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},96646:(e,t,o)=>{o.d(t,{r:()=>a});var r=o(9213),s=o(21671),n=o(82917),i=o(93230),l=o(44414);const a=e=>{let{rowsPerPage:t=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(r.A,{children:[(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,t)=>(0,l.jsx)(s.A,{children:(0,l.jsxs)(i.A,{spacing:.5,children:[(0,l.jsx)(n.A,{variant:"text",width:100}),(0,l.jsx)(n.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"text",width:150})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(n.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(s.A,{align:"center",children:(0,l.jsxs)(i.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(n.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(n.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); \ No newline at end of file diff --git a/build/static/js/9592.bfbbd05d.chunk.js b/build/static/js/9592.bfbbd05d.chunk.js new file mode 100644 index 0000000..8711966 --- /dev/null +++ b/build/static/js/9592.bfbbd05d.chunk.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9592],{855:(e,t,a)=>{a.d(t,{A:()=>l});var s=a(7208),n=a(76475),o=a(44414);function l(e){var t,a;let l,i,{children:r,type:c="scale",direction:d="right",offset:u=10,scale:p={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":l=u,i=0;break;default:l=0,i=u}const[m,h]=(0,s.Y)(l,i),[x,g]=(0,s.Y)(l,i);switch(c){case"rotate":return(0,o.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:r});case"slide":return"up"===d||"down"===d?(0,o.jsx)(n.P.div,{animate:{y:void 0!==x?x:""},onHoverEnd:()=>g(),onHoverStart:()=>g(),children:r}):(0,o.jsx)(n.P.div,{animate:{x:void 0!==m?m:""},onHoverEnd:()=>h(),onHoverStart:()=>h(),children:r});default:return"number"===typeof p&&(p={hover:p,tap:p}),(0,o.jsx)(n.P.div,{whileHover:{scale:null===(t=p)||void 0===t?void 0:t.hover},whileTap:{scale:null===(a=p)||void 0===a?void 0:a.tap},children:r})}}},20466:(e,t,a)=>{a.d(t,{k:()=>n});var s=a(8881);const n=(e,t,a)=>(0,s.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||2e3})},42041:()=>{},80987:(e,t,a)=>{a.r(t),a.d(t,{default:()=>me});var s=a(89379),n=a(9950),o=a(47223),l=a(16491),i=a(48089),r=a(82053),c=a(77922),d=a(29925),u=a(60899),p=a(82223),m=a(2046),h=a(25333),x=a(16497),g=a(93038),A=a(93230),f=a(37324),v=a(46639),j=a(40033),b=a(25979),y=a(2660),k=a(74745),S=a(28170),N=a(79739),w=a(96319),P=a(13838),C=a(54826),_=a(85527),I=a(43302),z=a(7762),D=a(28429),Y=a(63057),M=a(26910),L=a(14857),R=a(99459),W=a(52351),H=(a(172),a(50027),a(30633)),E=a(81831),F=a(95359),T=a(96583),O=a(4159),B=a.n(O),U=a(8881),q=a(60767),K=a(81419),V=a(3911),$=a(47738),Z=a(9845),G=a(87942),Q=a(76746),X=a(20466),J=a(98007),ee=a(99810),te=a(49029),ae=a(47113),se=a(82215),ne=a(2527),oe=a.n(ne),le=(a(55392),a(42041),a(855)),ie=a(44414),re=a(36220);B().extend(re);const ce="undefined"!==typeof window?new(oe().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,de="undefined"!==typeof window?new(oe().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,ue=e=>{let{startPoint:t,endPoint:a}=e;const s=(0,J.ko)();return(0,n.useEffect)((()=>{const e=[],n=parseFloat(null===t||void 0===t?void 0:t.latitude),o=parseFloat(null===t||void 0===t?void 0:t.longitude),l=parseFloat(null===a||void 0===a?void 0:a.latitude),i=parseFloat(null===a||void 0===a?void 0:a.longitude);isNaN(n)||isNaN(o)||0===n||0===o||e.push([n,o]),isNaN(l)||isNaN(i)||0===l||0===i||e.push([l,i]),1===e.length?s.setView(e[0],14):2===e.length&&s.fitBounds(e,{padding:[50,50]})}),[null===t||void 0===t?void 0:t.latitude,null===t||void 0===t?void 0:t.longitude,null===a||void 0===a?void 0:a.latitude,null===a||void 0===a?void 0:a.longitude,s]),null},pe=e=>{let{startPoint:t,endPoint:a,appLocaLat:s,appLocaLng:o}=e;const l=[parseFloat(s)||11.0168,parseFloat(o)||76.9558],i=(null===t||void 0===t?void 0:t.latitude)&&(null===t||void 0===t?void 0:t.longitude)&&0!==parseFloat(t.latitude),r=(null===a||void 0===a?void 0:a.latitude)&&(null===a||void 0===a?void 0:a.longitude)&&0!==parseFloat(a.latitude),c=i?[parseFloat(t.latitude),parseFloat(t.longitude)]:null,d=r?[parseFloat(a.latitude),parseFloat(a.longitude)]:null,[u,p]=n.useState([]);return n.useEffect((()=>{if(!i||!r)return void p([]);(async()=>{const e="https://router.project-osrm.org/route/v1/driving/".concat(t.longitude,",").concat(t.latitude,";").concat(a.longitude,",").concat(a.latitude,"?overview=full&geometries=geojson");try{var s;const t=await fetch(e),a=await t.json();if(null!==(s=a.routes)&&void 0!==s&&s.length){const e=a.routes[0].geometry.coordinates.map((e=>{let[t,a]=e;return[a,t]}));p(e)}else p([c,d])}catch(n){console.error("OSRM Error:",n),p([c,d])}})()}),[t.latitude,t.longitude,a.latitude,a.longitude,i,r]),(0,ie.jsx)("div",{style:{position:"relative",width:"100%",height:"100%"},children:(0,ie.jsxs)(ee.W,{center:l,zoom:12,style:{width:"100%",height:"100%"},zoomControl:!0,children:[(0,ie.jsx)(te.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),i&&(0,ie.jsx)(ae.p,{position:c,icon:ce}),r&&(0,ie.jsx)(ae.p,{position:d,icon:de}),u.length>0?(0,ie.jsx)(se.R,{positions:u,color:"#662582",weight:4}):i&&r&&(0,ie.jsx)(se.R,{positions:[c,d],color:"#662582",weight:4}),(0,ie.jsx)(ue,{startPoint:t,endPoint:a})]})})};const me=()=>{R.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const e=n.useRef(!1),t=(0,D.Zp)(),a=(0,L.A)(),O=(0,o.A)(a.breakpoints.down("md")),J=(0,n.useRef)(null),ee=(0,n.useRef)(null),[te,ae]=n.useState(""),[se,ne]=n.useState(""),[oe,re]=(0,n.useState)(localStorage.getItem("locationid")),[ce,de]=(0,n.useState)(!1),ue=(0,n.useRef)(null),me=(0,n.useRef)(null),he=(0,n.useRef)(null),[xe,ge]=(0,n.useState)(0),[Ae,fe]=(0,n.useState)(!1),[ve,je]=(0,n.useState)([]),[be,ye]=(0,n.useState)(B()().format("MM-DD-YYYY")),[ke,Se]=(0,n.useState)(),[Ne,we]=(0,n.useState)(),[Pe,Ce]=(0,n.useState)([]),[_e,Ie]=(0,n.useState)(""),[ze,De]=(0,n.useState)(!1),[Ye,Me]=(0,n.useState)(!1),[Le,Re]=(0,n.useState)(!1),[We,He]=(0,n.useState)(""),[Ee,Fe]=(0,n.useState)(),[Te,Oe]=(0,n.useState)({}),[Be,Ue]=(0,n.useState)(""),[qe,Ke]=(0,n.useState)([]),[Ve,$e]=(0,n.useState)({latitude:0,longitude:0}),[Ze,Ge]=(0,n.useState)({latitude:0,longitude:0}),[Qe,Xe]=(0,n.useState)(!1),[Je,et]=(0,n.useState)(0),[tt,at]=(0,n.useState)(0),[st,nt]=(0,n.useState)(0),[ot,lt]=(0,n.useState)(0),[it,rt]=(0,n.useState)(0),[ct,dt]=(0,n.useState)([]),[ut,pt]=(0,n.useState)("Select "),[mt,ht]=(0,n.useState)(0),[xt,gt]=(0,n.useState)(""),[At,ft]=(0,n.useState)(0),[vt,jt]=(0,n.useState)(0),[bt,yt]=(0,n.useState)(null),[kt,St]=(0,n.useState)(!1),[Nt,wt]=(0,n.useState)(""),[Pt,Ct]=(0,n.useState)([]),[_t,It]=(0,n.useState)(null),[zt,Dt]=(0,n.useState)(null),[Yt,Mt]=(0,n.useState)(null),[Lt,Rt]=(0,n.useState)(0),[Wt,Ht]=(0,n.useState)(0),[Et,Ft]=(0,n.useState)(0),[Tt,Ot]=(0,n.useState)([]),[Bt,Ut]=(0,n.useState)(),[qt,Kt]=(0,n.useState)(),[Vt,$t]=(0,n.useState)(),[Zt,Gt]=(0,n.useState)("Select Location"),Qt=localStorage.getItem("userid"),[Xt,Jt]=(0,n.useState)(0),[ea,ta]=(0,n.useState)(0),[aa,sa]=(0,n.useState)(0),[na,oa]=(0,n.useState)(0),[la,ia]=(0,n.useState)(),[ra,ca]=(0,n.useState)(),[da,ua]=(0,n.useState)(!1),[pa,ma]=(0,n.useState)(!1),[ha,xa]=(0,n.useState)(0),[ga,Aa]=(0,n.useState)(0),[fa,va]=(0,n.useState)(1),[ja,ba]=(0,n.useState)(null),[ya,ka]=(0,n.useState)(null),[Sa,Na]=(0,n.useState)(null),[wa,Pa]=(0,n.useState)(null),[Ca,_a]=(0,n.useState)(1),Ia=!!(null!==zt&&void 0!==zt&&zt.firstname&&null!==zt&&void 0!==zt&&zt.contactno&&10===String(zt.contactno).length&&null!==zt&&void 0!==zt&&zt.doorno&&null!==zt&&void 0!==zt&&zt.suburb&&null!==zt&&void 0!==zt&&zt.postcode);(0,n.useEffect)((()=>{console.log("pickupSlotsList",Sa),console.log("pickupSlot",wa)}),[Sa,wa]),"undefined"===typeof window||e.current||(document.querySelector("#google-maps")||function(e,t,a){if(!t)return;const s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("id",a),s.src=e,t.appendChild(s)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places&location=10.3656,77.9690&radius=50000&components=country:IN&strictbounds=true"),document.querySelector("head"),"google-maps"),e.current=!0);(0,n.useEffect)((()=>{(async()=>{try{const e=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(Qt));console.log("fetchAppLocations",e.data.details),Gt(e.data.details)}catch(e){console.log("locationRes",e)}})()}),[]);(0,n.useEffect)((()=>{xe&&(async()=>{Me(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(xe,"&status=active")).then((e=>{if(console.log(e),e.data.status){let t=[];e.data.details.map((e=>{t.push((0,s.A)((0,s.A)({},e),{},{label:"".concat(e.tenantname)}))})),Ke(t)}Me(!1)})).catch((e=>{console.log(e),Me(!1)}))})()}),[xe]);(0,n.useEffect)((()=>{console.log("startPoint",Ve),console.log("endPoint",Ze),0!=Ve.latitude&&0!=Ve.longitude&&0!=Ze.latitude&&0!=Ze.longitude&&za(Ve,Ze)}),[Ve,Ze]);const za=async(e,t)=>{try{const a=(1.3*((e,t,a,s)=>{const n=e=>e*Math.PI/180,o=n(a-e),l=n(s-t),i=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n(e))*Math.cos(n(a))*Math.sin(l/2)*Math.sin(l/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371})(e.latitude,e.longitude,t.latitude,t.longitude)).toFixed(2);console.log("distance in km ",a);const s=Math.round(a);if(console.log("roundedDistance",s),et(s),sVt&&(Xe(!0),fe(!0));const n=40,o=Math.round(s/n*60);console.log("Distance: ".concat(s,", Duration: ").concat(o))}catch(a){console.error("Error calculating distance:",a)}};(0,n.useEffect)((()=>{At&&Ma()}),[(null===Nt||void 0===Nt?void 0:Nt.length)>3,""==Nt,At]),(0,n.useEffect)((()=>{if(Pe[0]){let e=[];Pe.map((t=>{B()().diff(B()("".concat(B()(be).format("MM-DD-YYYY")," ").concat(B()(t).format("HH:mm:ss"))),"m")<=0&&e.push(t)}))}}),[Pe]);(0,n.useEffect)((()=>{At&&(async()=>{Me(!0),console.log("tenantid",At),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(At)).then((e=>{console.log("fetchtenantinfo",e),e.data.status&&(Oe(e.data.details),Da(),pt(e.data.details.subcategoryname),ht(e.data.details.subcategoryid)),Me(!1)})).catch((e=>{console.log(e),Me(!1)}))})()}),[At]);(0,n.useEffect)((()=>{(async()=>{await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getsubcategories/?moduleid=6")).then((e=>{console.log("subcateRes",e.data.details),e.data.status&&dt(e.data.details)})).catch((e=>{console.log(e)}))})()}),[]);(0,n.useEffect)((()=>{xe&&(async()=>{Me(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocations/?applocationid=").concat(xe)).then((e=>{console.log("fetchTiming",e);const{opentime:t,closetime:a,latitude:s,longitude:n,radius:o}=e.data.details[0];if(e.data.status){Ut(s),Kt(n),$t(o),console.log("radius",o),Se("".concat(B()().format("MM-DD-YYYY")," ").concat(t)),we("".concat(B()().format("MM-DD-YYYY")," ").concat(a)),console.log("starttime","".concat(B()().format("MM-DD-YYYY")," ").concat(t)),console.log("endtime","".concat(B()().format("MM-DD-YYYY")," ").concat(a," "));let e=[];for(let s="".concat(B()().format("MM-DD-YYYY")," ").concat(t),n=0;B()("".concat(B()().format("MM-DD-YYYY")," ").concat(a," ")).diff(s,"m")>=0;n++,s=B()(s).add(30,"m"))e.push(s);console.log("setTimeslotarr",e),Ce(e)}Me(!1)})).catch((e=>{console.log(e),Me(!1)}))})()}),[xe]);const Da=async()=>{Me(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(xe)).then((e=>{const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));e.data.status&&Fe(t),Me(!1)})).catch((e=>{console.log(e),Me(!1)}))};(0,n.useEffect)((()=>{ke&&Ne&&Da()}),[ke,Ne]);const Ya=(e,t,a)=>{(0,U.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||1500}),console.log(We)},Ma=async()=>{De(!0);try{let e=""==Nt?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(At,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(At,"&keyword=").concat(Nt);await M.A.get(e).then((e=>{e.data.status&&(console.log("clientdetails",e.data.details),je(e.data.details),Ct(e.data.details)),De(!1)})).catch((e=>{console.log(e),De(!1),Ya("server error","warning")}))}catch(e){console.log(e),De(!1)}},La=async()=>{Me(!0),await M.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:Ee,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully,kindly process the same",sound:"ring"}}).then((e=>{console.log(e),"Success"==e.data.message&&(0,U.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),Me(!1)})).catch((e=>{console.log(e),(0,U.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),Me(!1)}))};(0,n.useEffect)((()=>{if(te){const e=document.getElementById("addressAuto1"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(Bt,qt),radius:1e3*Vt}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();ae("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log(" pick (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),$e({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Dt((0,s.A)((0,s.A)({},zt),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),Dt((0,s.A)((0,s.A)({},zt),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.sublocality_level_1,city:a.locality,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Pick Address:",a)}))}}),[te]),(0,n.useEffect)((()=>{if(se){const e=document.getElementById("addressAuto2"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(Bt,qt),radius:1e3*Vt}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();ne("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log("drop (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),Ge({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Mt((0,s.A)((0,s.A)({},Yt),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),Mt((0,s.A)((0,s.A)({},Yt),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.sublocality_level_1,city:a.locality,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Drop Address:",a)}))}}),[se]);return(0,ie.jsxs)(ie.Fragment,{children:[Ye&&(0,ie.jsx)(W.A,{}),ze&&(0,ie.jsx)(W.A,{}),(0,ie.jsxs)(l.A,{className:"orders-workspace-bg",sx:{p:0,m:0,minHeight:"auto",display:"flex",flexDirection:"column"},children:[(0,ie.jsxs)(i.A,{className:"orders-card page-header-row",sx:{mb:{xs:1.5,sm:2},display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",gap:{xs:1.25,lg:2},px:{xs:1.75,sm:2},py:{xs:.75,sm:.9},flexShrink:0},children:[(0,ie.jsx)(l.A,{className:"header-title-block",sx:{display:"flex",flexDirection:"column",gap:0,minWidth:0,flex:{lg:"1 1 auto"}},children:(0,ie.jsx)(l.A,{sx:{display:"flex",alignItems:"center",gap:1},children:(0,ie.jsx)(r.A,{sx:{fontWeight:700,color:"#1e293b",lineHeight:1.15,fontSize:{xs:"17px",sm:"19px"}},children:"Create New Order"})})}),(0,ie.jsxs)(l.A,{className:"header-configurators",sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:{xs:"stretch",lg:"flex-end"},gap:1,p:0,width:{xs:"100%",lg:"auto"},flexShrink:0},children:[(0,ie.jsx)(l.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,ie.jsx)(c.A,{fullWidth:!0,autoFocus:!0,size:"small",ref:J,options:Zt||[],getOptionLabel:e=>"".concat(e.locationname),className:"header-compact-input",onChange:(e,t,a)=>{"clear"===a?(ge(0),ft(0),ba(null),Ke([]),jt(0),ka(null),Ot([]),Dt(null),Mt(null)):(ge(t.applocationid),Dt(null),Mt(null),ft(0),ba(null),jt(0),ka(null),Ot([]))},renderInput:e=>(0,ie.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(I.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,ie.jsx)(l.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,ie.jsx)(c.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:qe||[],value:ja,onOpen:e=>{xe||(e.preventDefault(),(0,X.k)("Please select a your location first!","warning",3e3),setTimeout((()=>{var e;null===(e=J.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"==a?(ft(0),ba(null),jt(0),ka(null),Ot([]),Dt(null),Mt(null)):(ft((null===t||void 0===t?void 0:t.tenantid)||0),ba(t),jt(0),ka(null),(async e=>{try{const t=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("pricingResponse",t.data.details),at(t.data.details.baseprice),nt(t.data.details.priceperkm),lt(t.data.details.minkm)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e));console.log("gettenantlocations",t.data.details),1==t.data.details.length?(Ot(t.data.details),It(t.data.details[0]),jt(t.data.details[0].locationid),ka(t.data.details[0].locationid),Na(t.data.details[0].slots)):Ot(t.data.details)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid),Mt(null))},renderInput:e=>(0,ie.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:ee,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(I.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,ie.jsx)(l.A,{sx:{width:{xs:"100%",sm:200,md:220,xl:240}},children:1==Tt.length?(0,ie.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:Tt[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:a.palette.primary.main},startAdornment:(0,ie.jsx)(G.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,ie.jsx)(c.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:ya,options:Tt||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,onOpen:e=>{xe||At?At||(e.preventDefault(),(0,X.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=ee.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,X.k)("Please select Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=J.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"===a?(jt(0),ka(null),Dt(null)):(jt(t.locationid||0),ka(t),It(t),Na(null===t||void 0===t?void 0:t.slots))},renderInput:e=>(0,ie.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Select Business Locations",label:"Business Location",color:"primary",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(G.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:{xs:2.5,sm:3,lg:4},children:[(0,ie.jsxs)(u.Ay,{item:!0,xs:12,lg:7.5,sx:{display:"flex",flexDirection:"column",gap:{xs:1.5,sm:1.75,lg:2}},children:[(0,ie.jsxs)(i.A,{className:"orders-card",sx:{p:{xs:1.25,sm:1.5,lg:1.5}},children:[(0,ie.jsxs)(l.A,{className:"route-stepper",children:[(0,ie.jsxs)(l.A,{className:"route-step ".concat(1===Ca?"is-active":""," ").concat(Ia?"is-done":""," step-pickup"),onClick:()=>_a(1),role:"button",tabIndex:0,children:[(0,ie.jsx)(l.A,{className:"route-step-index",children:Ia&&1!==Ca?(0,ie.jsx)(C.CMH,{}):"1"}),(0,ie.jsxs)(l.A,{className:"route-step-text",children:[(0,ie.jsx)(r.A,{className:"route-step-title",children:"Pickup"}),(0,ie.jsx)(r.A,{className:"route-step-sub",children:"Where to collect"})]})]}),(0,ie.jsxs)(l.A,{className:"route-step-connector ".concat(Ia?"is-done":""),children:[(0,ie.jsx)(l.A,{className:"route-step-line"}),(0,ie.jsx)(l.A,{className:"route-step-line-arrow",children:(0,ie.jsx)(C.Z0P,{})})]}),(0,ie.jsxs)(l.A,{className:"route-step ".concat(2===Ca?"is-active":""," step-drop ").concat(Ia?"":"is-locked"),onClick:()=>{Ia?_a(2):Ya("Please complete Pickup details first","warning",2e3)},role:"button",tabIndex:0,children:[(0,ie.jsx)(l.A,{className:"route-step-index",children:"2"}),(0,ie.jsxs)(l.A,{className:"route-step-text",children:[(0,ie.jsx)(r.A,{className:"route-step-title",children:"Drop"}),(0,ie.jsx)(r.A,{className:"route-step-sub",children:"Where to deliver"})]})]})]}),(0,ie.jsxs)(l.A,{className:"route-flow",children:[(0,ie.jsxs)(l.A,{className:"location-panel pickup-panel",sx:{display:1===Ca?"block":"none"},children:[(0,ie.jsxs)(l.A,{className:"lp-header",children:[(0,ie.jsxs)(l.A,{className:"lp-header-title",children:[(0,ie.jsx)(l.A,{className:"lp-badge",children:(0,ie.jsx)(I.sIY,{})}),(0,ie.jsxs)(l.A,{children:[(0,ie.jsx)(r.A,{className:"lp-title",children:"Pickup"}),(0,ie.jsx)(r.A,{className:"lp-subtitle",children:"Where to collect the parcel"})]})]}),(0,ie.jsx)(l.A,{className:"lp-header-actions",children:(0,ie.jsx)(p.A,{className:"lp-action-btn",size:"small",disabled:!vt,startIcon:(0,ie.jsx)(q.A,{style:{fontSize:13}}),onClick:()=>{xe||At||vt?xe||At?xe?(St(!0),Rt(1),Dt(null),ae(""),wt("")):(0,X.k)("Please select Location!","warning",3e3):(0,X.k)("Please select Location and Tenant!","warning",3e3):(0,X.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,ie.jsx)(r.A,{className:"field-group-caption",children:"Contact"}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{inputRef:ue,fullWidth:!0,size:"small",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Name",value:(null===zt||void 0===zt?void 0:zt.firstname)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{firstname:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{error:da,inputRef:me,fullWidth:!0,size:"small",type:"number",InputProps:{inputProps:{maxLength:10},startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(C.dRU,{style:{color:da?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Number",value:(null===zt||void 0===zt?void 0:zt.contactno)||"",onChange:e=>{e.target.value.length<=10&&Dt((0,s.A)((0,s.A)({},zt),{},{contactno:e.target.value})),la==e.target.value?sa(0):sa(1),e.target.value.length<10?ua(!0):ua(!1)}})})]}),(0,ie.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Wt?(0,ie.jsx)(d.A,{id:"addressAuto1",fullWidth:!0,size:"small",placeholder:"Search Google Maps for an address...",variant:"outlined",value:te||"",onChange:e=>ae(e.target.value),helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(q.A,{style:{fontSize:15,color:"#662582"}})}),endAdornment:(0,ie.jsx)(h.A,{onClick:()=>{ae(""),Dt((0,s.A)((0,s.A)({},zt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Xe(!1),$e({latitude:0,longitude:0})},size:"small",children:(0,ie.jsx)(w.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}):(0,ie.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.sIY,{style:{fontSize:14,color:"#662582"}})}),endAdornment:(0,ie.jsx)(h.A,{onClick:()=>{Ht(0),Dt((0,s.A)((0,s.A)({},zt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Xe(!1),$e({latitude:0,longitude:0})},size:"small",children:(0,ie.jsx)(z.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===zt||void 0===zt?void 0:zt.address)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{address:e.target.value})),""==e.target.value&&(Ht(0),Xe(!1),$e({latitude:0,longitude:0}))}}),(0,ie.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(_.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Door No / Street",value:(null===zt||void 0===zt?void 0:zt.doorno)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{doorno:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Location",value:(null===zt||void 0===zt?void 0:zt.suburb)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{suburb:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(Y.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Postcode",value:(null===zt||void 0===zt?void 0:zt.postcode)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{postcode:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Landmark",value:(null===zt||void 0===zt?void 0:zt.landmark)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{landmark:e.target.value}))}})})]}),1==aa&&(0,ie.jsx)(l.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,ie.jsx)(l.A,{className:"save-later-pill",children:(0,ie.jsx)(x.A,{control:(0,ie.jsx)(g.A,{size:"small",checked:1===Xt,onChange:e=>{Jt(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,ie.jsxs)(l.A,{className:"step-nav",children:[(0,ie.jsx)(r.A,{className:"step-nav-hint",children:Ia?"Pickup looks good. Proceed to Drop details.":"Fill the required Pickup fields to continue."}),(0,ie.jsx)(p.A,{className:"step-nav-btn step-nav-next",disabled:!Ia,endIcon:(0,ie.jsx)(C.Z0P,{style:{fontSize:12}}),onClick:()=>_a(2),children:"Continue to Drop"})]})]}),(0,ie.jsxs)(l.A,{className:"location-panel drop-panel",sx:{display:2===Ca?"block":"none"},children:[(0,ie.jsxs)(l.A,{className:"lp-header",children:[(0,ie.jsxs)(l.A,{className:"lp-header-title",children:[(0,ie.jsx)(l.A,{className:"lp-badge",children:(0,ie.jsx)(I.sIY,{})}),(0,ie.jsxs)(l.A,{children:[(0,ie.jsx)(r.A,{className:"lp-title",children:"Drop"}),(0,ie.jsx)(r.A,{className:"lp-subtitle",children:"Where to deliver the parcel"})]})]}),(0,ie.jsx)(l.A,{className:"lp-header-actions",children:(0,ie.jsx)(p.A,{className:"lp-action-btn",size:"small",disabled:!vt,startIcon:(0,ie.jsx)(q.A,{style:{fontSize:13}}),onClick:()=>{xe||At||vt?xe||At?xe?(St(!0),Rt(2),ne("")):(0,X.k)("Please select Location!","warning",3e3):(0,X.k)("Please select Location and Tenant!","warning",3e3):(0,X.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,ie.jsx)(r.A,{className:"field-group-caption",children:"Contact"}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{inputRef:he,fullWidth:!0,size:"small",variant:"outlined",label:"Contact Name",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.firstname)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{firstname:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{error:pa,fullWidth:!0,size:"small",type:"number",variant:"outlined",label:"Contact Number",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(C.dRU,{style:{color:pa?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.contactno)||"",onChange:e=>{e.target.value.length<=10&&Mt((0,s.A)((0,s.A)({},Yt),{},{contactno:e.target.value})),ra==e.target.value?oa(0):oa(1),e.target.value.length<10?ma(!0):ma(!1)}})})]}),(0,ie.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Et?(0,ie.jsx)(d.A,{id:"addressAuto2",placeholder:"Search Google Maps for an address...",variant:"outlined",size:"small",fullWidth:!0,value:se||"",onChange:e=>ne(e.target.value),helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(q.A,{style:{fontSize:15,color:"#65387a"}})}),endAdornment:(0,ie.jsx)(h.A,{onClick:()=>{ne(""),Mt((0,s.A)((0,s.A)({},Yt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Xe(!1),Ge({latitude:0,longitude:0})},size:"small",children:(0,ie.jsx)(w.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}):(0,ie.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.sIY,{style:{fontSize:14,color:"#65387a"}})}),endAdornment:(0,ie.jsx)(h.A,{onClick:()=>{Ft(0),Mt((0,s.A)((0,s.A)({},Yt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Xe(!1),Ge({latitude:0,longitude:0})},size:"small",children:(0,ie.jsx)(z.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===Yt||void 0===Yt?void 0:Yt.address)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{address:e.target.value})),""==e.target.value&&(Ft(0),Xe(!1),Ge({latitude:0,longitude:0}))}}),(0,ie.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Door No / Street",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(_.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.doorno)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{doorno:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Location",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.suburb)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{suburb:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Postcode",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(Y.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.postcode)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{postcode:e.target.value}))}})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Landmark",InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(I.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Yt||void 0===Yt?void 0:Yt.landmark)||"",onChange:e=>{Mt((0,s.A)((0,s.A)({},Yt),{},{landmark:e.target.value}))}})})]}),1==na&&(0,ie.jsx)(l.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,ie.jsx)(l.A,{className:"save-later-pill",children:(0,ie.jsx)(x.A,{control:(0,ie.jsx)(g.A,{size:"small",checked:1===ea,onChange:e=>{ta(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,ie.jsxs)(l.A,{className:"step-nav",children:[(0,ie.jsx)(p.A,{className:"step-nav-btn step-nav-back",startIcon:(0,ie.jsx)(C.QVr,{style:{fontSize:12}}),onClick:()=>_a(1),children:"Back to Pickup"}),(0,ie.jsx)(r.A,{className:"step-nav-hint",children:"Review the route below once Drop is filled."})]})]})]})]}),(0,ie.jsxs)(i.A,{className:"orders-card",sx:{p:{xs:1.5,sm:1.75,lg:2}},children:[(0,ie.jsx)(l.A,{className:"section-title-bar",sx:{mb:1.25},children:(0,ie.jsx)(r.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:"15px",letterSpacing:"-0.01em"},children:"Cargo & Dispatch Logistics"})}),(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,alignItems:"stretch",children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sx:{pt:"0 !important"},children:(0,ie.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.25},children:[(0,ie.jsx)(r.A,{sx:{fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:"Cargo Details"}),(0,ie.jsx)(l.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,ie.jsx)(A.A,{children:(0,ie.jsx)(c.A,{id:"combo-box-demo",size:"small",options:ct,getOptionLabel:e=>(null===e||void 0===e?void 0:e.subcategoryname)||"",fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},renderInput:e=>(0,ie.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{label:"Category",size:"small",InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(C.TXh,{style:{color:"#94a3b8",fontSize:13,marginRight:6,marginLeft:2,flexShrink:0}}),e.InputProps.startAdornment]})})})),onChange:(e,t,a)=>{t?(console.log(t),pt(t.subcategoryname||""),ht(t.subcategoryid||0)):a&&(pt(null),ht(null))}})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,ie.jsx)(A.A,{children:(0,ie.jsx)(d.A,{type:"number",size:"small",value:ga,fullWidth:!0,label:"Cash Collect",InputLabelProps:{shrink:!0},onChange:e=>{Aa(e.target.value)},inputProps:{min:0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(l.A,{sx:{color:"#94a3b8",fontWeight:700,fontSize:14,lineHeight:1},children:"\u20b9"})})}})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,ie.jsx)(A.A,{children:(0,ie.jsx)(d.A,{type:"number",size:"small",value:fa,fullWidth:!0,label:"Quantity",InputLabelProps:{shrink:!0},onChange:e=>{va(e.target.value)},inputProps:{min:1},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(C.H5e,{style:{color:"#94a3b8",fontSize:14}})})}})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sx:{mt:.5,pb:0},children:(0,ie.jsxs)(l.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[(0,ie.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:.75,fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:[(0,ie.jsx)(K.A,{style:{fontSize:"11px",color:"#65387a"}}),"Schedule Details"]}),(0,ie.jsx)(l.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sx:{pt:"0px !important"},children:(0,ie.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(E.$,{dateAdapter:F.R,children:(0,ie.jsx)(H.l,{label:"Pickup Date",format:"DD-MM-YYYY",onChange:e=>{let t=B()().diff(B()("".concat(B()(e).format("YYYY-MM-DD"))),"d");if(Ue(""),t<=0){ye(e);let t=[];Pe.map((a=>{B()().diff(B()("".concat(B()(e).format("MM-DD-YYYY")," ").concat(B()(a).format("HH:mm:ss"))),"m")<=0&&t.push(a)}))}else He("choose Upcoming Date"),Ya("choose Upcoming Date","warning"),ye(NaN)},value:B()(be),sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(K.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingLeft:"10px"}}}},disablePast:!0})})}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,ie.jsx)(c.A,{size:"small",fullWidth:!0,options:Sa||[],sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},onChange:(e,t,a)=>{if("clear"!==a&&t){const e=B()(t.time,"HH:mm").format("hh:mm A");Ue(e);const a=B()("".concat(be," ").concat(e),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");Pa(a)}else Ue(null),Pa(null)},getOptionLabel:e=>e?"".concat(e.name," (").concat(B()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,ie.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{label:"Pickup Time Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(V.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})})]})]})]}),(0,ie.jsx)(u.Ay,{item:!0,xs:12,lg:4.5,sx:{position:{lg:"sticky"},top:{lg:"24px"},height:"fit-content"},children:(0,ie.jsxs)(A.A,{spacing:2,children:[(0,ie.jsxs)(i.A,{className:"orders-card",sx:{p:1.5,display:"flex",flexDirection:"column"},children:[(0,ie.jsxs)(r.A,{sx:{fontWeight:700,mb:1.25,display:"flex",alignItems:"center",gap:.75,color:"#1e293b",fontSize:"14px",letterSpacing:"-0.01em"},children:[(0,ie.jsx)(G.A,{sx:{color:"#662582",fontSize:16}}),"Live Route Preview"]}),(0,ie.jsx)("div",{className:"map-preview-wrapper",children:(0,ie.jsx)(pe,{startPoint:Ve,endPoint:Ze,appLocaLat:Bt,appLocaLng:qt})})]}),(0,ie.jsxs)(i.A,{className:"orders-card delivery-prefs-card",sx:{p:1.5},children:[(0,ie.jsxs)(l.A,{className:"delivery-prefs-header",children:[(0,ie.jsx)(r.A,{className:"delivery-prefs-title",children:"Delivery Preferences"}),(0,ie.jsx)(r.A,{className:"delivery-prefs-sub",children:"Customer notifications & dispatch instructions"})]}),(0,ie.jsxs)(l.A,{className:"delivery-prefs-row",children:[(0,ie.jsxs)(l.A,{className:"delivery-prefs-field",children:[(0,ie.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"dispatch-notes-input",children:[(0,ie.jsx)($.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,ie.jsx)(d.A,{id:"dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:_e,onChange:e=>Ie(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]}),(0,ie.jsxs)(l.A,{className:"sms-toggle-tile ".concat(1===ha?"is-active":""),onClick:()=>xa(1===ha?0:1),role:"button",tabIndex:0,children:[(0,ie.jsxs)(l.A,{className:"sms-toggle-left",children:[(0,ie.jsx)(l.A,{className:"sms-toggle-icon",children:(0,ie.jsx)(Z.A,{style:{fontSize:13}})}),(0,ie.jsxs)(l.A,{sx:{minWidth:0},children:[(0,ie.jsx)(r.A,{className:"sms-toggle-title",children:"SMS Updates"}),(0,ie.jsx)(r.A,{className:"sms-toggle-sub",children:"Auto-notify customer on dispatch & delivery"})]})]}),(0,ie.jsx)(f.A,{size:"small",checked:1===ha,onChange:e=>{e.stopPropagation(),xa(e.target.checked?1:0)}})]})]})]}),(0,ie.jsxs)(i.A,{className:"orders-card pricing-summary-card",children:[(0,ie.jsxs)(l.A,{className:"pricing-header",children:[(0,ie.jsx)(r.A,{className:"pricing-title",children:"Pricing & Dispatch"}),(0,ie.jsx)(r.A,{className:"pricing-subtitle",children:"Live cost estimate"})]}),(0,ie.jsxs)("div",{className:"price-metric-item",children:[(0,ie.jsxs)("div",{className:"price-metric-label",children:[(0,ie.jsx)("span",{className:"price-metric-icon icon-distance",children:(0,ie.jsx)(C.$Fg,{})}),(0,ie.jsx)("span",{children:"Delivery Distance"})]}),(0,ie.jsx)("div",{className:"price-metric-value ".concat(Qe?"highlight":""),children:Qe?"".concat(Je," km"):"\u2014"})]}),(0,ie.jsxs)("div",{className:"price-metric-item",children:[(0,ie.jsxs)("div",{className:"price-metric-label",children:[(0,ie.jsx)("span",{className:"price-metric-icon icon-base",children:(0,ie.jsx)(C.MxO,{})}),(0,ie.jsxs)("span",{children:["Base Fare",(0,ie.jsxs)("span",{className:"price-metric-sub",children:[" \xb7 ",ot," km"]})]})]}),(0,ie.jsx)("div",{className:"price-metric-value",children:tt?"\u20b9".concat(tt.toFixed(2)):"\u20b90.00"})]}),(0,ie.jsxs)("div",{className:"price-metric-item",children:[(0,ie.jsxs)("div",{className:"price-metric-label",children:[(0,ie.jsx)("span",{className:"price-metric-icon icon-rate",children:(0,ie.jsx)(C.YYR,{})}),(0,ie.jsx)("span",{children:"Rate per km"})]}),(0,ie.jsxs)("div",{className:"price-metric-value",children:[st?"\u20b9".concat(st.toFixed(2)):"\u20b90.00",(0,ie.jsx)("span",{className:"price-metric-unit",children:"/km"})]})]}),Qe&&(0,ie.jsxs)("div",{className:"total-charge-badge",children:[(0,ie.jsxs)("div",{className:"total-charge-left",children:[(0,ie.jsx)(C.wTh,{className:"total-charge-icon"}),(0,ie.jsx)("div",{className:"total-charge-label",children:"Total Delivery Charge"})]}),(0,ie.jsxs)("div",{className:"total-charge-val",children:["\u20b9",it.toFixed(2)]})]}),(0,ie.jsx)(l.A,{sx:{mt:1.5},children:(0,ie.jsx)(le.A,{children:(0,ie.jsx)(p.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!Qe||!Be||!wa,startIcon:!Le&&(0,ie.jsx)(C.Cer,{style:{fontSize:11}}),onClick:()=>{Me(!0),Re(!0),(async()=>{let e={};if(e={orders:{applocationid:Te.applolcationid,cancellled:"",categoryid:+Te.categoryid,configid:9,customerid:0==Xt&&+zt.customerid||0,deliveryaddress:Yt.address||"",deliverycharge:+it.toFixed(2)||0,deliverycity:Yt.city||"",deliverycontactno:Yt.contactno||"",deliverycustomer:Yt.firstname||"",deliveryid:0==ea&&+Yt.customerid||0,deliverylandmark:Yt.landmark||"",deliverylat:Yt.latitude.toString(),deliverylocation:Yt.suburb||"",deliverylocationid:Yt.deliverylocationid||0,deliverylong:Yt.longitude.toString(),deliverytime:"".concat(B()(be).format("YYYY-MM-DD")," ").concat(B()(Be.$d).format("HH:mm:ss")),deliverytype:"B",delivered:"",itemcount:1,kms:Je.toString()||0,locationid:+vt,moduleid:+Te.moduleid,orderamount:+it.toFixed(2)||0,ordercharges:0,orderdate:B()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:_e,orderstatus:"created",ordervalue:+it.toFixed(2)||0,partnerid:Te.partnerid,partneruserid:+Qt,paymentstatus:1,paymenttype:42,pickupaddress:zt.address||"",pickupcity:zt.city||"",pickupcontactno:zt.contactno||"",pickupcustomer:zt.firstname||"",pickuplandmark:zt.landmark||"",pickuplat:zt.latitude.toString()||"",pickuplocation:zt.suburb||"",pickuplocationid:zt.deliverylocationid||0,pickuplong:zt.longitude.toString()||"",smsdelivery:ha,subcategoryid:+mt,tenantid:Te.tenantid,collectionamt:+ga,quantity:+fa,weight:xt,pickupSlot:wa},pickup:{address:zt.address||"",applocationid:Te.applolcationid,city:zt.city||"",configid:1,contactno:zt.contactno||"",customertoken:"",customerid:0==Xt&&zt.customerid||0,devicetype:"",deviceid:"",dialcode:"+91",doorno:zt.doorno||"",email:zt.email||"",firstname:zt.firstname||"",landmark:zt.landmark||"",latitude:zt.latitude.toString()||"",longitude:zt.longitude.toString()||"",postcode:zt.postcode||"",primaryaddress:1,locationid:zt.deliverylocationid||0,profileimage:"",state:zt.state||"",suburb:zt.suburb||"",tenantid:Te.tenantid},drop:{address:Yt.address||"",applocationid:Te.applolcationid,city:Yt.city||"",configid:1,contactno:Yt.contactno||"",customertoken:"",customerid:0==ea&&Yt.customerid||0,devicetype:"",deviceid:"",locationid:Yt.deliverylocationid||0,dialcode:"+91",doorno:Yt.doorno||"",email:Yt.email||"",firstname:Yt.firstname||"",landmark:Yt.landmark||"",latitude:Yt.latitude.toString(),longitude:Yt.longitude.toString(),postcode:Yt.postcode||"",primaryaddress:1,profileimage:"",state:Yt.state||"",suburb:Yt.suburb||"",tenantid:Te.tenantid}},console.log("createsubmitobj2",e),zt.firstname)if(zt.contactno)if(10!=zt.contactno.length)Ya("Check Pickup Contact Number ","error",2e3);else if(zt.suburb)if(zt.city)if(zt.postcode)if(zt.landmark)if(Yt.firstname)if(Yt.contactno)if(10!==Yt.contactno.length)Ya("Check Drop Contact Number ","error",2e3);else if(Yt.suburb)if(Yt.city)if(Yt.postcode)if(Yt.landmark)if(Be)if(ht)try{const a=await M.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorder"),e);a.data.status?(console.log("createRes",a),(0,U.M8)("Order Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),Ee&&La(),t("/nearle/orders")):Ya("Error in creating orders","warning"),Me(!1)}catch(a){Ya(a.message,"warning"),console.log("createResErr",a)}else Ya("Choose SubCategory ","warning",2e3);else Ya("Choose deliverytime ","warning",2e3);else Ya("Enter Drop Landmark ","warning",2e3);else Ya("Enter Drop postcode ","warning",2e3);else Ya("Enter Drop City ","warning",2e3);else Ya("Enter Drop Suburb ","warning",2e3);else Ya("Enter Drop Contact Number","warning",2e3);else Ya("Enter Drop Contact Name ","warning",2e3);else Ya("Enter Pickup Landmark ","warning",2e3);else Ya("Enter Pickup Postcode ","warning",2e3);else Ya("Enter Pickup City ","warning",2e3);else Ya("Enter Pickup Location ","warning",2e3);else Ya("Enter Pickup Contact Number ","warning",2e3);else Ya("Enter Pickup Contact Name ","warning",2e3)})(),setTimeout((()=>{Me(!1),Re(!1)}),2e3)},children:Le?(0,ie.jsx)(v.A,{color:"inherit",size:16,thickness:5}):"Dispatch Delivery Order"})})})]})]})})]})]}),(0,ie.jsxs)(T.A,{open:kt,onClose:()=>{St(!1),wt("")},fullWidth:!0,fullScreen:O,sx:{"& .MuiDialog-paper":{borderRadius:{xs:0,sm:"16px"},overflow:"hidden"}},children:[(0,ie.jsx)(j.A,{sx:{background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"white",py:2.5},children:(0,ie.jsxs)(A.A,{spacing:1.5,children:[(0,ie.jsx)(r.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Saved Address (".concat(1===Lt?"Pickup":"Drop",")")}),(0,ie.jsx)(b.A,{sx:{width:"100%"},children:(0,ie.jsx)(y.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address...",value:Nt,onChange:e=>wt(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,ie.jsx)(m.A,{position:"start",children:(0,ie.jsx)(q.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,ie.jsx)(h.A,{sx:{visibility:Nt?"visible":"hidden",p:.5},onClick:()=>{wt("")},children:(0,ie.jsx)(z.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,ie.jsx)(k.A,{}),(0,ie.jsx)(S.A,{sx:{p:3,maxHeight:"600px",overflowY:"auto",bgcolor:"#fafbfc"},children:0==(null===Pt||void 0===Pt?void 0:Pt.length)?(0,ie.jsx)(A.A,{spacing:2,direction:"row",alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,ie.jsx)(P.A,{description:"No saved addresses found for this client"})}):(0,ie.jsx)(l.A,{children:Pt&&Pt.map(((e,t)=>(0,ie.jsx)(p.A,{className:"address-card-btn",onClick:()=>{St(!1),wt(""),1===Lt?(console.log("PickupClient",e),Ht(1),$e({latitude:e.latitude,longitude:e.longitude}),Dt(e),ia(e.contactno)):(console.log("DropClient",e),Ft(1),Ge({latitude:e.latitude,longitude:e.longitude}),Mt(e),ca(e.contactno))},disabled:(null===zt||void 0===zt?void 0:zt.customerid)===e.customerid,children:(0,ie.jsxs)("div",{style:{width:"100%",display:"flex",flexDirection:"column"},children:[(0,ie.jsx)(r.A,{variant:"subtitle1",sx:{textAlign:"left",fontWeight:600,color:"#1e293b"},children:"".concat(e.firstname," (").concat(e.contactno,")")}),(0,ie.jsx)(r.A,{variant:"body2",sx:{textAlign:"left",color:"#64748b",mt:.5,lineHeight:1.4},children:e.address})]})},t)))})}),(0,ie.jsx)(k.A,{}),(0,ie.jsx)(N.A,{sx:{p:2.5,bgcolor:"#fafbfc"},children:(0,ie.jsx)(p.A,{color:"error",variant:"outlined",sx:{borderRadius:"8px",textTransform:"none",px:3,"&:hover":{bgcolor:"#ef4444",color:"white",borderColor:"#ef4444"}},onClick:()=>{St(!1),wt("")},children:"Cancel"})})]}),(0,ie.jsxs)(T.A,{open:Ae,onClose:()=>{fe(!1)},fullWidth:!0,sx:{"& .MuiDialog-paper":{borderRadius:{xs:3,sm:"16px"},p:1.5,m:{xs:1.5,sm:4},width:{xs:"calc(100% - 24px)",sm:"auto"},maxWidth:"400px"}},children:[(0,ie.jsxs)(j.A,{sx:{textAlign:"center",pb:1},children:[(0,ie.jsx)(Q.A,{sx:{fontSize:70,color:a.palette.error.main,mb:1}}),(0,ie.jsx)(r.A,{variant:"h3",sx:{color:a.palette.error.main,fontWeight:700},children:"Dispatch Blocked"})]}),(0,ie.jsx)(S.A,{sx:{textAlign:"center",pb:2},children:(0,ie.jsx)(r.A,{variant:"body1",sx:{color:"#64748b",lineHeight:1.5},children:"Our delivery partners cannot service this coordinate combination. The route distance exceeds the active operating radius for this app location."})}),(0,ie.jsx)(N.A,{sx:{bgcolor:a.palette.error.main,borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:600,color:"white",cursor:"pointer",py:1.5,mx:2.5,mb:2,transition:"background-color 0.2s ease","&:hover":{bgcolor:a.palette.error.dark}},onClick:()=>{fe(!1)},children:"Acknowledge & Close"})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/9592.f7bf6a2f.chunk.js b/build/static/js/9592.f7bf6a2f.chunk.js deleted file mode 100644 index da1a20d..0000000 --- a/build/static/js/9592.f7bf6a2f.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9592],{855:(e,t,a)=>{a.d(t,{A:()=>l});var s=a(7208),n=a(76475),o=a(44414);function l(e){var t,a;let l,i,{children:r,type:c="scale",direction:d="right",offset:u=10,scale:p={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":l=u,i=0;break;default:l=0,i=u}const[m,h]=(0,s.Y)(l,i),[x,g]=(0,s.Y)(l,i);switch(c){case"rotate":return(0,o.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:r});case"slide":return"up"===d||"down"===d?(0,o.jsx)(n.P.div,{animate:{y:void 0!==x?x:""},onHoverEnd:()=>g(),onHoverStart:()=>g(),children:r}):(0,o.jsx)(n.P.div,{animate:{x:void 0!==m?m:""},onHoverEnd:()=>h(),onHoverStart:()=>h(),children:r});default:return"number"===typeof p&&(p={hover:p,tap:p}),(0,o.jsx)(n.P.div,{whileHover:{scale:null===(t=p)||void 0===t?void 0:t.hover},whileTap:{scale:null===(a=p)||void 0===a?void 0:a.tap},children:r})}}},20466:(e,t,a)=>{a.d(t,{k:()=>n});var s=a(8881);const n=(e,t,a)=>(0,s.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||2e3})},42041:()=>{},80987:(e,t,a)=>{a.r(t),a.d(t,{default:()=>pe});var s=a(89379),n=a(9950),o=a(16491),l=a(48089),i=a(82053),r=a(77922),c=a(29925),d=a(60899),u=a(82223),p=a(2046),m=a(25333),h=a(16497),x=a(93038),g=a(93230),A=a(37324),f=a(46639),v=a(40033),j=a(25979),b=a(2660),y=a(74745),k=a(28170),S=a(79739),N=a(96319),w=a(13838),P=a(54826),C=a(85527),_=a(43302),I=a(7762),z=a(28429),D=a(63057),Y=a(26910),M=a(14857),L=a(99459),R=a(52351),W=(a(172),a(50027),a(30633)),H=a(81831),E=a(95359),F=a(96583),T=a(4159),O=a.n(T),B=a(8881),U=a(60767),q=a(81419),K=a(3911),V=a(47738),$=a(9845),Z=a(87942),G=a(76746),Q=a(20466),X=a(98007),J=a(99810),ee=a(49029),te=a(47113),ae=a(82215),se=a(2527),ne=a.n(se),oe=(a(55392),a(42041),a(855)),le=a(44414),ie=a(36220);O().extend(ie);const re="undefined"!==typeof window?new(ne().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,ce="undefined"!==typeof window?new(ne().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,de=e=>{let{startPoint:t,endPoint:a}=e;const s=(0,X.ko)();return(0,n.useEffect)((()=>{const e=[],n=parseFloat(null===t||void 0===t?void 0:t.latitude),o=parseFloat(null===t||void 0===t?void 0:t.longitude),l=parseFloat(null===a||void 0===a?void 0:a.latitude),i=parseFloat(null===a||void 0===a?void 0:a.longitude);isNaN(n)||isNaN(o)||0===n||0===o||e.push([n,o]),isNaN(l)||isNaN(i)||0===l||0===i||e.push([l,i]),1===e.length?s.setView(e[0],14):2===e.length&&s.fitBounds(e,{padding:[50,50]})}),[null===t||void 0===t?void 0:t.latitude,null===t||void 0===t?void 0:t.longitude,null===a||void 0===a?void 0:a.latitude,null===a||void 0===a?void 0:a.longitude,s]),null},ue=e=>{let{startPoint:t,endPoint:a,appLocaLat:s,appLocaLng:o}=e;const l=[parseFloat(s)||11.0168,parseFloat(o)||76.9558],i=(null===t||void 0===t?void 0:t.latitude)&&(null===t||void 0===t?void 0:t.longitude)&&0!==parseFloat(t.latitude),r=(null===a||void 0===a?void 0:a.latitude)&&(null===a||void 0===a?void 0:a.longitude)&&0!==parseFloat(a.latitude),c=i?[parseFloat(t.latitude),parseFloat(t.longitude)]:null,d=r?[parseFloat(a.latitude),parseFloat(a.longitude)]:null,[u,p]=n.useState([]);return n.useEffect((()=>{if(!i||!r)return void p([]);(async()=>{const e="https://router.project-osrm.org/route/v1/driving/".concat(t.longitude,",").concat(t.latitude,";").concat(a.longitude,",").concat(a.latitude,"?overview=full&geometries=geojson");try{var s;const t=await fetch(e),a=await t.json();if(null!==(s=a.routes)&&void 0!==s&&s.length){const e=a.routes[0].geometry.coordinates.map((e=>{let[t,a]=e;return[a,t]}));p(e)}else p([c,d])}catch(n){console.error("OSRM Error:",n),p([c,d])}})()}),[t.latitude,t.longitude,a.latitude,a.longitude,i,r]),(0,le.jsx)("div",{style:{position:"relative",width:"100%",height:"100%"},children:(0,le.jsxs)(J.W,{center:l,zoom:12,style:{width:"100%",height:"100%"},zoomControl:!0,children:[(0,le.jsx)(ee.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),i&&(0,le.jsx)(te.p,{position:c,icon:re}),r&&(0,le.jsx)(te.p,{position:d,icon:ce}),u.length>0?(0,le.jsx)(ae.R,{positions:u,color:"#662582",weight:4}):i&&r&&(0,le.jsx)(ae.R,{positions:[c,d],color:"#662582",weight:4}),(0,le.jsx)(de,{startPoint:t,endPoint:a})]})})};const pe=()=>{L.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8");const e=n.useRef(!1),t=(0,z.Zp)(),a=(0,M.A)(),T=(0,n.useRef)(null),X=(0,n.useRef)(null),[J,ee]=n.useState(""),[te,ae]=n.useState(""),[se,ne]=(0,n.useState)(localStorage.getItem("locationid")),[ie,re]=(0,n.useState)(!1),ce=(0,n.useRef)(null),de=(0,n.useRef)(null),pe=(0,n.useRef)(null),[me,he]=(0,n.useState)(0),[xe,ge]=(0,n.useState)(!1),[Ae,fe]=(0,n.useState)([]),[ve,je]=(0,n.useState)(O()().format("MM-DD-YYYY")),[be,ye]=(0,n.useState)(),[ke,Se]=(0,n.useState)(),[Ne,we]=(0,n.useState)([]),[Pe,Ce]=(0,n.useState)(""),[_e,Ie]=(0,n.useState)(!1),[ze,De]=(0,n.useState)(!1),[Ye,Me]=(0,n.useState)(!1),[Le,Re]=(0,n.useState)(""),[We,He]=(0,n.useState)(),[Ee,Fe]=(0,n.useState)({}),[Te,Oe]=(0,n.useState)(""),[Be,Ue]=(0,n.useState)([]),[qe,Ke]=(0,n.useState)({latitude:0,longitude:0}),[Ve,$e]=(0,n.useState)({latitude:0,longitude:0}),[Ze,Ge]=(0,n.useState)(!1),[Qe,Xe]=(0,n.useState)(0),[Je,et]=(0,n.useState)(0),[tt,at]=(0,n.useState)(0),[st,nt]=(0,n.useState)(0),[ot,lt]=(0,n.useState)(0),[it,rt]=(0,n.useState)([]),[ct,dt]=(0,n.useState)("Select "),[ut,pt]=(0,n.useState)(0),[mt,ht]=(0,n.useState)(""),[xt,gt]=(0,n.useState)(0),[At,ft]=(0,n.useState)(0),[vt,jt]=(0,n.useState)(null),[bt,yt]=(0,n.useState)(!1),[kt,St]=(0,n.useState)(""),[Nt,wt]=(0,n.useState)([]),[Pt,Ct]=(0,n.useState)(null),[_t,It]=(0,n.useState)(null),[zt,Dt]=(0,n.useState)(null),[Yt,Mt]=(0,n.useState)(0),[Lt,Rt]=(0,n.useState)(0),[Wt,Ht]=(0,n.useState)(0),[Et,Ft]=(0,n.useState)([]),[Tt,Ot]=(0,n.useState)(),[Bt,Ut]=(0,n.useState)(),[qt,Kt]=(0,n.useState)(),[Vt,$t]=(0,n.useState)("Select Location"),Zt=localStorage.getItem("userid"),[Gt,Qt]=(0,n.useState)(0),[Xt,Jt]=(0,n.useState)(0),[ea,ta]=(0,n.useState)(0),[aa,sa]=(0,n.useState)(0),[na,oa]=(0,n.useState)(),[la,ia]=(0,n.useState)(),[ra,ca]=(0,n.useState)(!1),[da,ua]=(0,n.useState)(!1),[pa,ma]=(0,n.useState)(0),[ha,xa]=(0,n.useState)(0),[ga,Aa]=(0,n.useState)(1),[fa,va]=(0,n.useState)(null),[ja,ba]=(0,n.useState)(null),[ya,ka]=(0,n.useState)(null),[Sa,Na]=(0,n.useState)(null),[wa,Pa]=(0,n.useState)(1),Ca=!!(null!==_t&&void 0!==_t&&_t.firstname&&null!==_t&&void 0!==_t&&_t.contactno&&10===String(_t.contactno).length&&null!==_t&&void 0!==_t&&_t.doorno&&null!==_t&&void 0!==_t&&_t.suburb&&null!==_t&&void 0!==_t&&_t.postcode);(0,n.useEffect)((()=>{console.log("pickupSlotsList",ya),console.log("pickupSlot",Sa)}),[ya,Sa]),"undefined"===typeof window||e.current||(document.querySelector("#google-maps")||function(e,t,a){if(!t)return;const s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("id",a),s.src=e,t.appendChild(s)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places&location=10.3656,77.9690&radius=50000&components=country:IN&strictbounds=true"),document.querySelector("head"),"google-maps"),e.current=!0);(0,n.useEffect)((()=>{(async()=>{try{const e=await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(Zt));console.log("fetchAppLocations",e.data.details),$t(e.data.details)}catch(e){console.log("locationRes",e)}})()}),[]);(0,n.useEffect)((()=>{me&&(async()=>{De(!0),await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(me,"&status=active")).then((e=>{if(console.log(e),e.data.status){let t=[];e.data.details.map((e=>{t.push((0,s.A)((0,s.A)({},e),{},{label:"".concat(e.tenantname)}))})),Ue(t)}De(!1)})).catch((e=>{console.log(e),De(!1)}))})()}),[me]);(0,n.useEffect)((()=>{console.log("startPoint",qe),console.log("endPoint",Ve),0!=qe.latitude&&0!=qe.longitude&&0!=Ve.latitude&&0!=Ve.longitude&&_a(qe,Ve)}),[qe,Ve]);const _a=async(e,t)=>{try{const a=(1.3*((e,t,a,s)=>{const n=e=>e*Math.PI/180,o=n(a-e),l=n(s-t),i=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n(e))*Math.cos(n(a))*Math.sin(l/2)*Math.sin(l/2);return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371})(e.latitude,e.longitude,t.latitude,t.longitude)).toFixed(2);console.log("distance in km ",a);const s=Math.round(a);if(console.log("roundedDistance",s),Xe(s),sqt&&(Ge(!0),ge(!0));const n=40,o=Math.round(s/n*60);console.log("Distance: ".concat(s,", Duration: ").concat(o))}catch(a){console.error("Error calculating distance:",a)}};(0,n.useEffect)((()=>{xt&&Da()}),[(null===kt||void 0===kt?void 0:kt.length)>3,""==kt,xt]),(0,n.useEffect)((()=>{if(Ne[0]){let e=[];Ne.map((t=>{O()().diff(O()("".concat(O()(ve).format("MM-DD-YYYY")," ").concat(O()(t).format("HH:mm:ss"))),"m")<=0&&e.push(t)}))}}),[Ne]);(0,n.useEffect)((()=>{xt&&(async()=>{De(!0),console.log("tenantid",xt),await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(xt)).then((e=>{console.log("fetchtenantinfo",e),e.data.status&&(Fe(e.data.details),Ia(),dt(e.data.details.subcategoryname),pt(e.data.details.subcategoryid)),De(!1)})).catch((e=>{console.log(e),De(!1)}))})()}),[xt]);(0,n.useEffect)((()=>{(async()=>{await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getsubcategories/?moduleid=6")).then((e=>{console.log("subcateRes",e.data.details),e.data.status&&rt(e.data.details)})).catch((e=>{console.log(e)}))})()}),[]);(0,n.useEffect)((()=>{me&&(async()=>{De(!0),await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocations/?applocationid=").concat(me)).then((e=>{console.log("fetchTiming",e);const{opentime:t,closetime:a,latitude:s,longitude:n,radius:o}=e.data.details[0];if(e.data.status){Ot(s),Ut(n),Kt(o),console.log("radius",o),ye("".concat(O()().format("MM-DD-YYYY")," ").concat(t)),Se("".concat(O()().format("MM-DD-YYYY")," ").concat(a)),console.log("starttime","".concat(O()().format("MM-DD-YYYY")," ").concat(t)),console.log("endtime","".concat(O()().format("MM-DD-YYYY")," ").concat(a," "));let e=[];for(let s="".concat(O()().format("MM-DD-YYYY")," ").concat(t),n=0;O()("".concat(O()().format("MM-DD-YYYY")," ").concat(a," ")).diff(s,"m")>=0;n++,s=O()(s).add(30,"m"))e.push(s);console.log("setTimeslotarr",e),we(e)}De(!1)})).catch((e=>{console.log(e),De(!1)}))})()}),[me]);const Ia=async()=>{De(!0),await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(me)).then((e=>{const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));e.data.status&&He(t),De(!1)})).catch((e=>{console.log(e),De(!1)}))};(0,n.useEffect)((()=>{be&&ke&&Ia()}),[be,ke]);const za=(e,t,a)=>{(0,B.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||1500}),console.log(Le)},Da=async()=>{Ie(!0);try{let e=""==kt?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(xt,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(xt,"&keyword=").concat(kt);await Y.A.get(e).then((e=>{e.data.status&&(console.log("clientdetails",e.data.details),fe(e.data.details),wt(e.data.details)),Ie(!1)})).catch((e=>{console.log(e),Ie(!1),za("server error","warning")}))}catch(e){console.log(e),Ie(!1)}},Ya=async()=>{De(!0),await Y.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:We,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully,kindly process the same",sound:"ring"}}).then((e=>{console.log(e),"Success"==e.data.message&&(0,B.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),De(!1)})).catch((e=>{console.log(e),(0,B.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),De(!1)}))};(0,n.useEffect)((()=>{if(J){const e=document.getElementById("addressAuto1"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(Tt,Bt),radius:1e3*qt}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();ee("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log(" pick (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),Ke({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),It((0,s.A)((0,s.A)({},_t),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),It((0,s.A)((0,s.A)({},_t),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.sublocality_level_1,city:a.locality,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Pick Address:",a)}))}}),[J]),(0,n.useEffect)((()=>{if(te){const e=document.getElementById("addressAuto2"),t=new window.google.maps.places.Autocomplete(e,{strictBounds:!0,bounds:new window.google.maps.Circle({center:new window.google.maps.LatLng(Tt,Bt),radius:1e3*qt}).getBounds()});t.addListener("place_changed",(()=>{const e=t.getPlace();ae("".concat(e.name,", ").concat(e.formatted_address)),console.log("new place",e),console.log("drop (new place) lat lng",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),$e({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Dt((0,s.A)((0,s.A)({},zt),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const a={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((t=>{switch(t){case"street_number":a.street_number=e.long_name;break;case"route":a.route=e.long_name;break;case"locality":a.locality=e.long_name;break;case"sublocality_level_1":a.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":a.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":a.administrative_area_level_1=e.long_name;break;case"country":a.country=e.long_name;break;case"postal_code":a.postal_code=e.long_name}}))})),Dt((0,s.A)((0,s.A)({},zt),{},{address:a.address,doorno:"".concat(a.street_number," ").concat(a.route),suburb:a.sublocality_level_1,city:a.locality,postcode:a.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()})),console.log("Drop Address:",a)}))}}),[te]);return(0,le.jsxs)(le.Fragment,{children:[ze&&(0,le.jsx)(R.A,{}),_e&&(0,le.jsx)(R.A,{}),(0,le.jsxs)(o.A,{className:"orders-workspace-bg",sx:{p:0,m:0,minHeight:"auto",display:"flex",flexDirection:"column"},children:[(0,le.jsxs)(l.A,{className:"orders-card page-header-row",sx:{mb:{xs:1.5,sm:2},display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",gap:{xs:1.25,lg:2},px:{xs:1.75,sm:2},py:{xs:.75,sm:.9},flexShrink:0},children:[(0,le.jsx)(o.A,{className:"header-title-block",sx:{display:"flex",flexDirection:"column",gap:0,minWidth:0,flex:{lg:"1 1 auto"}},children:(0,le.jsx)(o.A,{sx:{display:"flex",alignItems:"center",gap:1},children:(0,le.jsx)(i.A,{sx:{fontWeight:700,color:"#1e293b",lineHeight:1.15,fontSize:{xs:"17px",sm:"19px"}},children:"Create New Order"})})}),(0,le.jsxs)(o.A,{className:"header-configurators",sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:{xs:"stretch",lg:"flex-end"},gap:1,p:0,width:{xs:"100%",lg:"auto"},flexShrink:0},children:[(0,le.jsx)(o.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,le.jsx)(r.A,{fullWidth:!0,autoFocus:!0,size:"small",ref:T,options:Vt||[],getOptionLabel:e=>"".concat(e.locationname),className:"header-compact-input",onChange:(e,t,a)=>{"clear"===a?(he(0),gt(0),va(null),Ue([]),ft(0),ba(null),Ft([]),It(null),Dt(null)):(he(t.applocationid),It(null),Dt(null),gt(0),va(null),ft(0),ba(null),Ft([]))},renderInput:e=>(0,le.jsx)(c.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(_.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,le.jsx)(o.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,le.jsx)(r.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:Be||[],value:fa,onOpen:e=>{me||(e.preventDefault(),(0,Q.k)("Please select a your location first!","warning",3e3),setTimeout((()=>{var e;null===(e=T.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"==a?(gt(0),va(null),ft(0),ba(null),Ft([]),It(null),Dt(null)):(gt((null===t||void 0===t?void 0:t.tenantid)||0),va(t),ft(0),ba(null),(async e=>{try{const t=await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("pricingResponse",t.data.details),et(t.data.details.baseprice),at(t.data.details.priceperkm),nt(t.data.details.minkm)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=await Y.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e));console.log("gettenantlocations",t.data.details),1==t.data.details.length?(Ft(t.data.details),Ct(t.data.details[0]),ft(t.data.details[0].locationid),ba(t.data.details[0].locationid),ka(t.data.details[0].slots)):Ft(t.data.details)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid),Dt(null))},renderInput:e=>(0,le.jsx)(c.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:X,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(_.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,le.jsx)(o.A,{sx:{width:{xs:"100%",sm:200,md:220,xl:240}},children:1==Et.length?(0,le.jsx)(c.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:Et[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:a.palette.primary.main},startAdornment:(0,le.jsx)(Z.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,le.jsx)(r.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:ja,options:Et||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,onOpen:e=>{me||xt?xt||(e.preventDefault(),(0,Q.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=X.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,Q.k)("Please select Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=T.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"===a?(ft(0),ba(null),It(null)):(ft(t.locationid||0),ba(t),Ct(t),ka(null===t||void 0===t?void 0:t.slots))},renderInput:e=>(0,le.jsx)(c.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Select Business Locations",label:"Business Location",color:"primary",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Z.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,le.jsxs)(d.Ay,{container:!0,spacing:{xs:2.5,sm:3,lg:4},children:[(0,le.jsxs)(d.Ay,{item:!0,xs:12,lg:7.5,sx:{display:"flex",flexDirection:"column",gap:{xs:1.5,sm:1.75,lg:2}},children:[(0,le.jsxs)(l.A,{className:"orders-card",sx:{p:{xs:1.25,sm:1.5,lg:1.5}},children:[(0,le.jsxs)(o.A,{className:"route-stepper",children:[(0,le.jsxs)(o.A,{className:"route-step ".concat(1===wa?"is-active":""," ").concat(Ca?"is-done":""," step-pickup"),onClick:()=>Pa(1),role:"button",tabIndex:0,children:[(0,le.jsx)(o.A,{className:"route-step-index",children:Ca&&1!==wa?(0,le.jsx)(P.CMH,{}):"1"}),(0,le.jsxs)(o.A,{className:"route-step-text",children:[(0,le.jsx)(i.A,{className:"route-step-title",children:"Pickup"}),(0,le.jsx)(i.A,{className:"route-step-sub",children:"Where to collect"})]})]}),(0,le.jsxs)(o.A,{className:"route-step-connector ".concat(Ca?"is-done":""),children:[(0,le.jsx)(o.A,{className:"route-step-line"}),(0,le.jsx)(o.A,{className:"route-step-line-arrow",children:(0,le.jsx)(P.Z0P,{})})]}),(0,le.jsxs)(o.A,{className:"route-step ".concat(2===wa?"is-active":""," step-drop ").concat(Ca?"":"is-locked"),onClick:()=>{Ca?Pa(2):za("Please complete Pickup details first","warning",2e3)},role:"button",tabIndex:0,children:[(0,le.jsx)(o.A,{className:"route-step-index",children:"2"}),(0,le.jsxs)(o.A,{className:"route-step-text",children:[(0,le.jsx)(i.A,{className:"route-step-title",children:"Drop"}),(0,le.jsx)(i.A,{className:"route-step-sub",children:"Where to deliver"})]})]})]}),(0,le.jsxs)(o.A,{className:"route-flow",children:[(0,le.jsxs)(o.A,{className:"location-panel pickup-panel",sx:{display:1===wa?"block":"none"},children:[(0,le.jsxs)(o.A,{className:"lp-header",children:[(0,le.jsxs)(o.A,{className:"lp-header-title",children:[(0,le.jsx)(o.A,{className:"lp-badge",children:(0,le.jsx)(_.sIY,{})}),(0,le.jsxs)(o.A,{children:[(0,le.jsx)(i.A,{className:"lp-title",children:"Pickup"}),(0,le.jsx)(i.A,{className:"lp-subtitle",children:"Where to collect the parcel"})]})]}),(0,le.jsx)(o.A,{className:"lp-header-actions",children:(0,le.jsx)(u.A,{className:"lp-action-btn",size:"small",disabled:!At,startIcon:(0,le.jsx)(U.A,{style:{fontSize:13}}),onClick:()=>{me||xt||At?me||xt?me?(yt(!0),Mt(1),It(null),ee(""),St("")):(0,Q.k)("Please select Location!","warning",3e3):(0,Q.k)("Please select Location and Tenant!","warning",3e3):(0,Q.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,le.jsx)(i.A,{className:"field-group-caption",children:"Contact"}),(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{inputRef:ce,fullWidth:!0,size:"small",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Name",value:(null===_t||void 0===_t?void 0:_t.firstname)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{firstname:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{error:ra,inputRef:de,fullWidth:!0,size:"small",type:"number",InputProps:{inputProps:{maxLength:10},startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(P.dRU,{style:{color:ra?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Number",value:(null===_t||void 0===_t?void 0:_t.contactno)||"",onChange:e=>{e.target.value.length<=10&&It((0,s.A)((0,s.A)({},_t),{},{contactno:e.target.value})),na==e.target.value?ta(0):ta(1),e.target.value.length<10?ca(!0):ca(!1)}})})]}),(0,le.jsx)(i.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Lt?(0,le.jsx)(c.A,{id:"addressAuto1",fullWidth:!0,size:"small",placeholder:"Search Google Maps for an address...",variant:"outlined",value:J||"",onChange:e=>ee(e.target.value),helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(U.A,{style:{fontSize:15,color:"#662582"}})}),endAdornment:(0,le.jsx)(m.A,{onClick:()=>{ee(""),It((0,s.A)((0,s.A)({},_t),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Ge(!1),Ke({latitude:0,longitude:0})},size:"small",children:(0,le.jsx)(N.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}):(0,le.jsx)(c.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.sIY,{style:{fontSize:14,color:"#662582"}})}),endAdornment:(0,le.jsx)(m.A,{onClick:()=>{Rt(0),It((0,s.A)((0,s.A)({},_t),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Ge(!1),Ke({latitude:0,longitude:0})},size:"small",children:(0,le.jsx)(I.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===_t||void 0===_t?void 0:_t.address)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{address:e.target.value})),""==e.target.value&&(Rt(0),Ge(!1),Ke({latitude:0,longitude:0}))}}),(0,le.jsx)(i.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(C.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Door No / Street",value:(null===_t||void 0===_t?void 0:_t.doorno)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{doorno:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Location",value:(null===_t||void 0===_t?void 0:_t.suburb)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{suburb:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(D.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Postcode",value:(null===_t||void 0===_t?void 0:_t.postcode)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{postcode:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Landmark",value:(null===_t||void 0===_t?void 0:_t.landmark)||"",onChange:e=>{It((0,s.A)((0,s.A)({},_t),{},{landmark:e.target.value}))}})})]}),1==ea&&(0,le.jsx)(o.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,le.jsx)(o.A,{className:"save-later-pill",children:(0,le.jsx)(h.A,{control:(0,le.jsx)(x.A,{size:"small",checked:1===Gt,onChange:e=>{Qt(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,le.jsxs)(o.A,{className:"step-nav",children:[(0,le.jsx)(i.A,{className:"step-nav-hint",children:Ca?"Pickup looks good. Proceed to Drop details.":"Fill the required Pickup fields to continue."}),(0,le.jsx)(u.A,{className:"step-nav-btn step-nav-next",disabled:!Ca,endIcon:(0,le.jsx)(P.Z0P,{style:{fontSize:12}}),onClick:()=>Pa(2),children:"Continue to Drop"})]})]}),(0,le.jsxs)(o.A,{className:"location-panel drop-panel",sx:{display:2===wa?"block":"none"},children:[(0,le.jsxs)(o.A,{className:"lp-header",children:[(0,le.jsxs)(o.A,{className:"lp-header-title",children:[(0,le.jsx)(o.A,{className:"lp-badge",children:(0,le.jsx)(_.sIY,{})}),(0,le.jsxs)(o.A,{children:[(0,le.jsx)(i.A,{className:"lp-title",children:"Drop"}),(0,le.jsx)(i.A,{className:"lp-subtitle",children:"Where to deliver the parcel"})]})]}),(0,le.jsx)(o.A,{className:"lp-header-actions",children:(0,le.jsx)(u.A,{className:"lp-action-btn",size:"small",disabled:!At,startIcon:(0,le.jsx)(U.A,{style:{fontSize:13}}),onClick:()=>{me||xt||At?me||xt?me?(yt(!0),Mt(2),ae("")):(0,Q.k)("Please select Location!","warning",3e3):(0,Q.k)("Please select Location and Tenant!","warning",3e3):(0,Q.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,le.jsx)(i.A,{className:"field-group-caption",children:"Contact"}),(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{inputRef:pe,fullWidth:!0,size:"small",variant:"outlined",label:"Contact Name",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.firstname)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{firstname:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{error:da,fullWidth:!0,size:"small",type:"number",variant:"outlined",label:"Contact Number",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(P.dRU,{style:{color:da?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.contactno)||"",onChange:e=>{e.target.value.length<=10&&Dt((0,s.A)((0,s.A)({},zt),{},{contactno:e.target.value})),la==e.target.value?sa(0):sa(1),e.target.value.length<10?ua(!0):ua(!1)}})})]}),(0,le.jsx)(i.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Wt?(0,le.jsx)(c.A,{id:"addressAuto2",placeholder:"Search Google Maps for an address...",variant:"outlined",size:"small",fullWidth:!0,value:te||"",onChange:e=>ae(e.target.value),helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(U.A,{style:{fontSize:15,color:"#65387a"}})}),endAdornment:(0,le.jsx)(m.A,{onClick:()=>{ae(""),Dt((0,s.A)((0,s.A)({},zt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Ge(!1),$e({latitude:0,longitude:0})},size:"small",children:(0,le.jsx)(N.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}):(0,le.jsx)(c.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.sIY,{style:{fontSize:14,color:"#65387a"}})}),endAdornment:(0,le.jsx)(m.A,{onClick:()=>{Ht(0),Dt((0,s.A)((0,s.A)({},zt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),Ge(!1),$e({latitude:0,longitude:0})},size:"small",children:(0,le.jsx)(I.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===zt||void 0===zt?void 0:zt.address)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{address:e.target.value})),""==e.target.value&&(Ht(0),Ge(!1),$e({latitude:0,longitude:0}))}}),(0,le.jsx)(i.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Door No / Street",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(C.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.doorno)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{doorno:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Location",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.suburb)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{suburb:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Postcode",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(D.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.postcode)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{postcode:e.target.value}))}})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(c.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Landmark",InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(_.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===zt||void 0===zt?void 0:zt.landmark)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},zt),{},{landmark:e.target.value}))}})})]}),1==aa&&(0,le.jsx)(o.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,le.jsx)(o.A,{className:"save-later-pill",children:(0,le.jsx)(h.A,{control:(0,le.jsx)(x.A,{size:"small",checked:1===Xt,onChange:e=>{Jt(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,le.jsxs)(o.A,{className:"step-nav",children:[(0,le.jsx)(u.A,{className:"step-nav-btn step-nav-back",startIcon:(0,le.jsx)(P.QVr,{style:{fontSize:12}}),onClick:()=>Pa(1),children:"Back to Pickup"}),(0,le.jsx)(i.A,{className:"step-nav-hint",children:"Review the route below once Drop is filled."})]})]})]})]}),(0,le.jsxs)(l.A,{className:"orders-card",sx:{p:{xs:1.5,sm:1.75,lg:2}},children:[(0,le.jsx)(o.A,{className:"section-title-bar",sx:{mb:1.25},children:(0,le.jsx)(i.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:"15px",letterSpacing:"-0.01em"},children:"Cargo & Dispatch Logistics"})}),(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,alignItems:"stretch",children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sx:{pt:"0 !important"},children:(0,le.jsxs)(o.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.25},children:[(0,le.jsx)(i.A,{sx:{fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:"Cargo Details"}),(0,le.jsx)(o.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:4,children:(0,le.jsx)(g.A,{children:(0,le.jsx)(r.A,{id:"combo-box-demo",size:"small",options:it,getOptionLabel:e=>(null===e||void 0===e?void 0:e.subcategoryname)||"",fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},renderInput:e=>(0,le.jsx)(c.A,(0,s.A)((0,s.A)({},e),{},{label:"Category",size:"small",InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(P.TXh,{style:{color:"#94a3b8",fontSize:13,marginRight:6,marginLeft:2,flexShrink:0}}),e.InputProps.startAdornment]})})})),onChange:(e,t,a)=>{t?(console.log(t),dt(t.subcategoryname||""),pt(t.subcategoryid||0)):a&&(dt(null),pt(null))}})})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:4,children:(0,le.jsx)(g.A,{children:(0,le.jsx)(c.A,{type:"number",size:"small",value:ha,fullWidth:!0,label:"Cash Collect",InputLabelProps:{shrink:!0},onChange:e=>{xa(e.target.value)},inputProps:{min:0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(o.A,{sx:{color:"#94a3b8",fontWeight:700,fontSize:14,lineHeight:1},children:"\u20b9"})})}})})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:4,children:(0,le.jsx)(g.A,{children:(0,le.jsx)(c.A,{type:"number",size:"small",value:ga,fullWidth:!0,label:"Quantity",InputLabelProps:{shrink:!0},onChange:e=>{Aa(e.target.value)},inputProps:{min:1},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(P.H5e,{style:{color:"#94a3b8",fontSize:14}})})}})})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sx:{mt:.5,pb:0},children:(0,le.jsxs)(o.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[(0,le.jsxs)(i.A,{sx:{display:"flex",alignItems:"center",gap:.75,fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:[(0,le.jsx)(q.A,{style:{fontSize:"11px",color:"#65387a"}}),"Schedule Details"]}),(0,le.jsx)(o.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sx:{pt:"0px !important"},children:(0,le.jsxs)(d.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(H.$,{dateAdapter:E.R,children:(0,le.jsx)(W.l,{label:"Pickup Date",format:"DD-MM-YYYY",onChange:e=>{let t=O()().diff(O()("".concat(O()(e).format("YYYY-MM-DD"))),"d");if(Oe(""),t<=0){je(e);let t=[];Ne.map((a=>{O()().diff(O()("".concat(O()(e).format("MM-DD-YYYY")," ").concat(O()(a).format("HH:mm:ss"))),"m")<=0&&t.push(a)}))}else Re("choose Upcoming Date"),za("choose Upcoming Date","warning"),je(NaN)},value:O()(ve),sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(q.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingLeft:"10px"}}}},disablePast:!0})})}),(0,le.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,le.jsx)(r.A,{size:"small",fullWidth:!0,options:ya||[],sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},onChange:(e,t,a)=>{if("clear"!==a&&t){const e=O()(t.time,"HH:mm").format("hh:mm A");Oe(e);const a=O()("".concat(ve," ").concat(e),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");Na(a)}else Oe(null),Na(null)},getOptionLabel:e=>e?"".concat(e.name," (").concat(O()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,le.jsx)(c.A,(0,s.A)((0,s.A)({},e),{},{label:"Pickup Time Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(K.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})})]})]})]}),(0,le.jsx)(d.Ay,{item:!0,xs:12,lg:4.5,sx:{position:{lg:"sticky"},top:{lg:"24px"},height:"fit-content"},children:(0,le.jsxs)(g.A,{spacing:2,children:[(0,le.jsxs)(l.A,{className:"orders-card",sx:{p:1.5,display:"flex",flexDirection:"column"},children:[(0,le.jsxs)(i.A,{sx:{fontWeight:700,mb:1.25,display:"flex",alignItems:"center",gap:.75,color:"#1e293b",fontSize:"14px",letterSpacing:"-0.01em"},children:[(0,le.jsx)(Z.A,{sx:{color:"#662582",fontSize:16}}),"Live Route Preview"]}),(0,le.jsx)("div",{className:"map-preview-wrapper",children:(0,le.jsx)(ue,{startPoint:qe,endPoint:Ve,appLocaLat:Tt,appLocaLng:Bt})})]}),(0,le.jsxs)(l.A,{className:"orders-card delivery-prefs-card",sx:{p:1.5},children:[(0,le.jsxs)(o.A,{className:"delivery-prefs-header",children:[(0,le.jsx)(i.A,{className:"delivery-prefs-title",children:"Delivery Preferences"}),(0,le.jsx)(i.A,{className:"delivery-prefs-sub",children:"Customer notifications & dispatch instructions"})]}),(0,le.jsxs)(o.A,{className:"delivery-prefs-row",children:[(0,le.jsxs)(o.A,{className:"delivery-prefs-field",children:[(0,le.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"dispatch-notes-input",children:[(0,le.jsx)(V.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,le.jsx)(c.A,{id:"dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:Pe,onChange:e=>Ce(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]}),(0,le.jsxs)(o.A,{className:"sms-toggle-tile ".concat(1===pa?"is-active":""),onClick:()=>ma(1===pa?0:1),role:"button",tabIndex:0,children:[(0,le.jsxs)(o.A,{className:"sms-toggle-left",children:[(0,le.jsx)(o.A,{className:"sms-toggle-icon",children:(0,le.jsx)($.A,{style:{fontSize:13}})}),(0,le.jsxs)(o.A,{sx:{minWidth:0},children:[(0,le.jsx)(i.A,{className:"sms-toggle-title",children:"SMS Updates"}),(0,le.jsx)(i.A,{className:"sms-toggle-sub",children:"Auto-notify customer on dispatch & delivery"})]})]}),(0,le.jsx)(A.A,{size:"small",checked:1===pa,onChange:e=>{e.stopPropagation(),ma(e.target.checked?1:0)}})]})]})]}),(0,le.jsxs)(l.A,{className:"orders-card pricing-summary-card",children:[(0,le.jsxs)(o.A,{className:"pricing-header",children:[(0,le.jsx)(i.A,{className:"pricing-title",children:"Pricing & Dispatch"}),(0,le.jsx)(i.A,{className:"pricing-subtitle",children:"Live cost estimate"})]}),(0,le.jsxs)("div",{className:"price-metric-item",children:[(0,le.jsxs)("div",{className:"price-metric-label",children:[(0,le.jsx)("span",{className:"price-metric-icon icon-distance",children:(0,le.jsx)(P.$Fg,{})}),(0,le.jsx)("span",{children:"Delivery Distance"})]}),(0,le.jsx)("div",{className:"price-metric-value ".concat(Ze?"highlight":""),children:Ze?"".concat(Qe," km"):"\u2014"})]}),(0,le.jsxs)("div",{className:"price-metric-item",children:[(0,le.jsxs)("div",{className:"price-metric-label",children:[(0,le.jsx)("span",{className:"price-metric-icon icon-base",children:(0,le.jsx)(P.MxO,{})}),(0,le.jsxs)("span",{children:["Base Fare",(0,le.jsxs)("span",{className:"price-metric-sub",children:[" \xb7 ",st," km"]})]})]}),(0,le.jsx)("div",{className:"price-metric-value",children:Je?"\u20b9".concat(Je.toFixed(2)):"\u20b90.00"})]}),(0,le.jsxs)("div",{className:"price-metric-item",children:[(0,le.jsxs)("div",{className:"price-metric-label",children:[(0,le.jsx)("span",{className:"price-metric-icon icon-rate",children:(0,le.jsx)(P.YYR,{})}),(0,le.jsx)("span",{children:"Rate per km"})]}),(0,le.jsxs)("div",{className:"price-metric-value",children:[tt?"\u20b9".concat(tt.toFixed(2)):"\u20b90.00",(0,le.jsx)("span",{className:"price-metric-unit",children:"/km"})]})]}),Ze&&(0,le.jsxs)("div",{className:"total-charge-badge",children:[(0,le.jsxs)("div",{className:"total-charge-left",children:[(0,le.jsx)(P.wTh,{className:"total-charge-icon"}),(0,le.jsx)("div",{className:"total-charge-label",children:"Total Delivery Charge"})]}),(0,le.jsxs)("div",{className:"total-charge-val",children:["\u20b9",ot.toFixed(2)]})]}),(0,le.jsx)(o.A,{sx:{mt:1.5},children:(0,le.jsx)(oe.A,{children:(0,le.jsx)(u.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!Ze||!Te||!Sa,startIcon:!Ye&&(0,le.jsx)(P.Cer,{style:{fontSize:11}}),onClick:()=>{De(!0),Me(!0),(async()=>{let e={};if(e={orders:{applocationid:Ee.applolcationid,cancellled:"",categoryid:+Ee.categoryid,configid:9,customerid:0==Gt&&+_t.customerid||0,deliveryaddress:zt.address||"",deliverycharge:+ot.toFixed(2)||0,deliverycity:zt.city||"",deliverycontactno:zt.contactno||"",deliverycustomer:zt.firstname||"",deliveryid:0==Xt&&+zt.customerid||0,deliverylandmark:zt.landmark||"",deliverylat:zt.latitude.toString(),deliverylocation:zt.suburb||"",deliverylocationid:zt.deliverylocationid||0,deliverylong:zt.longitude.toString(),deliverytime:"".concat(O()(ve).format("YYYY-MM-DD")," ").concat(O()(Te.$d).format("HH:mm:ss")),deliverytype:"B",delivered:"",itemcount:1,kms:Qe.toString()||0,locationid:+At,moduleid:+Ee.moduleid,orderamount:+ot.toFixed(2)||0,ordercharges:0,orderdate:O()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:Pe,orderstatus:"created",ordervalue:+ot.toFixed(2)||0,partnerid:Ee.partnerid,partneruserid:+Zt,paymentstatus:1,paymenttype:42,pickupaddress:_t.address||"",pickupcity:_t.city||"",pickupcontactno:_t.contactno||"",pickupcustomer:_t.firstname||"",pickuplandmark:_t.landmark||"",pickuplat:_t.latitude.toString()||"",pickuplocation:_t.suburb||"",pickuplocationid:_t.deliverylocationid||0,pickuplong:_t.longitude.toString()||"",smsdelivery:pa,subcategoryid:+ut,tenantid:Ee.tenantid,collectionamt:+ha,quantity:+ga,weight:mt,pickupSlot:Sa},pickup:{address:_t.address||"",applocationid:Ee.applolcationid,city:_t.city||"",configid:1,contactno:_t.contactno||"",customertoken:"",customerid:0==Gt&&_t.customerid||0,devicetype:"",deviceid:"",dialcode:"+91",doorno:_t.doorno||"",email:_t.email||"",firstname:_t.firstname||"",landmark:_t.landmark||"",latitude:_t.latitude.toString()||"",longitude:_t.longitude.toString()||"",postcode:_t.postcode||"",primaryaddress:1,locationid:_t.deliverylocationid||0,profileimage:"",state:_t.state||"",suburb:_t.suburb||"",tenantid:Ee.tenantid},drop:{address:zt.address||"",applocationid:Ee.applolcationid,city:zt.city||"",configid:1,contactno:zt.contactno||"",customertoken:"",customerid:0==Xt&&zt.customerid||0,devicetype:"",deviceid:"",locationid:zt.deliverylocationid||0,dialcode:"+91",doorno:zt.doorno||"",email:zt.email||"",firstname:zt.firstname||"",landmark:zt.landmark||"",latitude:zt.latitude.toString(),longitude:zt.longitude.toString(),postcode:zt.postcode||"",primaryaddress:1,profileimage:"",state:zt.state||"",suburb:zt.suburb||"",tenantid:Ee.tenantid}},console.log("createsubmitobj2",e),_t.firstname)if(_t.contactno)if(10!=_t.contactno.length)za("Check Pickup Contact Number ","error",2e3);else if(_t.suburb)if(_t.city)if(_t.postcode)if(_t.landmark)if(zt.firstname)if(zt.contactno)if(10!==zt.contactno.length)za("Check Drop Contact Number ","error",2e3);else if(zt.suburb)if(zt.city)if(zt.postcode)if(zt.landmark)if(Te)if(pt)try{const a=await Y.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorder"),e);a.data.status?(console.log("createRes",a),(0,B.M8)("Order Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),We&&Ya(),t("/nearle/orders")):za("Error in creating orders","warning"),De(!1)}catch(a){za(a.message,"warning"),console.log("createResErr",a)}else za("Choose SubCategory ","warning",2e3);else za("Choose deliverytime ","warning",2e3);else za("Enter Drop Landmark ","warning",2e3);else za("Enter Drop postcode ","warning",2e3);else za("Enter Drop City ","warning",2e3);else za("Enter Drop Suburb ","warning",2e3);else za("Enter Drop Contact Number","warning",2e3);else za("Enter Drop Contact Name ","warning",2e3);else za("Enter Pickup Landmark ","warning",2e3);else za("Enter Pickup Postcode ","warning",2e3);else za("Enter Pickup City ","warning",2e3);else za("Enter Pickup Location ","warning",2e3);else za("Enter Pickup Contact Number ","warning",2e3);else za("Enter Pickup Contact Name ","warning",2e3)})(),setTimeout((()=>{De(!1),Me(!1)}),2e3)},children:Ye?(0,le.jsx)(f.A,{color:"inherit",size:16,thickness:5}):"Dispatch Delivery Order"})})})]})]})})]})]}),(0,le.jsxs)(F.A,{open:bt,onClose:()=>{yt(!1),St("")},fullWidth:!0,sx:{"& .MuiDialog-paper":{borderRadius:"16px",overflow:"hidden"}},children:[(0,le.jsx)(v.A,{sx:{background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"white",py:2.5},children:(0,le.jsxs)(g.A,{spacing:1.5,children:[(0,le.jsx)(i.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Saved Address (".concat(1===Yt?"Pickup":"Drop",")")}),(0,le.jsx)(j.A,{sx:{width:"100%"},children:(0,le.jsx)(b.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address...",value:kt,onChange:e=>St(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,le.jsx)(p.A,{position:"start",children:(0,le.jsx)(U.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,le.jsx)(m.A,{sx:{visibility:kt?"visible":"hidden",p:.5},onClick:()=>{St("")},children:(0,le.jsx)(I.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,le.jsx)(y.A,{}),(0,le.jsx)(k.A,{sx:{p:3,maxHeight:"600px",overflowY:"auto",bgcolor:"#fafbfc"},children:0==(null===Nt||void 0===Nt?void 0:Nt.length)?(0,le.jsx)(g.A,{spacing:2,direction:"row",alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,le.jsx)(w.A,{description:"No saved addresses found for this client"})}):(0,le.jsx)(o.A,{children:Nt&&Nt.map(((e,t)=>(0,le.jsx)(u.A,{className:"address-card-btn",onClick:()=>{yt(!1),St(""),1===Yt?(console.log("PickupClient",e),Rt(1),Ke({latitude:e.latitude,longitude:e.longitude}),It(e),oa(e.contactno)):(console.log("DropClient",e),Ht(1),$e({latitude:e.latitude,longitude:e.longitude}),Dt(e),ia(e.contactno))},disabled:(null===_t||void 0===_t?void 0:_t.customerid)===e.customerid,children:(0,le.jsxs)("div",{style:{width:"100%",display:"flex",flexDirection:"column"},children:[(0,le.jsx)(i.A,{variant:"subtitle1",sx:{textAlign:"left",fontWeight:600,color:"#1e293b"},children:"".concat(e.firstname," (").concat(e.contactno,")")}),(0,le.jsx)(i.A,{variant:"body2",sx:{textAlign:"left",color:"#64748b",mt:.5,lineHeight:1.4},children:e.address})]})},t)))})}),(0,le.jsx)(y.A,{}),(0,le.jsx)(S.A,{sx:{p:2.5,bgcolor:"#fafbfc"},children:(0,le.jsx)(u.A,{color:"error",variant:"outlined",sx:{borderRadius:"8px",textTransform:"none",px:3,"&:hover":{bgcolor:"#ef4444",color:"white",borderColor:"#ef4444"}},onClick:()=>{yt(!1),St("")},children:"Cancel"})})]}),(0,le.jsxs)(F.A,{open:xe,onClose:()=>{ge(!1)},sx:{"& .MuiDialog-paper":{borderRadius:"16px",p:1.5,maxWidth:"400px"}},children:[(0,le.jsxs)(v.A,{sx:{textAlign:"center",pb:1},children:[(0,le.jsx)(G.A,{sx:{fontSize:70,color:a.palette.error.main,mb:1}}),(0,le.jsx)(i.A,{variant:"h3",sx:{color:a.palette.error.main,fontWeight:700},children:"Dispatch Blocked"})]}),(0,le.jsx)(k.A,{sx:{textAlign:"center",pb:2},children:(0,le.jsx)(i.A,{variant:"body1",sx:{color:"#64748b",lineHeight:1.5},children:"Our delivery partners cannot service this coordinate combination. The route distance exceeds the active operating radius for this app location."})}),(0,le.jsx)(S.A,{sx:{bgcolor:a.palette.error.main,borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:600,color:"white",cursor:"pointer",py:1.5,mx:2.5,mb:2,transition:"background-color 0.2s ease","&:hover":{bgcolor:a.palette.error.dark}},onClick:()=>{ge(!1)},children:"Acknowledge & Close"})]})]})}}}]); \ No newline at end of file diff --git a/build/static/js/9912.3ab07d56.chunk.js b/build/static/js/9912.3ab07d56.chunk.js deleted file mode 100644 index 6bfeb9d..0000000 --- a/build/static/js/9912.3ab07d56.chunk.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9912],{8457:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALEAAABFCAYAAAAFKgfKAAAQE0lEQVR4Ae2dS4wcRxmA/6p5GLxEHiuHRILgtpx1wslrDjwuZDdcAduckTyrxOsIFNl7Q1HsnbVz4YC8IQoku4685sjFNnCMtGMuICTkzQWIdy23RZDgABlAgL0zXcX/Vz+mp6cf1Y/ZJUl90u70zHTXdNf8/df/qhoAg8FgMBgMBoPBYDAYDIa9hEEJ2lan1WzWzoGUbXxqSYAeNrkJIK+vbV1cB4NhFygsxO1nO1bT4Ru4aSXsYu/0xdy63bHBYJgghYQ4KsCkgTnATSlZC5icgaFg9ySIubWtziYYDBOCQ07GBFjI16f64vDbWxfnV7cvnOI1MYfmxbK3e4sB30CzwwKDYULk1sRnpy9dQ83bVk9QWFe3lzpx+y08vdwBxpa8p2RaHEfTogcGQ8XU8ux8ZrrTRrnv0DZK/zoK8GLSvr/7e7f7xYOzBxljX8GnrRqHR/QaGAwVk8ucQNMg0KysL5az9u87skP7ugezcxTNAIOhYrSF2NXCnsMm5fW3NKIOZD44QvjautWss/NgMFSMthCHtXCSHRzHO/c6N934MTXCToPBUDFaQvzi051ZCGlhyAmT8nVv0/LaMhgqQ0uIa4wHGpQP5DrkhNeHxzDJToLBUCGZQkxxYT+kRhGJtwpk4N76ozrG9j7xOTAYKiRTiBsOzPrbAyFuQUEwKaKOZcBmTJTCUCU8e4eab0rY5KRBUbgMUs+12vDGMBjKkirErikhZ2kbTYkulAAFtxtsM26BwVARqUJclSlBkF3sh9oYg2NgMFREqhBzWTvhb5cyJTzQHrbpEYV5FgyGiqinvSndskoMDbMuVACTYEsG1GbLywBSyM3Cz7lpyjUNRUkUYhSyoC6YgSxsSrxw5PJJzuU1tKlbknSwC5VoXgO38d7a1lJn4Ujn5GoF2t7wySMQYhK2GpdX4nZC7bm0cPTSc6t3L56CnHDukMAmhtRQy29SyI1xTqaLlhC/hA6ncPj9kXa8wvxHfbGsM5skWiq6unXxMG2QM7tvwM/hNVNSxoISCCnmrm53uknvt1FRNIHfiH4OXQtjbGX17oXUIquz05c3fMe7HGpKWXfH7bsejZKBkkGwb0pNY/NRteiidkVKOUtKDUrQGHDrzfuvPqDtwCZmTFrgdmb4z32PPlDCyYVnLpUq4Hnq2SeC7W++7OY8OJN2va5MjFK4mh7azQa/440ihaCCfxRguk4LJkycABNuf8vO7qXoldl4vtkcCm7VBJMppDxZVoCj8OGGDBre/9in1N8YApbyJirI5qXHxz97AL7e/nLw+jde/hoc/dIhvCaJdxOfEUwehGooPJuERiPYBeElRqoCE2DDkWJ3QEU1qUSUF+myYAIMbWI2/IDTP/gW/OS7P1Pbz6PgffD7v8Dd3yrN3fLu1txmxeOfG++bp77wBLz/mwc2amNLSjgEBRESFrlyQoMquRZqZBLkXBNVyfQJB2wcIU5hOLDwbJTPDCDWWSWtxBweFlCbSlbps6i2hHF2jl7EaM7smelLbb2Z4/K2kKp+OxccFQh+UGBGTrH6gR0YQNUoZRYySsr27Zv3Lz7wt+vDD+EHMEqAGrOl/nyeQW35eTQDPCFWdysNc2m2Xhwf/OGv8NQrT8JXv30MhfdJ9drmu3fR3hY2flkW/pXQAGJzdauzgnauHbJzrWaD3fAEuVBnvTMhR3MfCrAMaSUJ4hR+lhJ4PN/NJmfkH6j38Xu/gq/dzLoG7L/7V7eXupAT9C9s9C+uwO5iV9m3YU2shOi//3oYvEQmBWnLX/zoVyMHccavYcdqzZlDDdvCOw7+88+H8GPU7mRGYIfDD7/zU/jbn0cOt6AkVOd85shyy9dkeFEzjQajL2geCkDzCaEE6GQuRvtIZUEdb44ieNO8QuFFz7FaDjlW/mSCTtpnoYM3o5zVnEiHjYyA/5aDfzRg4rTK9i1NTPa3AyGWnrFNwvbLN27DhVsL8OnH9sGfUIP++sZ70TZQy6nhcDHrwxgfGvEktNe///OR9/c59fv9mjNL2987/Noh3+Msytq9pfNnp5ePSRyK1eej3CwcvWxnefpxBBNiC4JDcwdgdMj0tHBA3DQvjJmv4zWc9q/Bm9q1nm4aMTILcju04XOhfIB3E8GEaZXtWwgppsAAxDvZ8rc3330fLp9YhVeefyOwjWM4X4X3THe+AKa+6J36oBLn7lFfks1uBy+grVg2slIF5MyNfHlSLieVtjrDZQ8I8kUmOuSTANcGTqERa68Z2sQFwh46ZoVvayfh3fk9dT8JTpqkdOaO2kRbb06EVygScGXh6Gsfrt59VXtmCg31UAK6QUfbG3Hm0B9g5xamL+lN2cr0ReRtVETrSYe7jtVotIMcYsZEd6oP9sruLqfQY5o5AR2UELvJAyhCtlnBUm8O1XFC1HqYaKHCoMrCO1RwhDcHamS+EdygUqzga+/pprjDdldZ4kJq3nlpX7MXcuvGvoeO3erW0nra8QtPX+qFIxEck1ioXroru78eSK/KvlVC7DgUWy0MmRW38kYrCNQcNj1iaMtWkWo5NGmqgIQVhQdvsKGTRDFkDFst4vUekhnHv4Cp8DJhoAGG2GhUiAmpFSJfyG2c1e2LFMFphTSy1x+d1KXGquiHyEutsqao37e0rYTYjyAUhTMVATgOeZFcnUStBj0aCThnB6BiyEnCL84a/eLgWpYAq/PiKqNWmHpdzOFDNxpSI1tYYJpXtx3G+A1/NNENuSVBERzsD0gTZH9k9CnbD1OMW49A9EIlky00RTegBFNuTXpYiGu0ECAUh6nwTtxUfpk2XHKhbEYa+tE2RLNV5vaudYj54mLp9+FmswG0jwUVEQ2pQc4lDwg0A5ZDZoBWyC2NLEF2HKeLgmtDhf0wGIj1BpqeVaecCXVzeHUTyTANI9wNA1njb8jEk+aSfRh6qpIeMCHoi8OkwjxLKSsl7aYWRAR5XULx4TPMvogZQYkNyAmZARCOtiT2dZ428UaKREA8QZ4J98PI55aA2qzVxPEq+9ZHGRGRiq4xdmricMZaxAq0cbtrW0tz4ddQw95POo68f9/AX5i+fIcKUXb64qBZeNCQB9dMYenCuY7DvZAi05skx6N4PFaojEqjUd0QZvhk4JoTGMtN2cemfyr6oGNWuJVuVugVCzSQwhti3FixwaCNr4nTitbtYGcuFjXsmVajwfLnxb0p/Zn2ucEQwY1OaHqMKoow6inH4psVq+8rh0SLYcKDFS7J3Auo/vZT2H+DevaIUx+AnWcFpZe8ES2pbaamdo3Hd/Ock855UXtk5lEoFgqAMV07WvdRts3wtXtCLK2kMDHNvAg/J0/57PTyiaA4JQkyK57t3ISUTGC4EL7RcDYxTawVZvOmJ8U6mnhDrq+VyAZhMoHmA7Zj3rJ5X8z5X7abgaudZiBnBegtaicaytHFc6QIibOYJID0i1SY+DkvPOWS1LY3gTdwpBeOXl7yf8lK95xC52WjJlkMz3Ok8GDDqV1j/tojBXMJzbqKgnSqbDN87a5NDGnmBM28GCVSnJJEq+mw9CC5GNri/roUOmE22tcNAY2Hf0gAzxQs89MVYPzCr1CpJCs4v42Ow+PvRJ1gNYWnwe9QwVLeeOrC0Us3wC2Kt6AYFtqL18IzOygixSqZwzeEQo5Vt8lJq6XvwsZsYHLy6AdnIBOWy0nz1qVoUUlm1r5VC7KuAHtTmApGYCJEpnt5MWULcqJSuFJNbC0LJlJ4mzY8ubCgYnCEqOI8R6hn1U04Uthxr9NPGTQ4O11tBobCbGxmhyvhXM/amwTZrVYjjT96w3iCDDqmRbIAy839fTkXLpBBg2cWYLTH1ExryTYhA8nGNFDLW5fuptfO7NgxqW27zjBPMu3wOJbiiMecD6Qlp3TajEOwoQzFykuBNv1rJ+pZdRNJhR9eCWW4uKY8ErWqOhf99DMJMk1BwnTxRhFBThJgsrmmBuJUtMKLc35MgozsK069rVEAdebI8spw1olLZF06K3oM/bxakSozlUjavjCf93wywJT5hfw1MhmUbbPOWNaM2+Q7ZGwGQk6i4TTUDJR6JtWSa602L8N3/MXp5XUOoz+pkCbISQKMzuX1q9sX21Ax8X2ZrvkKl0lK6L2UkZoWNYwE5SuZaVF2V0ac/SQYxv51FsShqUoCxG3QgNrccVQFm+2/hpqYp2rifj89d85qcl467D5UgxsrzmlL+1zdWmqjdulFtUucICdqYLT1r95bqsbm3UNo7QzZ4OnXESPA6LSr7+DhQ+g1xyfbqTJOBpohBe5GPaheJBSJsWF8sZg2Orpt0AHbbFK7R19r+xMcOM/QBFl1DGoVeL1oRSahG0bLuYuD5tjFnY8ryMsbdNefmb68EWsD43FrHwMBLoHdcFxFQt+7gPy/zxKDhb0/zCtI0AgIaCDFiu8U1zPqJmzQYGcgV5oNNYxbUALqOBWvxHb6NVXttQIFSCq9pCSMVI8xKijl11E/irjhSk1nSbIek+I2c+RKOOmhRrbpTpfJ2gldB14OV5IKYCFzk/IMNB0tV5tqBBjzk1q0RgY+9uppc+DCKec0SPgwzDNfoNB57CIYeqrUEZIrz7mQEBM7dbnecNg5zY6y6UaEjxH0i1VV3JTk90COuYYqWdPgH1bZJpFWDVmHiua1UewYnbxuTidv7LOFFA8w9UzC/BwUJPQj6rrXRgutbBRfaIXP4E2cvodU9uTp8XdYMcctCwYn8Jy6kJPwtJ8iU4iyAgVUr5w31Ux9JyE5FFwPT9UfO1jTC/UhJw9jtndKxY5VIZA63VaRlYZCAmzFvG3TP69DIufIZihMV0SQuaolyUjyJnwD6JVvQkmCqM7oB85wxnJPAfKnVNF22SlEcaADdyNL0GMOSnUlucyZck6DnDy0THI5eVEHLvzbHjxn6C5NgMlJoeVb6Q+jFAfjnRYSZKWRKxmdNLCLTLCNQtOq4P8bGyaAvyQCF0LMq/UHMLSkpu6QTRo4BPmHOncqjSysXbzfvFNgmEjbpMgSYHJSwq/R870UZOrjIlOV4lAjh8xejWnPkJVEOSJtsmCybD1pYbfzJb5EIeWi7lD2qDY4jA+Bxg/bYeTVkjBlDe95BdiHXkc7/tC4HV/ctEhDRQyUsyxuTaEjWeV6D57X38U+wxAjPxbjze8FFH69XnHUR7W5fyACR1wzap0f3ZSmFDC/ds9dR4EEOGqH0RKgaSsopgkwpY7Xti/MQQquN8024ouV5OZOX44Ictzq7Fkrwhsmi27JaW6oQEjmKOogYaJlsbynNpk4+/viYFEBJgGcGjiZwzUJKAlqvAm06zayoQATE2JXe4lFyKju8usnGg33NzIo7YvCe/wqDo9pw22WAEerz7LO1QjyR5eJCTFBQW2qUOI1cZjMgrh1DPyYIYPaOT/tu1LCBs4rwD5GkD+61GEX8CIO9KdMA++HYWYo9Qj+cklS3NJxACYhwD5q3TRV1snujLfvOnv5ir4MBoPBYDAYDAaDwWAwZPI/iTTgFxK8/KcAAAAASUVORK5CYII="},39912:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>U});var n=r(9950),o=r(28429),i=r(14857),a=r(8457),s=r(26910),c=r(4159),l=r.n(c),u=(r(52351),r(8881)),d=r(58168);const f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M732 120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v148h440V120zm120 212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM664 844H360V568h304v276zm164-360c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-40c0-4.4 3.6-8 8-8h40c4.4 0 8 3.6 8 8v40z"}}]},name:"printer",theme:"filled"};var p=r(61187),h=function(e,t){return n.createElement(p.A,(0,d.A)({},e,{ref:t,icon:f}))};const y=n.forwardRef(h);var g=r(45418),m=r.n(g),b=r(43302),v=r(93230),x=r(83274),A=r(25333),w=r(82053),j=r(25277),C=r(82223),_=r(16491),P=r(60899),S=r(1320),T=r(15769),O=r(69780),D=r(9213),E=r(21671),k=r(34075),M=r(74745),R=r(96583),Y=r(40033),N=r(28170),F=r(29925),I=r(79739),q=r(44414);const U=()=>{const[e,t]=(0,n.useState)({}),r=(0,o.zy)(),c=(0,o.Zp)();console.log("previewSelect",r.state);const d=(0,n.useRef)(null),[f,p]=(0,n.useState)(!0),[h,g]=(0,n.useState)(!1),[U,z]=(0,n.useState)(""),[B,G]=(0,n.useState)(""),L=(0,i.A)();function V(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e)}(0,n.useEffect)((()=>{t(r.state)}),[]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(v.A,{direction:"row",justifyContent:"Space-between",alignItems:"center",spacing:2,sx:{px:2.5,py:1,bgcolor:"#eeeeee"},children:[(0,q.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:2,children:[(0,q.jsx)(x.A,{title:"back",children:(0,q.jsx)(A.A,{color:"primary",onClick:()=>{c("/nearle/invoice")},children:(0,q.jsx)(b.QVr,{size:"large"})})}),(0,q.jsxs)(v.A,{alignItems:"center",children:[(0,q.jsx)(w.A,{variant:"h3",color:"primary",children:"Invoice Details"}),(0,q.jsx)(j.A,{size:"small",color:"warning",variant:"outlined",sx:{bgcolor:L.palette.warning.lighter},label:"Invoice No :".concat("\xa0\xa0",e.invoiceno)})]})]}),(0,q.jsxs)(v.A,{direction:"row",spacing:2,children:[(0,q.jsxs)(C.A,{variant:"outlined",color:"primary",sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},onClick:()=>{g(!0)},children:[" ",(0,q.jsx)(b.jtd,{}),"Update Payment"]}),(0,q.jsx)(m(),{trigger:()=>(0,q.jsx)(C.A,{size:"small",startIcon:(0,q.jsx)(y,{}),variant:"outlined",color:"primary",sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},children:"Print"}),content:()=>d.current})]})]}),(0,q.jsx)(_.A,{sx:{pb:2.5,border:"1px solid #eee"},children:(0,q.jsxs)("div",{ref:d,style:{width:"100%"},children:[(0,q.jsxs)(_.A,{id:"print",sx:{p:2.5},children:[(0,q.jsxs)(_.A,{sx:{pb:2.5},children:[(0,q.jsxs)(v.A,{sx:{flexDirection:"row",border:"1px solid #eee",px:3},justifyContent:"space-between",children:[(0,q.jsxs)(_.A,{sx:{pt:.5},children:[(0,q.jsxs)(v.A,{direction:"row",spacing:2,children:[(0,q.jsx)("img",{src:a,style:{width:"150px",height:"50px"}})," "]}),(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{sx:{overflow:"hidden",color:L.palette.primary.main},variant:"subtitle1",children:"Invoice No :"}),(0,q.jsx)(w.A,{sx:{color:L.palette.primary.main},children:"\xa0\xa0".concat(e.invoiceno)})]})]}),(0,q.jsxs)(_.A,{sx:{pt:2.5,pb:1.75},children:[(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsxs)(w.A,{sx:{pl:4,color:L.palette.primary.main},variant:"subtitle1",children:["Date :"," "]}),(0,q.jsx)(w.A,{sx:{color:L.palette.primary.main},children:l()(e.transactiondate).format("DD-MM-YYYY")})]}),(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{sx:{pr:2,overflow:"hidden",color:L.palette.primary.main},variant:"subtitle1",children:"Due Date :"}),(0,q.jsx)(w.A,{sx:{color:L.palette.primary.main},children:l()(e.dueDate).format("DD-MM-YYYY")})]})]})]}),(0,q.jsx)(_.A,{sx:{pt:2.5},children:(0,q.jsxs)(P.Ay,{container:!0,spacing:2,justifyContent:"space-between",direction:"row",children:[(0,q.jsx)(P.Ay,{item:!0,xs:12,sm:6,children:(0,q.jsx)(_.A,{sx:{border:1,minHeight:240,borderColor:"grey.200",borderRadius:.5,p:2.5},children:(0,q.jsx)(P.Ay,{container:!0,direction:"row",children:(0,q.jsx)(P.Ay,{item:!0,md:8,children:(0,q.jsxs)(v.A,{spacing:2,children:[(0,q.jsx)(w.A,{variant:"h5",children:"From:"}),(0,q.jsxs)(v.A,{sx:{width:"100%"},children:[(0,q.jsx)(w.A,{variant:"subtitle1",children:"Nearle Technology Privite Limited."}),(0,q.jsxs)(w.A,{color:"secondary",children:["424, 4",(0,q.jsx)("sup",{children:"th"}),"floor,"]}),(0,q.jsx)(w.A,{color:"secondary",children:"Red rose towers,"}),(0,q.jsx)(w.A,{color:"secondary",children:"DB Road, RS Puram,"}),(0,q.jsx)(w.A,{color:"secondary",children:"641002."}),(0,q.jsx)(w.A,{color:"secondary",children:"care@nearle.in"}),(0,q.jsx)(w.A,{color:"secondary",children:"9047968666"})]})]})})})})}),(0,q.jsx)(P.Ay,{item:!0,xs:12,sm:6,children:(0,q.jsx)(_.A,{sx:{border:1,minHeight:240,borderColor:"grey.200",borderRadius:.5,p:2.5},children:(0,q.jsx)(P.Ay,{container:!0,direction:"row",children:(0,q.jsx)(P.Ay,{item:!0,md:8,children:(0,q.jsxs)(v.A,{spacing:2,children:[(0,q.jsx)(w.A,{variant:"h5",children:"To:"}),(0,q.jsxs)(v.A,{sx:{width:"100%"},children:[(0,q.jsx)(w.A,{variant:"subtitle1",children:e.tenantname}),(0,q.jsx)(w.A,{color:"secondary",children:e.address}),(0,q.jsx)(w.A,{color:"secondary",children:e.suburb}),(0,q.jsx)(w.A,{color:"secondary",children:e.city}),(0,q.jsx)(w.A,{color:"secondary",children:e.state})," "]})]})})})})})]})})]}),(0,q.jsx)(S.A,{children:(0,q.jsxs)(T.A,{children:[(0,q.jsx)(O.A,{children:(0,q.jsxs)(D.A,{children:[(0,q.jsx)(E.A,{children:"S.No"}),(0,q.jsx)(E.A,{children:"Particulars"}),(0,q.jsx)(E.A,{children:"Unit"}),(0,q.jsx)(E.A,{children:"Quantity"}),(0,q.jsx)(E.A,{align:"right",children:"Rate"}),(0,q.jsx)(E.A,{align:"right",children:"Other Charges"}),(0,q.jsx)(E.A,{align:"right",children:"Amount"})]})}),e.tenantsalesdetails&&(0,q.jsx)(k.A,{children:(0,q.jsxs)(D.A,{children:[(0,q.jsx)(E.A,{children:"1"}),(0,q.jsx)(E.A,{children:(0,q.jsx)(w.A,{children:"Invoice from ".concat(l()(e.tenantsalesdetails[0].fromdate).format("DD-MM-YYYY")," to ").concat(l()(e.tenantsalesdetails[0].todate).format("DD-MM-YYYY"))})}),(0,q.jsx)(E.A,{children:(0,q.jsx)(w.A,{children:e.tenantsalesdetails[0].pricingtype})}),(0,q.jsx)(E.A,{children:(0,q.jsx)(w.A,{children:"".concat(e.tenantsalesdetails[0].quantity.toFixed(2)," km")})}),(0,q.jsx)(E.A,{children:(0,q.jsx)(w.A,{align:"right",children:"\u20b9 ".concat(e.tenantsalesdetails[0].baserate.toFixed(2))})}),(0,q.jsx)(E.A,{align:"right",children:(0,q.jsx)(w.A,{children:"\u20b9 ".concat(e.tenantsalesdetails[0].othercharges,".00")})}),(0,q.jsx)(E.A,{align:"right",children:(0,q.jsx)(w.A,{children:"\u20b9 ".concat(e.tenantsalesdetails[0].amount,".00")})})]})})]})}),(0,q.jsx)(M.A,{}),(0,q.jsx)(_.A,{sx:{p:2.5},children:(0,q.jsx)(P.Ay,{container:!0,direction:"row",justifyContent:"flex-end",children:(0,q.jsx)(P.Ay,{item:!0,md:4,children:(0,q.jsxs)(v.A,{spacing:2,children:[(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{color:"secondary",children:"Sub Total:"}),(0,q.jsx)(w.A,{variant:"h6",children:V(e.salesamount)})]}),(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{color:"secondary",children:"Discount:"}),(0,q.jsxs)(w.A,{variant:"h6",color:L.palette.error.main,children:["- ",V(e.discountamt)]})]}),(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{color:L.palette.grey[500],children:"Tax:"}),(0,q.jsxs)(w.A,{variant:"h6",color:L.palette.success.main,children:["+ ",V(e.taxamount)]})]}),(0,q.jsxs)(v.A,{direction:"row",justifyContent:"space-between",children:[(0,q.jsx)(w.A,{sx:{pr:2},variant:"subtitle1",children:"Grand Total:"}),(0,q.jsx)(w.A,{variant:"h6",children:V(Math.round(e.totalamount))})]})]})})})})]}),(0,q.jsx)(M.A,{}),(0,q.jsx)(_.A,{sx:{p:2.5},children:(0,q.jsxs)(w.A,{children:["Notes: ",e.remarks]})}),(0,q.jsx)(M.A,{})]})}),(0,q.jsxs)(R.A,{open:h,onClose:()=>{g(!1)},maxWidth:"sm",fullWidth:!0,children:[(0,q.jsx)(Y.A,{sx:{bgcolor:L.palette.primary.main},children:(0,q.jsxs)(v.A,{direction:"row",spacing:1,children:[(0,q.jsx)(w.A,{variant:"h2",sx:{color:"white"},children:"\u20b9"}),(0,q.jsx)(w.A,{variant:"h3",sx:{color:"white"},children:"Update Payment"})]})}),(0,q.jsxs)(N.A,{dividers:!0,children:[(0,q.jsxs)(v.A,{spacing:1,sx:{mb:2},children:[(0,q.jsx)(w.A,{children:"Reference No"}),(0,q.jsx)(F.A,{type:"number",placeholder:"Enter Reference Number",sx:{width:"100%"},onChange:e=>{z(e.target.value)}})]}),(0,q.jsxs)(v.A,{spacing:2,sx:{mb:2},children:[(0,q.jsx)(w.A,{children:"Remarks"}),(0,q.jsx)(F.A,{multiline:!0,required:!0,placeholder:"Enter Remarks",sx:{width:"100%"},onChange:e=>{G(e.target.value)}})]})]}),(0,q.jsxs)(I.A,{children:[(0,q.jsx)(C.A,{variant:"outlined",sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"},m:2},onClick:()=>{g(!1)},children:"Cancel"}),(0,q.jsx)(C.A,{variant:"outlined",disabled:""==U||""==B,sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"},m:2},onClick:()=>{g(!1),(async()=>{try{const t=await s.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/invoice/updatestatus"),{salesid:e.salesid,referenceno:U,referencedate:l()().format("YYYY-MM-DD HH:mm:ss"),billstatus:2,paymentremarks:B});t.status&&(0,u.M8)(" Updated Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),console.log("updateResponse",t)}catch(t){console.log("updateResponse",t)}})(),c("/nearle/invoice")},children:"Update"})]})]})]})}},45418:function(e,t,r){var n,o;"undefined"!=typeof self&&self,e.exports=(n=r(9950),o=r(17119),function(){"use strict";var e={328:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PrintContextConsumer=t.PrintContext=void 0;var n=r(496),o=Object.prototype.hasOwnProperty.call(n,"createContext");t.PrintContext=o?n.createContext({}):null,t.PrintContextConsumer=t.PrintContext?t.PrintContext.Consumer:function(){return null}},428:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactToPrint=void 0;var n=r(316),o=r(496),i=r(190),a=r(328),s=r(940),c=function(e){function t(){var t=e.apply(this,n.__spreadArray([],n.__read(arguments),!1))||this;return t.startPrint=function(e){var r=t.props,n=r.onAfterPrint,o=r.onPrintError,i=r.print,a=r.documentTitle;setTimeout((function(){var r,s;if(e.contentWindow)if(e.contentWindow.focus(),i)i(e).then((function(){return null==n?void 0:n()})).then((function(){return t.handleRemoveIframe()})).catch((function(e){o?o("print",e):t.logMessages(["An error was thrown by the specified `print` function"])}));else{if(e.contentWindow.print){var c=null!==(s=null===(r=e.contentDocument)||void 0===r?void 0:r.title)&&void 0!==s?s:"",l=e.ownerDocument.title;a&&(e.ownerDocument.title=a,e.contentDocument&&(e.contentDocument.title=a)),e.contentWindow.print(),a&&(e.ownerDocument.title=l,e.contentDocument&&(e.contentDocument.title=c))}else t.logMessages(["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."]);null==n||n(),t.handleRemoveIframe()}else t.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"])}),500)},t.triggerPrint=function(e){var r=t.props,n=r.onBeforePrint,o=r.onPrintError;if(n){var i=n();i&&"function"==typeof i.then?i.then((function(){t.startPrint(e)})).catch((function(e){o&&o("onBeforePrint",e)})):t.startPrint(e)}else t.startPrint(e)},t.handlePrint=function(e){var r=t.props,o=r.bodyClass,a=r.content,s=r.copyStyles,c=r.fonts,l=r.pageStyle,u=r.nonce,d="function"==typeof e?e():null;if(d&&"function"==typeof a&&t.logMessages(['"react-to-print" received a `content` prop and a content param passed the callback return by `useReactToPrint. The `content` prop will be ignored.'],"warning"),d||"function"!=typeof a||(d=a()),void 0!==d)if(null!==d){var f=document.createElement("iframe");f.width="".concat(document.documentElement.clientWidth,"px"),f.height="".concat(document.documentElement.clientHeight,"px"),f.style.position="absolute",f.style.top="-".concat(document.documentElement.clientHeight+100,"px"),f.style.left="-".concat(document.documentElement.clientWidth+100,"px"),f.id="printWindow",f.srcdoc="";var p=(0,i.findDOMNode)(d);if(p){var h=p.cloneNode(!0),y=h instanceof Text,g=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),m=y?[]:h.querySelectorAll("img"),b=y?[]:h.querySelectorAll("video"),v=c?c.length:0;t.numResourcesToLoad=g.length+m.length+b.length+v,t.resourcesLoaded=[],t.resourcesErrored=[];var x=function(e,r){t.resourcesLoaded.includes(e)?t.logMessages(["Tried to mark a resource that has already been handled",e],"debug"):(r?(t.logMessages(n.__spreadArray(['"react-to-print" was unable to load a resource but will continue attempting to print the page'],n.__read(r),!1)),t.resourcesErrored.push(e)):t.resourcesLoaded.push(e),t.resourcesLoaded.length+t.resourcesErrored.length===t.numResourcesToLoad&&t.triggerPrint(f))};f.onload=function(){var e,r,i,a;f.onload=null;var d=f.contentDocument||(null===(r=f.contentWindow)||void 0===r?void 0:r.document);if(d){d.body.appendChild(h),c&&((null===(i=f.contentDocument)||void 0===i?void 0:i.fonts)&&(null===(a=f.contentWindow)||void 0===a?void 0:a.FontFace)?c.forEach((function(e){var t=new FontFace(e.family,e.source,{weight:e.weight,style:e.style});f.contentDocument.fonts.add(t),t.loaded.then((function(){x(t)})).catch((function(e){x(t,["Failed loading the font:",t,"Load error:",e])}))})):(c.forEach((function(e){return x(e)})),t.logMessages(['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'])));var g="function"==typeof l?l():l;if("string"!=typeof g)t.logMessages(['"react-to-print" expected a "string" from `pageStyle` but received "'.concat(typeof g,'". Styles from `pageStyle` will not be applied.')]);else{var v=d.createElement("style");u&&(v.setAttribute("nonce",u),d.head.setAttribute("nonce",u)),v.appendChild(d.createTextNode(g)),d.head.appendChild(v)}if(o&&(e=d.body.classList).add.apply(e,n.__spreadArray([],n.__read(o.split(" ")),!1)),!y){for(var A=y?[]:p.querySelectorAll("canvas"),w=d.querySelectorAll("canvas"),j=0;j",t,"Error",i])},n.src=r}else x(t,['Found an tag with an empty "src" attribute. This prevents pre-loading it. The is:',t])};for(j=0;j=2?x(t):(t.onloadeddata=function(){return x(t)},t.onerror=function(e,r,n,o,i){return x(t,["Error loading video",t,"Error",i])},t.onstalled=function(){return x(t,["Loading video stalled, skipping",t])})};for(j=0;j tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The is:",n],"warning"),x(n);else{for(var l=d.createElement(n.tagName),f=(c=0,n.attributes.length);c tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the was not loaded. The is:",n],"warning"),x(n)},q=(j=0,F.length);j=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,r[p])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(d.get=s),(s=a(g.set))&&(d.set=s),(s=a(g.init))&&o.unshift(s)}else(s=a(g))&&("field"===c?o.unshift(s):d[l]=s)}u&&Object.defineProperty(u,n.name,d),f=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function x(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(r=o[e](t)).value instanceof j?Promise.resolve(r.value.v).then(c,l):u(i[0][2],r)}catch(e){u(i[0][3],e)}var r}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function _(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:j(e[n](t)),done:!1}:o?o(t):t}:o}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&g(t,e,r);return T(t,e),t}function D(e){return e&&e.__esModule?e:{default:e}}function E(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function k(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function R(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Y="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function N(e){function t(t){e.error=e.hasError?new Y(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:p,__awaiter:h,__generator:y,__createBinding:g,__exportStar:m,__values:b,__read:v,__spread:x,__spreadArrays:A,__spreadArray:w,__await:j,__asyncGenerator:C,__asyncDelegator:_,__asyncValues:P,__makeTemplateObject:S,__importStar:O,__importDefault:D,__classPrivateFieldGet:E,__classPrivateFieldSet:k,__classPrivateFieldIn:M,__addDisposableResource:R,__disposeResources:N}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.useReactToPrint=e.ReactToPrint=e.PrintContextConsumer=void 0;var t=r(328);Object.defineProperty(e,"PrintContextConsumer",{enumerable:!0,get:function(){return t.PrintContextConsumer}});var n=r(428);Object.defineProperty(e,"ReactToPrint",{enumerable:!0,get:function(){return n.ReactToPrint}});var o=r(892);Object.defineProperty(e,"useReactToPrint",{enumerable:!0,get:function(){return o.useReactToPrint}});var a=r(428);e.default=a.ReactToPrint}(),i}())},79739:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var n=r(98587),o=r(58168),i=r(9950),a=r(72004),s=r(3484),c=r(59254),l=r(18463),u=r(45558),d=r(1614);function f(e){return(0,d.Ay)("MuiDialogActions",e)}(0,u.A)("MuiDialogActions",["root","spacing"]);var p=r(44414);const h=["className","disableSpacing"],y=(0,c.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,o.A)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),g=i.forwardRef((function(e,t){const r=(0,l.b)({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:c=!1}=r,u=(0,n.A)(r,h),d=(0,o.A)({},r,{disableSpacing:c}),g=(e=>{const{classes:t,disableSpacing:r}=e,n={root:["root",!r&&"spacing"]};return(0,s.A)(n,f,t)})(d);return(0,p.jsx)(y,(0,o.A)({className:(0,a.A)(g.root,i),ownerState:d,ref:t},u))}))}}]); \ No newline at end of file diff --git a/build/static/js/9912.a8585d14.chunk.js b/build/static/js/9912.a8585d14.chunk.js new file mode 100644 index 0000000..8776502 --- /dev/null +++ b/build/static/js/9912.a8585d14.chunk.js @@ -0,0 +1 @@ +(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9912],{8457:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALEAAABFCAYAAAAFKgfKAAAQE0lEQVR4Ae2dS4wcRxmA/6p5GLxEHiuHRILgtpx1wslrDjwuZDdcAduckTyrxOsIFNl7Q1HsnbVz4YC8IQoku4685sjFNnCMtGMuICTkzQWIdy23RZDgABlAgL0zXcX/Vz+mp6cf1Y/ZJUl90u70zHTXdNf8/df/qhoAg8FgMBgMBoPBYDAYDIa9hEEJ2lan1WzWzoGUbXxqSYAeNrkJIK+vbV1cB4NhFygsxO1nO1bT4Ru4aSXsYu/0xdy63bHBYJgghYQ4KsCkgTnATSlZC5icgaFg9ySIubWtziYYDBOCQ07GBFjI16f64vDbWxfnV7cvnOI1MYfmxbK3e4sB30CzwwKDYULk1sRnpy9dQ83bVk9QWFe3lzpx+y08vdwBxpa8p2RaHEfTogcGQ8XU8ux8ZrrTRrnv0DZK/zoK8GLSvr/7e7f7xYOzBxljX8GnrRqHR/QaGAwVk8ucQNMg0KysL5az9u87skP7ugezcxTNAIOhYrSF2NXCnsMm5fW3NKIOZD44QvjautWss/NgMFSMthCHtXCSHRzHO/c6N934MTXCToPBUDFaQvzi051ZCGlhyAmT8nVv0/LaMhgqQ0uIa4wHGpQP5DrkhNeHxzDJToLBUCGZQkxxYT+kRhGJtwpk4N76ozrG9j7xOTAYKiRTiBsOzPrbAyFuQUEwKaKOZcBmTJTCUCU8e4eab0rY5KRBUbgMUs+12vDGMBjKkirErikhZ2kbTYkulAAFtxtsM26BwVARqUJclSlBkF3sh9oYg2NgMFREqhBzWTvhb5cyJTzQHrbpEYV5FgyGiqinvSndskoMDbMuVACTYEsG1GbLywBSyM3Cz7lpyjUNRUkUYhSyoC6YgSxsSrxw5PJJzuU1tKlbknSwC5VoXgO38d7a1lJn4Ujn5GoF2t7wySMQYhK2GpdX4nZC7bm0cPTSc6t3L56CnHDukMAmhtRQy29SyI1xTqaLlhC/hA6ncPj9kXa8wvxHfbGsM5skWiq6unXxMG2QM7tvwM/hNVNSxoISCCnmrm53uknvt1FRNIHfiH4OXQtjbGX17oXUIquz05c3fMe7HGpKWXfH7bsejZKBkkGwb0pNY/NRteiidkVKOUtKDUrQGHDrzfuvPqDtwCZmTFrgdmb4z32PPlDCyYVnLpUq4Hnq2SeC7W++7OY8OJN2va5MjFK4mh7azQa/440ihaCCfxRguk4LJkycABNuf8vO7qXoldl4vtkcCm7VBJMppDxZVoCj8OGGDBre/9in1N8YApbyJirI5qXHxz97AL7e/nLw+jde/hoc/dIhvCaJdxOfEUwehGooPJuERiPYBeElRqoCE2DDkWJ3QEU1qUSUF+myYAIMbWI2/IDTP/gW/OS7P1Pbz6PgffD7v8Dd3yrN3fLu1txmxeOfG++bp77wBLz/mwc2amNLSjgEBRESFrlyQoMquRZqZBLkXBNVyfQJB2wcIU5hOLDwbJTPDCDWWSWtxBweFlCbSlbps6i2hHF2jl7EaM7smelLbb2Z4/K2kKp+OxccFQh+UGBGTrH6gR0YQNUoZRYySsr27Zv3Lz7wt+vDD+EHMEqAGrOl/nyeQW35eTQDPCFWdysNc2m2Xhwf/OGv8NQrT8JXv30MhfdJ9drmu3fR3hY2flkW/pXQAGJzdauzgnauHbJzrWaD3fAEuVBnvTMhR3MfCrAMaSUJ4hR+lhJ4PN/NJmfkH6j38Xu/gq/dzLoG7L/7V7eXupAT9C9s9C+uwO5iV9m3YU2shOi//3oYvEQmBWnLX/zoVyMHccavYcdqzZlDDdvCOw7+88+H8GPU7mRGYIfDD7/zU/jbn0cOt6AkVOd85shyy9dkeFEzjQajL2geCkDzCaEE6GQuRvtIZUEdb44ieNO8QuFFz7FaDjlW/mSCTtpnoYM3o5zVnEiHjYyA/5aDfzRg4rTK9i1NTPa3AyGWnrFNwvbLN27DhVsL8OnH9sGfUIP++sZ70TZQy6nhcDHrwxgfGvEktNe///OR9/c59fv9mjNL2987/Noh3+Msytq9pfNnp5ePSRyK1eej3CwcvWxnefpxBBNiC4JDcwdgdMj0tHBA3DQvjJmv4zWc9q/Bm9q1nm4aMTILcju04XOhfIB3E8GEaZXtWwgppsAAxDvZ8rc3330fLp9YhVeefyOwjWM4X4X3THe+AKa+6J36oBLn7lFfks1uBy+grVg2slIF5MyNfHlSLieVtjrDZQ8I8kUmOuSTANcGTqERa68Z2sQFwh46ZoVvayfh3fk9dT8JTpqkdOaO2kRbb06EVygScGXh6Gsfrt59VXtmCg31UAK6QUfbG3Hm0B9g5xamL+lN2cr0ReRtVETrSYe7jtVotIMcYsZEd6oP9sruLqfQY5o5AR2UELvJAyhCtlnBUm8O1XFC1HqYaKHCoMrCO1RwhDcHamS+EdygUqzga+/pprjDdldZ4kJq3nlpX7MXcuvGvoeO3erW0nra8QtPX+qFIxEck1ioXroru78eSK/KvlVC7DgUWy0MmRW38kYrCNQcNj1iaMtWkWo5NGmqgIQVhQdvsKGTRDFkDFst4vUekhnHv4Cp8DJhoAGG2GhUiAmpFSJfyG2c1e2LFMFphTSy1x+d1KXGquiHyEutsqao37e0rYTYjyAUhTMVATgOeZFcnUStBj0aCThnB6BiyEnCL84a/eLgWpYAq/PiKqNWmHpdzOFDNxpSI1tYYJpXtx3G+A1/NNENuSVBERzsD0gTZH9k9CnbD1OMW49A9EIlky00RTegBFNuTXpYiGu0ECAUh6nwTtxUfpk2XHKhbEYa+tE2RLNV5vaudYj54mLp9+FmswG0jwUVEQ2pQc4lDwg0A5ZDZoBWyC2NLEF2HKeLgmtDhf0wGIj1BpqeVaecCXVzeHUTyTANI9wNA1njb8jEk+aSfRh6qpIeMCHoi8OkwjxLKSsl7aYWRAR5XULx4TPMvogZQYkNyAmZARCOtiT2dZ428UaKREA8QZ4J98PI55aA2qzVxPEq+9ZHGRGRiq4xdmricMZaxAq0cbtrW0tz4ddQw95POo68f9/AX5i+fIcKUXb64qBZeNCQB9dMYenCuY7DvZAi05skx6N4PFaojEqjUd0QZvhk4JoTGMtN2cemfyr6oGNWuJVuVugVCzSQwhti3FixwaCNr4nTitbtYGcuFjXsmVajwfLnxb0p/Zn2ucEQwY1OaHqMKoow6inH4psVq+8rh0SLYcKDFS7J3Auo/vZT2H+DevaIUx+AnWcFpZe8ES2pbaamdo3Hd/Ock855UXtk5lEoFgqAMV07WvdRts3wtXtCLK2kMDHNvAg/J0/57PTyiaA4JQkyK57t3ISUTGC4EL7RcDYxTawVZvOmJ8U6mnhDrq+VyAZhMoHmA7Zj3rJ5X8z5X7abgaudZiBnBegtaicaytHFc6QIibOYJID0i1SY+DkvPOWS1LY3gTdwpBeOXl7yf8lK95xC52WjJlkMz3Ok8GDDqV1j/tojBXMJzbqKgnSqbDN87a5NDGnmBM28GCVSnJJEq+mw9CC5GNri/roUOmE22tcNAY2Hf0gAzxQs89MVYPzCr1CpJCs4v42Ow+PvRJ1gNYWnwe9QwVLeeOrC0Us3wC2Kt6AYFtqL18IzOygixSqZwzeEQo5Vt8lJq6XvwsZsYHLy6AdnIBOWy0nz1qVoUUlm1r5VC7KuAHtTmApGYCJEpnt5MWULcqJSuFJNbC0LJlJ4mzY8ubCgYnCEqOI8R6hn1U04Uthxr9NPGTQ4O11tBobCbGxmhyvhXM/amwTZrVYjjT96w3iCDDqmRbIAy839fTkXLpBBg2cWYLTH1ExryTYhA8nGNFDLW5fuptfO7NgxqW27zjBPMu3wOJbiiMecD6Qlp3TajEOwoQzFykuBNv1rJ+pZdRNJhR9eCWW4uKY8ErWqOhf99DMJMk1BwnTxRhFBThJgsrmmBuJUtMKLc35MgozsK069rVEAdebI8spw1olLZF06K3oM/bxakSozlUjavjCf93wywJT5hfw1MhmUbbPOWNaM2+Q7ZGwGQk6i4TTUDJR6JtWSa602L8N3/MXp5XUOoz+pkCbISQKMzuX1q9sX21Ax8X2ZrvkKl0lK6L2UkZoWNYwE5SuZaVF2V0ac/SQYxv51FsShqUoCxG3QgNrccVQFm+2/hpqYp2rifj89d85qcl467D5UgxsrzmlL+1zdWmqjdulFtUucICdqYLT1r95bqsbm3UNo7QzZ4OnXESPA6LSr7+DhQ+g1xyfbqTJOBpohBe5GPaheJBSJsWF8sZg2Orpt0AHbbFK7R19r+xMcOM/QBFl1DGoVeL1oRSahG0bLuYuD5tjFnY8ryMsbdNefmb68EWsD43FrHwMBLoHdcFxFQt+7gPy/zxKDhb0/zCtI0AgIaCDFiu8U1zPqJmzQYGcgV5oNNYxbUALqOBWvxHb6NVXttQIFSCq9pCSMVI8xKijl11E/irjhSk1nSbIek+I2c+RKOOmhRrbpTpfJ2gldB14OV5IKYCFzk/IMNB0tV5tqBBjzk1q0RgY+9uppc+DCKec0SPgwzDNfoNB57CIYeqrUEZIrz7mQEBM7dbnecNg5zY6y6UaEjxH0i1VV3JTk90COuYYqWdPgH1bZJpFWDVmHiua1UewYnbxuTidv7LOFFA8w9UzC/BwUJPQj6rrXRgutbBRfaIXP4E2cvodU9uTp8XdYMcctCwYn8Jy6kJPwtJ8iU4iyAgVUr5w31Ux9JyE5FFwPT9UfO1jTC/UhJw9jtndKxY5VIZA63VaRlYZCAmzFvG3TP69DIufIZihMV0SQuaolyUjyJnwD6JVvQkmCqM7oB85wxnJPAfKnVNF22SlEcaADdyNL0GMOSnUlucyZck6DnDy0THI5eVEHLvzbHjxn6C5NgMlJoeVb6Q+jFAfjnRYSZKWRKxmdNLCLTLCNQtOq4P8bGyaAvyQCF0LMq/UHMLSkpu6QTRo4BPmHOncqjSysXbzfvFNgmEjbpMgSYHJSwq/R870UZOrjIlOV4lAjh8xejWnPkJVEOSJtsmCybD1pYbfzJb5EIeWi7lD2qDY4jA+Bxg/bYeTVkjBlDe95BdiHXkc7/tC4HV/ctEhDRQyUsyxuTaEjWeV6D57X38U+wxAjPxbjze8FFH69XnHUR7W5fyACR1wzap0f3ZSmFDC/ds9dR4EEOGqH0RKgaSsopgkwpY7Xti/MQQquN8024ouV5OZOX44Ictzq7Fkrwhsmi27JaW6oQEjmKOogYaJlsbynNpk4+/viYFEBJgGcGjiZwzUJKAlqvAm06zayoQATE2JXe4lFyKju8usnGg33NzIo7YvCe/wqDo9pw22WAEerz7LO1QjyR5eJCTFBQW2qUOI1cZjMgrh1DPyYIYPaOT/tu1LCBs4rwD5GkD+61GEX8CIO9KdMA++HYWYo9Qj+cklS3NJxACYhwD5q3TRV1snujLfvOnv5ir4MBoPBYDAYDAaDwWAwZPI/iTTgFxK8/KcAAAAASUVORK5CYII="},39912:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>z});var n=r(9950),o=r(28429),i=r(14857),a=r(47223),s=r(8457),c=r(26910),l=r(4159),u=r.n(l),d=(r(52351),r(8881)),f=r(58168);const p={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M732 120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v148h440V120zm120 212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM664 844H360V568h304v276zm164-360c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-40c0-4.4 3.6-8 8-8h40c4.4 0 8 3.6 8 8v40z"}}]},name:"printer",theme:"filled"};var h=r(61187),y=function(e,t){return n.createElement(h.A,(0,f.A)({},e,{ref:t,icon:p}))};const m=n.forwardRef(y);var g=r(45418),b=r.n(g),v=r(43302),x=r(93230),A=r(83274),w=r(25333),j=r(82053),C=r(25277),_=r(82223),P=r(16491),S=r(60899),T=r(1320),O=r(15769),D=r(69780),E=r(9213),k=r(21671),M=r(34075),R=r(74745),Y=r(96583),N=r(40033),F=r(28170),I=r(29925),q=r(79739),U=r(44414);const z=()=>{const[e,t]=(0,n.useState)({}),r=(0,o.zy)(),l=(0,o.Zp)();console.log("previewSelect",r.state);const f=(0,n.useRef)(null),[p,h]=(0,n.useState)(!0),[y,g]=(0,n.useState)(!1),[z,B]=(0,n.useState)(""),[G,L]=(0,n.useState)(""),V=(0,i.A)(),J=(0,a.A)(V.breakpoints.down("md"));function Q(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e)}(0,n.useEffect)((()=>{t(r.state)}),[]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(x.A,{direction:{xs:"column",md:"row"},justifyContent:"Space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:{xs:1.5,md:2.5},py:1,bgcolor:"#eeeeee"},children:[(0,U.jsxs)(x.A,{direction:"row",alignItems:"center",spacing:2,children:[(0,U.jsx)(A.A,{title:"back",children:(0,U.jsx)(w.A,{color:"primary",onClick:()=>{l("/nearle/invoice")},children:(0,U.jsx)(v.QVr,{size:"large"})})}),(0,U.jsxs)(x.A,{alignItems:"center",children:[(0,U.jsx)(j.A,{variant:"h3",color:"primary",children:"Invoice Details"}),(0,U.jsx)(C.A,{size:"small",color:"warning",variant:"outlined",sx:{bgcolor:V.palette.warning.lighter},label:"Invoice No :".concat("\xa0\xa0",e.invoiceno)})]})]}),(0,U.jsxs)(x.A,{direction:{xs:"column",sm:"row"},spacing:2,sx:{width:{xs:"100%",md:"auto"}},children:[(0,U.jsxs)(_.A,{variant:"outlined",color:"primary",fullWidth:J,sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},onClick:()=>{g(!0)},children:[" ",(0,U.jsx)(v.jtd,{}),"Update Payment"]}),(0,U.jsx)(b(),{trigger:()=>(0,U.jsx)(_.A,{size:"small",startIcon:(0,U.jsx)(m,{}),variant:"outlined",color:"primary",fullWidth:J,sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},children:"Print"}),content:()=>f.current})]})]}),(0,U.jsx)(P.A,{sx:{pb:2.5,border:"1px solid #eee",overflowX:{xs:"auto",md:"visible"}},children:(0,U.jsxs)("div",{ref:f,style:{width:"100%",minWidth:720},children:[(0,U.jsxs)(P.A,{id:"print",sx:{p:2.5},children:[(0,U.jsxs)(P.A,{sx:{pb:2.5},children:[(0,U.jsxs)(x.A,{sx:{flexDirection:"row",border:"1px solid #eee",px:3},justifyContent:"space-between",children:[(0,U.jsxs)(P.A,{sx:{pt:.5},children:[(0,U.jsxs)(x.A,{direction:"row",spacing:2,children:[(0,U.jsx)("img",{src:s,style:{width:"150px",height:"50px"}})," "]}),(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{sx:{overflow:"hidden",color:V.palette.primary.main},variant:"subtitle1",children:"Invoice No :"}),(0,U.jsx)(j.A,{sx:{color:V.palette.primary.main},children:"\xa0\xa0".concat(e.invoiceno)})]})]}),(0,U.jsxs)(P.A,{sx:{pt:2.5,pb:1.75},children:[(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsxs)(j.A,{sx:{pl:4,color:V.palette.primary.main},variant:"subtitle1",children:["Date :"," "]}),(0,U.jsx)(j.A,{sx:{color:V.palette.primary.main},children:u()(e.transactiondate).format("DD-MM-YYYY")})]}),(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{sx:{pr:2,overflow:"hidden",color:V.palette.primary.main},variant:"subtitle1",children:"Due Date :"}),(0,U.jsx)(j.A,{sx:{color:V.palette.primary.main},children:u()(e.dueDate).format("DD-MM-YYYY")})]})]})]}),(0,U.jsx)(P.A,{sx:{pt:2.5},children:(0,U.jsxs)(S.Ay,{container:!0,spacing:2,justifyContent:"space-between",direction:"row",children:[(0,U.jsx)(S.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(P.A,{sx:{border:1,minHeight:240,borderColor:"grey.200",borderRadius:.5,p:2.5},children:(0,U.jsx)(S.Ay,{container:!0,direction:"row",children:(0,U.jsx)(S.Ay,{item:!0,md:8,children:(0,U.jsxs)(x.A,{spacing:2,children:[(0,U.jsx)(j.A,{variant:"h5",children:"From:"}),(0,U.jsxs)(x.A,{sx:{width:"100%"},children:[(0,U.jsx)(j.A,{variant:"subtitle1",children:"Nearle Technology Privite Limited."}),(0,U.jsxs)(j.A,{color:"secondary",children:["424, 4",(0,U.jsx)("sup",{children:"th"}),"floor,"]}),(0,U.jsx)(j.A,{color:"secondary",children:"Red rose towers,"}),(0,U.jsx)(j.A,{color:"secondary",children:"DB Road, RS Puram,"}),(0,U.jsx)(j.A,{color:"secondary",children:"641002."}),(0,U.jsx)(j.A,{color:"secondary",children:"care@nearle.in"}),(0,U.jsx)(j.A,{color:"secondary",children:"9047968666"})]})]})})})})}),(0,U.jsx)(S.Ay,{item:!0,xs:12,sm:6,children:(0,U.jsx)(P.A,{sx:{border:1,minHeight:240,borderColor:"grey.200",borderRadius:.5,p:2.5},children:(0,U.jsx)(S.Ay,{container:!0,direction:"row",children:(0,U.jsx)(S.Ay,{item:!0,md:8,children:(0,U.jsxs)(x.A,{spacing:2,children:[(0,U.jsx)(j.A,{variant:"h5",children:"To:"}),(0,U.jsxs)(x.A,{sx:{width:"100%"},children:[(0,U.jsx)(j.A,{variant:"subtitle1",children:e.tenantname}),(0,U.jsx)(j.A,{color:"secondary",children:e.address}),(0,U.jsx)(j.A,{color:"secondary",children:e.suburb}),(0,U.jsx)(j.A,{color:"secondary",children:e.city}),(0,U.jsx)(j.A,{color:"secondary",children:e.state})," "]})]})})})})})]})})]}),(0,U.jsx)(T.A,{children:(0,U.jsxs)(O.A,{children:[(0,U.jsx)(D.A,{children:(0,U.jsxs)(E.A,{children:[(0,U.jsx)(k.A,{children:"S.No"}),(0,U.jsx)(k.A,{children:"Particulars"}),(0,U.jsx)(k.A,{children:"Unit"}),(0,U.jsx)(k.A,{children:"Quantity"}),(0,U.jsx)(k.A,{align:"right",children:"Rate"}),(0,U.jsx)(k.A,{align:"right",children:"Other Charges"}),(0,U.jsx)(k.A,{align:"right",children:"Amount"})]})}),e.tenantsalesdetails&&(0,U.jsx)(M.A,{children:(0,U.jsxs)(E.A,{children:[(0,U.jsx)(k.A,{children:"1"}),(0,U.jsx)(k.A,{children:(0,U.jsx)(j.A,{children:"Invoice from ".concat(u()(e.tenantsalesdetails[0].fromdate).format("DD-MM-YYYY")," to ").concat(u()(e.tenantsalesdetails[0].todate).format("DD-MM-YYYY"))})}),(0,U.jsx)(k.A,{children:(0,U.jsx)(j.A,{children:e.tenantsalesdetails[0].pricingtype})}),(0,U.jsx)(k.A,{children:(0,U.jsx)(j.A,{children:"".concat(e.tenantsalesdetails[0].quantity.toFixed(2)," km")})}),(0,U.jsx)(k.A,{children:(0,U.jsx)(j.A,{align:"right",children:"\u20b9 ".concat(e.tenantsalesdetails[0].baserate.toFixed(2))})}),(0,U.jsx)(k.A,{align:"right",children:(0,U.jsx)(j.A,{children:"\u20b9 ".concat(e.tenantsalesdetails[0].othercharges,".00")})}),(0,U.jsx)(k.A,{align:"right",children:(0,U.jsx)(j.A,{children:"\u20b9 ".concat(e.tenantsalesdetails[0].amount,".00")})})]})})]})}),(0,U.jsx)(R.A,{}),(0,U.jsx)(P.A,{sx:{p:2.5},children:(0,U.jsx)(S.Ay,{container:!0,direction:"row",justifyContent:"flex-end",children:(0,U.jsx)(S.Ay,{item:!0,md:4,children:(0,U.jsxs)(x.A,{spacing:2,children:[(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{color:"secondary",children:"Sub Total:"}),(0,U.jsx)(j.A,{variant:"h6",children:Q(e.salesamount)})]}),(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{color:"secondary",children:"Discount:"}),(0,U.jsxs)(j.A,{variant:"h6",color:V.palette.error.main,children:["- ",Q(e.discountamt)]})]}),(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{color:V.palette.grey[500],children:"Tax:"}),(0,U.jsxs)(j.A,{variant:"h6",color:V.palette.success.main,children:["+ ",Q(e.taxamount)]})]}),(0,U.jsxs)(x.A,{direction:"row",justifyContent:"space-between",children:[(0,U.jsx)(j.A,{sx:{pr:2},variant:"subtitle1",children:"Grand Total:"}),(0,U.jsx)(j.A,{variant:"h6",children:Q(Math.round(e.totalamount))})]})]})})})})]}),(0,U.jsx)(R.A,{}),(0,U.jsx)(P.A,{sx:{p:2.5},children:(0,U.jsxs)(j.A,{children:["Notes: ",e.remarks]})}),(0,U.jsx)(R.A,{})]})}),(0,U.jsxs)(Y.A,{open:y,onClose:()=>{g(!1)},maxWidth:"sm",fullWidth:!0,children:[(0,U.jsx)(N.A,{sx:{bgcolor:V.palette.primary.main},children:(0,U.jsxs)(x.A,{direction:"row",spacing:1,children:[(0,U.jsx)(j.A,{variant:"h2",sx:{color:"white"},children:"\u20b9"}),(0,U.jsx)(j.A,{variant:"h3",sx:{color:"white"},children:"Update Payment"})]})}),(0,U.jsxs)(F.A,{dividers:!0,children:[(0,U.jsxs)(x.A,{spacing:1,sx:{mb:2},children:[(0,U.jsx)(j.A,{children:"Reference No"}),(0,U.jsx)(I.A,{type:"number",placeholder:"Enter Reference Number",sx:{width:"100%"},onChange:e=>{B(e.target.value)}})]}),(0,U.jsxs)(x.A,{spacing:2,sx:{mb:2},children:[(0,U.jsx)(j.A,{children:"Remarks"}),(0,U.jsx)(I.A,{multiline:!0,required:!0,placeholder:"Enter Remarks",sx:{width:"100%"},onChange:e=>{L(e.target.value)}})]})]}),(0,U.jsxs)(q.A,{children:[(0,U.jsx)(_.A,{variant:"outlined",sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"},m:2},onClick:()=>{g(!1)},children:"Cancel"}),(0,U.jsx)(_.A,{variant:"outlined",disabled:""==z||""==G,sx:{"&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"},m:2},onClick:()=>{g(!1),(async()=>{try{const t=await c.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/invoice/updatestatus"),{salesid:e.salesid,referenceno:z,referencedate:u()().format("YYYY-MM-DD HH:mm:ss"),billstatus:2,paymentremarks:G});t.status&&(0,d.M8)(" Updated Successfully ",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),console.log("updateResponse",t)}catch(t){console.log("updateResponse",t)}})(),l("/nearle/invoice")},children:"Update"})]})]})]})}},45418:function(e,t,r){var n,o;"undefined"!=typeof self&&self,e.exports=(n=r(9950),o=r(17119),function(){"use strict";var e={328:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PrintContextConsumer=t.PrintContext=void 0;var n=r(496),o=Object.prototype.hasOwnProperty.call(n,"createContext");t.PrintContext=o?n.createContext({}):null,t.PrintContextConsumer=t.PrintContext?t.PrintContext.Consumer:function(){return null}},428:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactToPrint=void 0;var n=r(316),o=r(496),i=r(190),a=r(328),s=r(940),c=function(e){function t(){var t=e.apply(this,n.__spreadArray([],n.__read(arguments),!1))||this;return t.startPrint=function(e){var r=t.props,n=r.onAfterPrint,o=r.onPrintError,i=r.print,a=r.documentTitle;setTimeout((function(){var r,s;if(e.contentWindow)if(e.contentWindow.focus(),i)i(e).then((function(){return null==n?void 0:n()})).then((function(){return t.handleRemoveIframe()})).catch((function(e){o?o("print",e):t.logMessages(["An error was thrown by the specified `print` function"])}));else{if(e.contentWindow.print){var c=null!==(s=null===(r=e.contentDocument)||void 0===r?void 0:r.title)&&void 0!==s?s:"",l=e.ownerDocument.title;a&&(e.ownerDocument.title=a,e.contentDocument&&(e.contentDocument.title=a)),e.contentWindow.print(),a&&(e.ownerDocument.title=l,e.contentDocument&&(e.contentDocument.title=c))}else t.logMessages(["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."]);null==n||n(),t.handleRemoveIframe()}else t.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"])}),500)},t.triggerPrint=function(e){var r=t.props,n=r.onBeforePrint,o=r.onPrintError;if(n){var i=n();i&&"function"==typeof i.then?i.then((function(){t.startPrint(e)})).catch((function(e){o&&o("onBeforePrint",e)})):t.startPrint(e)}else t.startPrint(e)},t.handlePrint=function(e){var r=t.props,o=r.bodyClass,a=r.content,s=r.copyStyles,c=r.fonts,l=r.pageStyle,u=r.nonce,d="function"==typeof e?e():null;if(d&&"function"==typeof a&&t.logMessages(['"react-to-print" received a `content` prop and a content param passed the callback return by `useReactToPrint. The `content` prop will be ignored.'],"warning"),d||"function"!=typeof a||(d=a()),void 0!==d)if(null!==d){var f=document.createElement("iframe");f.width="".concat(document.documentElement.clientWidth,"px"),f.height="".concat(document.documentElement.clientHeight,"px"),f.style.position="absolute",f.style.top="-".concat(document.documentElement.clientHeight+100,"px"),f.style.left="-".concat(document.documentElement.clientWidth+100,"px"),f.id="printWindow",f.srcdoc="";var p=(0,i.findDOMNode)(d);if(p){var h=p.cloneNode(!0),y=h instanceof Text,m=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),g=y?[]:h.querySelectorAll("img"),b=y?[]:h.querySelectorAll("video"),v=c?c.length:0;t.numResourcesToLoad=m.length+g.length+b.length+v,t.resourcesLoaded=[],t.resourcesErrored=[];var x=function(e,r){t.resourcesLoaded.includes(e)?t.logMessages(["Tried to mark a resource that has already been handled",e],"debug"):(r?(t.logMessages(n.__spreadArray(['"react-to-print" was unable to load a resource but will continue attempting to print the page'],n.__read(r),!1)),t.resourcesErrored.push(e)):t.resourcesLoaded.push(e),t.resourcesLoaded.length+t.resourcesErrored.length===t.numResourcesToLoad&&t.triggerPrint(f))};f.onload=function(){var e,r,i,a;f.onload=null;var d=f.contentDocument||(null===(r=f.contentWindow)||void 0===r?void 0:r.document);if(d){d.body.appendChild(h),c&&((null===(i=f.contentDocument)||void 0===i?void 0:i.fonts)&&(null===(a=f.contentWindow)||void 0===a?void 0:a.FontFace)?c.forEach((function(e){var t=new FontFace(e.family,e.source,{weight:e.weight,style:e.style});f.contentDocument.fonts.add(t),t.loaded.then((function(){x(t)})).catch((function(e){x(t,["Failed loading the font:",t,"Load error:",e])}))})):(c.forEach((function(e){return x(e)})),t.logMessages(['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'])));var m="function"==typeof l?l():l;if("string"!=typeof m)t.logMessages(['"react-to-print" expected a "string" from `pageStyle` but received "'.concat(typeof m,'". Styles from `pageStyle` will not be applied.')]);else{var v=d.createElement("style");u&&(v.setAttribute("nonce",u),d.head.setAttribute("nonce",u)),v.appendChild(d.createTextNode(m)),d.head.appendChild(v)}if(o&&(e=d.body.classList).add.apply(e,n.__spreadArray([],n.__read(o.split(" ")),!1)),!y){for(var A=y?[]:p.querySelectorAll("canvas"),w=d.querySelectorAll("canvas"),j=0;j",t,"Error",i])},n.src=r}else x(t,['Found an tag with an empty "src" attribute. This prevents pre-loading it. The is:',t])};for(j=0;j=2?x(t):(t.onloadeddata=function(){return x(t)},t.onerror=function(e,r,n,o,i){return x(t,["Error loading video",t,"Error",i])},t.onstalled=function(){return x(t,["Loading video stalled, skipping",t])})};for(j=0;j tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The is:",n],"warning"),x(n);else{for(var l=d.createElement(n.tagName),f=(c=0,n.attributes.length);c tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the was not loaded. The is:",n],"warning"),x(n)},q=(j=0,F.length);j=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,r[p])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(d.get=s),(s=a(m.set))&&(d.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===c?o.unshift(s):d[l]=s)}u&&Object.defineProperty(u,n.name,d),f=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function x(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(r=o[e](t)).value instanceof j?Promise.resolve(r.value.v).then(c,l):u(i[0][2],r)}catch(e){u(i[0][3],e)}var r}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function _(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:j(e[n](t)),done:!1}:o?o(t):t}:o}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,o,(t=e[r](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&m(t,e,r);return T(t,e),t}function D(e){return e&&e.__esModule?e:{default:e}}function E(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function k(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function R(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Y="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function N(e){function t(t){e.error=e.hasError?new Y(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:p,__awaiter:h,__generator:y,__createBinding:m,__exportStar:g,__values:b,__read:v,__spread:x,__spreadArrays:A,__spreadArray:w,__await:j,__asyncGenerator:C,__asyncDelegator:_,__asyncValues:P,__makeTemplateObject:S,__importStar:O,__importDefault:D,__classPrivateFieldGet:E,__classPrivateFieldSet:k,__classPrivateFieldIn:M,__addDisposableResource:R,__disposeResources:N}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.useReactToPrint=e.ReactToPrint=e.PrintContextConsumer=void 0;var t=r(328);Object.defineProperty(e,"PrintContextConsumer",{enumerable:!0,get:function(){return t.PrintContextConsumer}});var n=r(428);Object.defineProperty(e,"ReactToPrint",{enumerable:!0,get:function(){return n.ReactToPrint}});var o=r(892);Object.defineProperty(e,"useReactToPrint",{enumerable:!0,get:function(){return o.useReactToPrint}});var a=r(428);e.default=a.ReactToPrint}(),i}())},79739:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(98587),o=r(58168),i=r(9950),a=r(72004),s=r(3484),c=r(59254),l=r(18463),u=r(45558),d=r(1614);function f(e){return(0,d.Ay)("MuiDialogActions",e)}(0,u.A)("MuiDialogActions",["root","spacing"]);var p=r(44414);const h=["className","disableSpacing"],y=(0,c.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,o.A)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),m=i.forwardRef((function(e,t){const r=(0,l.b)({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:c=!1}=r,u=(0,n.A)(r,h),d=(0,o.A)({},r,{disableSpacing:c}),m=(e=>{const{classes:t,disableSpacing:r}=e,n={root:["root",!r&&"spacing"]};return(0,s.A)(n,f,t)})(d);return(0,p.jsx)(y,(0,o.A)({className:(0,a.A)(m.root,i),ownerState:d,ref:t},u))}))}}]); \ No newline at end of file diff --git a/build/static/js/main.ef31e0ac.js b/build/static/js/main.f1cf61c1.js similarity index 99% rename from build/static/js/main.ef31e0ac.js rename to build/static/js/main.f1cf61c1.js index 372b1d3..7e8e3e7 100644 --- a/build/static/js/main.ef31e0ac.js +++ b/build/static/js/main.f1cf61c1.js @@ -1,2 +1,2 @@ -/*! For license information please see main.ef31e0ac.js.LICENSE.txt */ -(()=>{var e={249:(e,t,n)=>{"use strict";n.d(t,{A:()=>v});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(59254),c=n(18463),u=n(13372),d=n(45558),f=n(1614);function p(e){return(0,f.Ay)("MuiList",e)}(0,d.A)("MuiList",["root","padding","dense","subheader"]);var h=n(44414);const m=["children","className","component","dense","disablePadding","subheader"],g=(0,l.Ay)("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})((e=>{let{ownerState:t}=e;return(0,o.A)({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})})),v=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiList"}),{children:l,className:d,component:f="ul",dense:v=!1,disablePadding:y=!1,subheader:b}=n,w=(0,r.A)(n,m),A=i.useMemo((()=>({dense:v})),[v]),x=(0,o.A)({},n,{component:f,dense:v,disablePadding:y}),S=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e,i={root:["root",!n&&"padding",r&&"dense",o&&"subheader"]};return(0,s.A)(i,p,t)})(x);return(0,h.jsx)(u.A.Provider,{value:A,children:(0,h.jsxs)(g,(0,o.A)({as:f,className:(0,a.A)(S.root,d),ref:t,ownerState:x},w,{children:[b,l]}))})}))},1018:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;td,Gh:()=>j,HS:()=>L,Oi:()=>s,Rr:()=>f,pX:()=>F,pb:()=>_,rc:()=>o,tH:()=>D,ue:()=>m,yD:()=>I,zR:()=>a}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));const i="popstate";function a(e){return void 0===e&&(e={}),p((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return u("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:d(t)}),null,e)}function s(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function l(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,t,n,o){return void 0===n&&(n=null),r({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?f(t):t,{state:n,key:t&&t.key||o||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function f(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function p(e,t,n,a){void 0===a&&(a={});let{window:l=document.defaultView,v5Compat:f=!1}=a,p=l.history,h=o.Pop,m=null,g=v();function v(){return(p.state||{idx:null}).idx}function y(){h=o.Pop;let e=v(),t=null==e?null:e-g;g=e,m&&m({action:h,location:w.location,delta:t})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"===typeof e?e:d(e);return n=n.replace(/ $/,"%20"),s(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,p.replaceState(r({},p.state,{idx:g}),""));let w={get action(){return h},get location(){return e(l,p)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(i,y),m=e,()=>{l.removeEventListener(i,y),m=null}},createHref:e=>t(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h=o.Push;let r=u(w.location,e,t);n&&n(r,e),g=v()+1;let i=c(r,g),a=w.createHref(r);try{p.pushState(i,"",a)}catch(s){if(s instanceof DOMException&&"DataCloneError"===s.name)throw s;l.location.assign(a)}f&&m&&m({action:h,location:w.location,delta:1})},replace:function(e,t){h=o.Replace;let r=u(w.location,e,t);n&&n(r,e),g=v();let i=c(r,g),a=w.createHref(r);p.replaceState(i,"",a),f&&m&&m({action:h,location:w.location,delta:0})},go:e=>p.go(e)};return w}var h;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(h||(h={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function m(e,t,n){return void 0===n&&(n="/"),g(e,t,n,!1)}function g(e,t,n,r){let o=_(("string"===typeof t?f(t):t).pathname||"/",n);if(null==o)return null;let i=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let a=null;for(let s=0;null==a&&s{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(s(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=L([r,a.relativePath]),c=n.concat(a);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),v(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:C(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of y(e.path))o(e,t,r);else o(e,t)})),t}function y(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=y(r.join("/")),s=[];return s.push(...a.map((e=>""===e?i:[i,e].join("/")))),o&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const b=/^:[\w-]+$/,w=3,A=2,x=1,S=10,E=-2,k=e=>"*"===e;function C(e,t){let n=e.split("/"),r=n.length;return n.some(k)&&(r+=E),t&&(r+=A),n.filter((e=>!k(e))).reduce(((e,t)=>e+(b.test(t)?w:""===t?x:S)),r)}function O(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=s[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=o&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:a,pattern:e}}function R(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function _(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function M(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function P(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function I(e,t){let n=P(e);return t?n.map(((e,t)=>t===n.length-1?e.pathname:e.pathnameBase)):n.map((e=>e.pathnameBase))}function j(e,t,n,o){let i;void 0===o&&(o=!1),"string"===typeof e?i=f(e):(i=r({},e),s(!i.pathname||!i.pathname.includes("?"),M("?","pathname","search",i)),s(!i.pathname||!i.pathname.includes("#"),M("#","pathname","hash",i)),s(!i.search||!i.search.includes("#"),M("#","search","hash",i)));let a,l=""===e||""===i.pathname,c=l?"/":i.pathname;if(null==c)a=n;else{let e=t.length-1;if(!o&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"===typeof e?f(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:B(r),hash:z(o)}}(i,a),d=c&&"/"!==c&&c.endsWith("/"),p=(l||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!p||(u.pathname+="/"),u}const L=e=>e.join("/").replace(/\/\/+/g,"/"),N=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",z=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class D extends Error{}function F(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const H=["post","put","patch","delete"],W=(new Set(H),["get",...H]);new Set(W),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},1352:(e,t,n)=>{"use strict";var r=n(17119);t.H=r.createRoot,r.hydrateRoot},1614:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>i});var r=n(41644);const o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const i=o[t];return i?"".concat(n,"-").concat(i):"".concat(r.A.generate(e),"-").concat(t)}},1849:(e,t,n)=>{"use strict";n.d(t,{A:()=>He});var r=n(58168),o=n(98587),i=n(25329),a=n(9950),s=n(49456),l=n(95034),c=n(61262);function u(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof u(e).Element||e instanceof Element}function f(e){return e instanceof u(e).HTMLElement||e instanceof HTMLElement}function p(e){return"undefined"!==typeof ShadowRoot&&(e instanceof u(e).ShadowRoot||e instanceof ShadowRoot)}var h=Math.max,m=Math.min,g=Math.round;function v(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function y(){return!/^((?!chrome|android).)*safari/i.test(v())}function b(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&f(e)&&(o=e.offsetWidth>0&&g(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&g(r.height)/e.offsetHeight||1);var a=(d(e)?u(e):window).visualViewport,s=!y()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,p=r.width/o,h=r.height/i;return{width:p,height:h,top:c,right:l+p,bottom:c+h,left:l,x:l,y:c}}function w(e){var t=u(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function A(e){return e?(e.nodeName||"").toLowerCase():null}function x(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return b(x(e)).left+w(e).scrollLeft}function E(e){return u(e).getComputedStyle(e)}function k(e){var t=E(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function C(e,t,n){void 0===n&&(n=!1);var r=f(t),o=f(t)&&function(e){var t=e.getBoundingClientRect(),n=g(t.width)/e.offsetWidth||1,r=g(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=x(t),a=b(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==A(t)||k(i))&&(s=function(e){return e!==u(e)&&f(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:w(e);var t}(t)),f(t)?((l=b(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=S(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function O(e){var t=b(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function T(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(p(e)?e.host:null)||x(e)}function R(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:f(e)&&k(e)?e:R(T(e))}function _(e,t){var n;void 0===t&&(t=[]);var r=R(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=u(r),a=o?[i].concat(i.visualViewport||[],k(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(_(T(a)))}function M(e){return["table","td","th"].indexOf(A(e))>=0}function P(e){return f(e)&&"fixed"!==E(e).position?e.offsetParent:null}function I(e){for(var t=u(e),n=P(e);n&&M(n)&&"static"===E(n).position;)n=P(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===E(n).position)?t:n||function(e){var t=/firefox/i.test(v());if(/Trident/i.test(v())&&f(e)&&"fixed"===E(e).position)return null;var n=T(e);for(p(n)&&(n=n.host);f(n)&&["html","body"].indexOf(A(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var j="top",L="bottom",N="right",B="left",z="auto",D=[j,L,N,B],F="start",H="end",W="viewport",U="popper",V=D.reduce((function(e,t){return e.concat([t+"-"+F,t+"-"+H])}),[]),G=[].concat(D,[z]).reduce((function(e,t){return e.concat([t,t+"-"+F,t+"-"+H])}),[]),q=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function K(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function X(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Y={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?$(o):null,a=o?ee(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case j:t={x:s,y:n.y-r.height};break;case L:t={x:s,y:n.y+n.height};break;case N:t={x:n.x+n.width,y:l};break;case B:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?te(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case F:t[c]=t[c]-(n[u]/2-r[u]/2);break;case H:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var re={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oe(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,f=e.isFixed,p=a.x,h=void 0===p?0:p,m=a.y,v=void 0===m?0:m,y="function"===typeof d?d({x:h,y:v}):{x:h,y:v};h=y.x,v=y.y;var b=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),A=B,S=j,k=window;if(c){var C=I(n),O="clientHeight",T="clientWidth";if(C===u(n)&&"static"!==E(C=x(n)).position&&"absolute"===s&&(O="scrollHeight",T="scrollWidth"),o===j||(o===B||o===N)&&i===H)S=L,v-=(f&&C===k&&k.visualViewport?k.visualViewport.height:C[O])-r.height,v*=l?1:-1;if(o===B||(o===j||o===L)&&i===H)A=N,h-=(f&&C===k&&k.visualViewport?k.visualViewport.width:C[T])-r.width,h*=l?1:-1}var R,_=Object.assign({position:s},c&&re),M=!0===d?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:g(n*o)/o||0,y:g(r*o)/o||0}}({x:h,y:v},u(n)):{x:h,y:v};return h=M.x,v=M.y,l?Object.assign({},_,((R={})[S]=w?"0":"",R[A]=b?"0":"",R.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",R)):Object.assign({},_,((t={})[S]=w?v+"px":"",t[A]=b?h+"px":"",t.transform="",t))}const ie={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=G.reduce((function(e,n){return e[n]=function(e,t,n){var r=$(e),o=[B,j].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[B,N].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var ae={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ae[e]}))}var le={start:"end",end:"start"};function ce(e){return e.replace(/start|end/g,(function(e){return le[e]}))}function ue(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function de(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fe(e,t,n){return t===W?de(function(e,t){var n=u(e),r=x(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=y();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+S(e),y:l}}(e,n)):d(t)?function(e,t){var n=b(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):de(function(e){var t,n=x(e),r=w(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=h(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=h(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+S(e),l=-r.scrollTop;return"rtl"===E(o||n).direction&&(s+=h(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(x(e)))}function pe(e,t,n,r){var o="clippingParents"===t?function(e){var t=_(T(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&f(e)?I(e):e;return d(n)?t.filter((function(e){return d(e)&&ue(e,n)&&"body"!==A(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=fe(e,n,r);return t.top=h(o.top,t.top),t.right=m(o.right,t.right),t.bottom=m(o.bottom,t.bottom),t.left=h(o.left,t.left),t}),fe(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function he(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function me(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ge(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?W:c,f=n.elementContext,p=void 0===f?U:f,h=n.altBoundary,m=void 0!==h&&h,g=n.padding,v=void 0===g?0:g,y=he("number"!==typeof v?v:me(v,D)),w=p===U?"reference":U,A=e.rects.popper,S=e.elements[m?w:p],E=pe(d(S)?S:S.contextElement||x(e.elements.popper),l,u,a),k=b(e.elements.reference),C=ne({reference:k,element:A,strategy:"absolute",placement:o}),O=de(Object.assign({},A,C)),T=p===U?O:k,R={top:E.top-T.top+y.top,bottom:T.bottom-E.bottom+y.bottom,left:E.left-T.left+y.left,right:T.right-E.right+y.right},_=e.modifiersData.offset;if(p===U&&_){var M=_[o];Object.keys(R).forEach((function(e){var t=[N,L].indexOf(e)>=0?1:-1,n=[j,L].indexOf(e)>=0?"y":"x";R[e]+=M[n]*t}))}return R}function ve(e,t,n){return h(e,m(t,n))}const ye={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,g=n.tetherOffset,v=void 0===g?0:g,y=ge(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=$(t.placement),w=ee(t.placement),A=!w,x=te(b),S="x"===x?"y":"x",E=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,T="function"===typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,R="number"===typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(E){if(i){var P,z="y"===x?j:B,D="y"===x?L:N,H="y"===x?"height":"width",W=E[x],U=W+y[z],V=W-y[D],G=p?-C[H]/2:0,q=w===F?k[H]:C[H],K=w===F?-C[H]:-k[H],X=t.elements.arrow,Y=p&&X?O(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Q[z],J=Q[D],ne=ve(0,k[H],Y[H]),re=A?k[H]/2-G-ne-Z-R.mainAxis:q-ne-Z-R.mainAxis,oe=A?-k[H]/2+G+ne+J+R.mainAxis:K+ne+J+R.mainAxis,ie=t.elements.arrow&&I(t.elements.arrow),ae=ie?"y"===x?ie.clientTop||0:ie.clientLeft||0:0,se=null!=(P=null==_?void 0:_[x])?P:0,le=W+oe-se,ce=ve(p?m(U,W+re-se-ae):U,W,p?h(V,le):V);E[x]=ce,M[x]=ce-W}if(s){var ue,de="x"===x?j:B,fe="x"===x?L:N,pe=E[S],he="y"===S?"height":"width",me=pe+y[de],ye=pe-y[fe],be=-1!==[j,B].indexOf(b),we=null!=(ue=null==_?void 0:_[S])?ue:0,Ae=be?me:pe-k[he]-C[he]-we+R.altAxis,xe=be?pe+k[he]+C[he]-we-R.altAxis:ye,Se=p&&be?function(e,t,n){var r=ve(e,t,n);return r>n?n:r}(Ae,pe,xe):ve(p?Ae:me,pe,p?xe:ye);E[S]=Se,M[S]=Se-pe}t.modifiersData[r]=M}},requiresIfExists:["offset"]};const be={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=$(n.placement),l=te(s),c=[B,N].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return he("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:me(e,D))}(o.padding,n),d=O(i),f="y"===l?j:B,p="y"===l?L:N,h=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],m=a[l]-n.rects.reference[l],g=I(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=h/2-m/2,b=u[f],w=v-d[c]-u[p],A=v/2-d[c]/2+y,x=ve(b,A,w),S=l;n.modifiersData[r]=((t={})[S]=x,t.centerOffset=x-A,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&ue(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function we(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ae(e){return[j,N,L,B].some((function(t){return e[t]>=0}))}var xe=Z({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=u(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,J)})),s&&l.addEventListener("resize",n.update,J),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,J)})),s&&l.removeEventListener("resize",n.update,J)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:$(t.placement),variation:ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,oe(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,oe(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];f(o)&&A(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});f(r)&&A(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},ie,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,v=$(g),y=l||(v===g||!h?[se(g)]:function(e){if($(e)===z)return[];var t=se(e);return[ce(e),t,ce(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat($(n)===z?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?G:l,u=ee(r),d=u?s?V:V.filter((function(e){return ee(e)===u})):D,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=ge(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[$(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,A=t.rects.popper,x=new Map,S=!0,E=b[0],k=0;k=0,_=R?"width":"height",M=ge(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),P=R?T?N:B:T?L:j;w[_]>A[_]&&(P=se(P));var I=se(P),H=[];if(i&&H.push(M[O]<=0),s&&H.push(M[P]<=0,M[I]<=0),H.every((function(e){return e}))){E=C,S=!1;break}x.set(C,H)}if(S)for(var W=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===W(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ye,be,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ge(t,{elementContext:"reference"}),s=ge(t,{altBoundary:!0}),l=we(a,r),c=we(s,o,i),u=Ae(l),d=Ae(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),Se=n(3484),Ee=n(70134),ke=n(96039),Ce=n(45558),Oe=n(1614);function Te(e){return(0,Oe.Ay)("MuiPopper",e)}(0,Ce.A)("MuiPopper",["root"]);var Re=n(44414);const _e=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],Me=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function Pe(e){return"function"===typeof e?e():e}function Ie(e){return void 0!==e.nodeType}const je={},Le=a.forwardRef((function(e,t){var n;const{anchorEl:i,children:c,direction:u,disablePortal:d,modifiers:f,open:p,placement:h,popperOptions:m,popperRef:g,slotProps:v={},slots:y={},TransitionProps:b}=e,w=(0,o.A)(e,_e),A=a.useRef(null),x=(0,s.A)(A,t),S=a.useRef(null),E=(0,s.A)(S,g),k=a.useRef(E);(0,l.A)((()=>{k.current=E}),[E]),a.useImperativeHandle(g,(()=>S.current),[]);const C=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(h,u),[O,T]=a.useState(C),[R,_]=a.useState(Pe(i));a.useEffect((()=>{S.current&&S.current.forceUpdate()})),a.useEffect((()=>{i&&_(Pe(i))}),[i]),(0,l.A)((()=>{if(!R||!p)return;let e=[{name:"preventOverflow",options:{altBoundary:d}},{name:"flip",options:{altBoundary:d}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:e=>{let{state:t}=e;T(t.placement)}}];null!=f&&(e=e.concat(f)),m&&null!=m.modifiers&&(e=e.concat(m.modifiers));const t=xe(R,A.current,(0,r.A)({placement:C},m,{modifiers:e}));return k.current(t),()=>{t.destroy(),k.current(null)}}),[R,d,f,p,m,C]);const M={placement:O};null!==b&&(M.TransitionProps=b);const P=(e=>{const{classes:t}=e;return(0,Se.A)({root:["root"]},Te,t)})(e),I=null!=(n=y.root)?n:"div",j=(0,Ee.A)({elementType:I,externalSlotProps:v.root,externalForwardedProps:w,additionalProps:{role:"tooltip",ref:x},ownerState:e,className:P.root});return(0,Re.jsx)(I,(0,r.A)({},j,{children:"function"===typeof c?c(M):c}))})),Ne=a.forwardRef((function(e,t){const{anchorEl:n,children:i,container:s,direction:l="ltr",disablePortal:u=!1,keepMounted:d=!1,modifiers:f,open:p,placement:h="bottom",popperOptions:m=je,popperRef:g,style:v,transition:y=!1,slotProps:b={},slots:w={}}=e,A=(0,o.A)(e,Me),[x,S]=a.useState(!0);if(!d&&!p&&(!y||x))return null;let E;if(s)E=s;else if(n){const e=Pe(n);E=e&&Ie(e)?(0,c.A)(e).body:(0,c.A)(null).body}const k=p||!d||y&&!x?void 0:"none",C=y?{in:p,onEnter:()=>{S(!1)},onExited:()=>{S(!0)}}:void 0;return(0,Re.jsx)(ke.A,{disablePortal:u,container:E,children:(0,Re.jsx)(Le,(0,r.A)({anchorEl:n,direction:l,disablePortal:u,modifiers:f,ref:t,open:y?!x:p,placement:h,popperOptions:m,popperRef:g,slotProps:b,slots:w},A,{style:(0,r.A)({position:"fixed",top:0,left:0,display:k},v),TransitionProps:C,children:i}))})}));var Be=n(59254),ze=n(18463);const De=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Fe=(0,Be.Ay)(Ne,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),He=a.forwardRef((function(e,t){var n;const a=(0,i.A)(),s=(0,ze.b)({props:e,name:"MuiPopper"}),{anchorEl:l,component:c,components:u,componentsProps:d,container:f,disablePortal:p,keepMounted:h,modifiers:m,open:g,placement:v,popperOptions:y,popperRef:b,transition:w,slots:A,slotProps:x}=s,S=(0,o.A)(s,De),E=null!=(n=null==A?void 0:A.root)?n:null==u?void 0:u.Root,k=(0,r.A)({anchorEl:l,container:f,disablePortal:p,keepMounted:h,modifiers:m,open:g,placement:v,popperOptions:y,popperRef:b,transition:w},S);return(0,Re.jsx)(Fe,(0,r.A)({as:c,direction:null==a?void 0:a.direction,slots:{root:E},slotProps:null!=x?x:d},k,{ref:t}))}))},1976:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(59520).A},2235:(e,t,n)=>{"use strict";n.d(t,{A:()=>y});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(99269),c=n(59254);const u=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};var d=n(18463),f=n(45558),p=n(1614);function h(e){return(0,p.Ay)("MuiPaper",e)}(0,f.A)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var m=n(44414);const g=["className","component","elevation","square","variant"],v=(0,c.Ay)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t["elevation".concat(n.elevation)]]}})((e=>{let{theme:t,ownerState:n}=e;var r;return(0,o.A)({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!n.square&&{borderRadius:t.shape.borderRadius},"outlined"===n.variant&&{border:"1px solid ".concat((t.vars||t).palette.divider)},"elevation"===n.variant&&(0,o.A)({boxShadow:(t.vars||t).shadows[n.elevation]},!t.vars&&"dark"===t.palette.mode&&{backgroundImage:"linear-gradient(".concat((0,l.X4)("#fff",u(n.elevation)),", ").concat((0,l.X4)("#fff",u(n.elevation)),")")},t.vars&&{backgroundImage:null==(r=t.vars.overlays)?void 0:r[n.elevation]}))})),y=i.forwardRef((function(e,t){const n=(0,d.b)({props:e,name:"MuiPaper"}),{className:i,component:l="div",elevation:c=1,square:u=!1,variant:f="elevation"}=n,p=(0,r.A)(n,g),y=(0,o.A)({},n,{component:l,elevation:c,square:u,variant:f}),b=(e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded","elevation"===r&&"elevation".concat(n)]};return(0,s.A)(i,h,o)})(y);return(0,m.jsx)(v,(0,o.A)({as:l,ownerState:y,className:(0,a.A)(b.root,i),ref:t},p))}))},2887:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t)=>{switch(t){case"secondary":return e.palette.secondary;case"error":return e.palette.error;case"warning":return e.palette.warning;case"info":return e.palette.info;case"success":return e.palette.success;default:return e.palette.primary}}},3484:(e,t,n)=>{"use strict";function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r={};return Object.keys(e).forEach((o=>{r[o]=e[o].reduce(((e,r)=>{if(r){const o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}n.d(t,{A:()=>r})},3888:(e,t,n)=>{"use strict";function r(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}n.d(t,{A:()=>r})},3911:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(58168),o=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};var a=n(61187),s=function(e,t){return o.createElement(a.A,(0,r.A)({},e,{ref:t,icon:i}))};const l=o.forwardRef(s)},4635:(e,t,n)=>{var r=n(14759).Symbol;e.exports=r},6171:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,b:()=>s});var r=n(9950),o=n(73808),i=n(44414);const a=r.createContext(void 0);function s(e){let{props:t,name:n}=e;return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?(0,o.A)(i.defaultProps,r):i.styleOverrides||i.variants?r:(0,o.A)(i,r)}({props:t,name:n,theme:{components:r.useContext(a)}})}const l=function(e){let{value:t,children:n}=e;return(0,i.jsx)(a.Provider,{value:t,children:n})}},6538:(e,t,n)=>{"use strict";e.exports=n(60759)},7148:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(12860),o=n(90357);const i=(0,r.A)();const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,o.A)(e)}},8195:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},8881:(e,t,n)=>{"use strict";n.d(t,{n:()=>He,mk:()=>_e,M8:()=>Re});var r=n(9950),o=n(17119);function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||s,c=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,u=/\/\*[^]*?\*\/| +/g,d=/\n+/g,f=(e,t)=>{let n="",r="",o="";for(let i in e){let a=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+a+";":r+="f"==i[1]?f(a,i):i+"{"+f(a,"k"==i[1]?"":t)+"}":"object"==typeof a?r+=f(a,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=a&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=f.p?f.p(i,a):i+":"+a+";")}return n+(t&&o?t+"{"+o+"}":o)+r},p={},h=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+h(e[n]);return t}return e},m=(e,t,n,r,o)=>{let i=h(e),a=p[i]||(p[i]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(i));if(!p[a]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=c.exec(e.replace(u,""));)t[4]?r.shift():t[3]?(n=t[3].replace(d," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(d," ").trim();return r[0]})(e);p[a]=f(o?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&p.g?p.g:null;return n&&(p.g=p[a]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(p[a],t,r,s),a};function g(e){let t=this||{},n=e.call?e(t.p):e;return m(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":f(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,l(t.target),t.g,t.o,t.k)}g.bind({g:1}),g.bind({k:1});function v(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var S=function(){return""},E=r.createContext({enqueueSnackbar:S,closeSnackbar:S}),k="@media (max-width:599.95px)",C="@media (min-width:600px)",O=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},T=function(e){return""+O(e.vertical)+O(e.horizontal)},R=function(e){return!!e||0===e},_="unmounted",M="exited",P="entering",I="entered",j="exiting",L=function(e){function t(t){var n;n=e.call(this,t)||this;var r,o=t.appear;return n.appearStatus=null,t.in?o?(r=M,n.appearStatus=P):r=I:r=t.unmountOnExit||t.mountOnEnter?_:M,n.state={status:r},n.nextCallback=null,n}w(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===_?{status:M}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==P&&n!==I&&(t=P):n!==P&&n!==I||(t=j)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!==typeof e&&"string"!==typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===P?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===M&&this.setState({status:_})},n.performEnter=function(e){var t=this,n=this.props.enter,r=e,o=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,r),this.safeSetState({status:P},(function(){t.props.onEntering&&t.props.onEntering(t.node,r),t.onTransitionEnd(o.enter,(function(){t.safeSetState({status:I},(function(){t.props.onEntered&&t.props.onEntered(t.node,r)}))}))}))):this.safeSetState({status:I},(function(){t.props.onEntered&&t.props.onEntered(t.node,r)}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:j},(function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:M},(function(){e.props.onExited&&e.props.onExited(e.node)}))}))}))):this.safeSetState({status:M},(function(){e.props.onExited&&e.props.onExited(e.node)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;this.node&&!n?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===_)return null;var t=this.props;return(0,t.children)(e,A(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},y(t,[{key:"node",get:function(){var e,t=null===(e=this.props.nodeRef)||void 0===e?void 0:e.current;if(!t)throw new Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(r.Component);function N(){}function B(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function z(e,t){return(0,r.useMemo)((function(){return null==e&&null==t?null:function(n){B(e,n),B(t,n)}}),[e,t])}function D(e){var t=e.timeout,n=e.style,r=void 0===n?{}:n,o=e.mode;return{duration:"object"===typeof t?t[o]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}L.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:N,onEntering:N,onEntered:N,onExit:N,onExiting:N,onExited:N};var F="cubic-bezier(0.4, 0, 0.2, 1)",H="cubic-bezier(0.0, 0, 0.2, 1)",W="cubic-bezier(0.4, 0, 0.6, 1)",U=function(e){e.scrollTop=e.scrollTop},V=function(e){return Math.round(e)+"ms"};function G(e,t){void 0===e&&(e=["all"]);var n=t||{},r=n.duration,o=void 0===r?300:r,i=n.easing,a=void 0===i?F:i,s=n.delay,l=void 0===s?0:s;return(Array.isArray(e)?e:[e]).map((function(e){var t="string"===typeof o?o:V(o),n="string"===typeof l?l:V(l);return e+" "+t+" "+a+" "+n})).join(",")}function q(e){var t=function(e){return e&&e.ownerDocument||document}(e);return t.defaultView||window}function K(e,t){if(t){var n=function(e,t){var n,r=t.getBoundingClientRect(),o=q(t);if(t.fakeTransform)n=t.fakeTransform;else{var i=o.getComputedStyle(t);n=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var a=0,s=0;if(n&&"none"!==n&&"string"===typeof n){var l=n.split("(")[1].split(")")[0].split(",");a=parseInt(l[4],10),s=parseInt(l[5],10)}switch(e){case"left":return"translateX("+(o.innerWidth+a-r.left)+"px)";case"right":return"translateX(-"+(r.left+r.width-a)+"px)";case"up":return"translateY("+(o.innerHeight+s-r.top)+"px)";default:return"translateY(-"+(r.top+r.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var X=(0,r.forwardRef)((function(e,t){var n=e.children,o=e.direction,i=void 0===o?"down":o,a=e.in,s=e.style,l=e.timeout,c=void 0===l?0:l,u=e.onEnter,d=e.onEntered,f=e.onExit,p=e.onExited,h=A(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),m=(0,r.useRef)(null),g=z(n.ref,m),v=z(g,t),y=(0,r.useCallback)((function(){m.current&&K(i,m.current)}),[i]);return(0,r.useEffect)((function(){if(!a&&"down"!==i&&"right"!==i){var e=function(e,t){var n;function r(){for(var r=this,o=arguments.length,i=new Array(o),a=0;a-1,i=e.snacks.findIndex(t)>-1;if(r||i)return e}return n.handleDisplaySnack(b({},e,{queue:[].concat(e.queue,[f])}))})),u},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?b({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some((function(e){return!e.open||e.requestClose})))return e;var t=!1,r=!1;e.snacks.reduce((function(e,t){return e+(t.open&&t.persist?1:0)}),0)===n.maxSnack&&(r=!0);var o=e.snacks.map((function(e){return t||e.persist&&!r?b({},e):(t=!0,e.entered?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),b({},e,{open:!1})):b({},e,{requestClose:!0}))}));return b({},e,{snacks:o})},n.handleEnteredSnack=function(e,t,r){if(!R(r))throw new Error("handleEnteredSnack Cannot be called with undefined key");n.setState((function(e){return{snacks:e.snacks.map((function(e){return e.id===r?b({},e,{entered:!0}):b({},e)}))}}))},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var o=void 0===r;n.setState((function(e){var t=e.snacks,n=e.queue;return{snacks:t.map((function(e){return o||e.id===r?e.entered?b({},e,{open:!1}):b({},e,{requestClose:!0}):b({},e)})),queue:n.filter((function(e){return e.id!==r}))}}))},n.closeSnackbar=function(e){var t=n.state.snacks.find((function(t){return t.id===e}));R(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!R(t))throw new Error("handleExitedSnack Cannot be called with undefined key");n.setState((function(e){var r=n.processQueue(b({},e,{snacks:e.snacks.filter((function(e){return e.id!==t}))}));return 0===r.queue.length?r:n.handleDismissOldest(r)}))},Re=n.enqueueSnackbar,_e=n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(x(n)),closeSnackbar:n.closeSnackbar.bind(x(n))}},n}return w(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,i=n.domRoot,a=n.children,s=n.dense,l=void 0!==s&&s,c=n.Components,u=void 0===c?{}:c,d=n.classes,f=this.state.snacks.reduce((function(e,t){var n,r=T(t.anchorOrigin),o=e[r]||[];return b({},e,((n={})[r]=[].concat(o,[t]),n))}),{}),p=Object.keys(f).map((function(t){var n=f[t],o=n[0];return r.createElement(De,{key:t,dense:l,anchorOrigin:o.anchorOrigin,classes:d},n.map((function(t){return r.createElement(Ie,{key:t.id,snack:t,classes:d,Component:u[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:he([e.handleExitedSnack,e.props.onExited],t.id),onEntered:he([e.handleEnteredSnack,e.props.onEntered],t.id)})})))}));return r.createElement(E.Provider,{value:t},a,i?(0,o.createPortal)(p,i):p)},y(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||ee.maxSnack}}]),t}(r.Component)},9083:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(58168),o=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"};var a=n(61187),s=function(e,t){return o.createElement(a.A,(0,r.A)({},e,{ref:t,icon:i}))};const l=o.forwardRef(s)},9417:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{A:()=>r})},9593:(e,t,n)=>{"use strict";var r=n(24994);t.A=void 0;var o=r(n(79526)),i=n(44414);t.A=(0,o.default)((0,i.jsx)("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff")},9845:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(58168),o=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var a=n(61187),s=function(e,t){return o.createElement(a.A,(0,r.A)({},e,{ref:t,icon:i}))};const l=o.forwardRef(s)},9950:(e,t,n)=>{"use strict";e.exports=n(32049)},10031:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(11942),o=n.n(r);const i=(e,t)=>{switch(t){case"secondary":return e.customShadows.secondary;case"error":return e.customShadows.error;case"warning":return e.customShadows.warning;case"info":return e.customShadows.info;case"success":return e.customShadows.success;case"primaryButton":return e.customShadows.primaryButton;case"secondaryButton":return e.customShadows.secondaryButton;case"errorButton":return e.customShadows.errorButton;case"warningButton":return e.customShadows.warningButton;case"infoButton":return e.customShadows.infoButton;case"successButton":return e.customShadows.successButton;default:return e.customShadows.primary}};i.propTypes={theme:o().object,shadow:o().string};const a=i},11359:(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:f(e)?2:p(e)?3:0}function l(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===s(e)?e.get(t):e[t]}function u(e,t,n){var r=s(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e){return W&&e instanceof Map}function p(e){return U&&e instanceof Set}function h(e){return e.o||e.t}function m(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Q(e);delete t[K];for(var n=Y(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=v),Object.freeze(e),t&&a(e,(function(e,t){return g(t,!0)}),!0)),e}function v(){r(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(e){var t=Z[e];return t||r(18,e),t}function w(e,t){Z[e]||(Z[e]=t)}function A(){return F}function x(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function S(e){E(e),e.p.forEach(C),e.p=null}function E(e){e===F&&(F=e.l)}function k(e){return F={p:[],l:F,h:e,m:!0,_:0}}function C(e){var t=e[K];0===t.i||1===t.i?t.j():t.g=!0}function O(e,t){t._=t.p.length;var n=t.p[0],o=void 0!==e&&e!==n;return t.h.O||b("ES5").S(t,e,o),o?(n[K].P&&(S(t),r(4)),i(e)&&(e=T(t,e),t.l||_(t,e)),t.u&&b("Patches").M(n[K].t,e,t.u,t.s)):e=T(t,n,[]),S(t),t.u&&t.v(t.u,t.s),e!==G?e:void 0}function T(e,t,n){if(y(t))return t;var r=t[K];if(!r)return a(t,(function(o,i){return R(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return _(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=m(r.k):r.o,i=o,s=!1;3===r.i&&(i=new Set(o),o.clear(),s=!0),a(i,(function(t,i){return R(e,r,o,t,i,n,s)})),_(e,o,!1),n&&e.u&&b("Patches").N(r,n,e.u,e.s)}return r.o}function R(e,t,n,r,a,s,c){if(o(a)){var d=T(e,a,s&&t&&3!==t.i&&!l(t.R,r)?s.concat(r):void 0);if(u(n,r,d),!o(d))return;e.m=!1}else c&&n.add(a);if(i(a)&&!y(a)){if(!e.h.D&&e._<1)return;T(e,a),t&&t.A.l||_(e,a)}}function _(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&g(t,n)}function M(e,t){var n=e[K];return(n?h(n):e)[t]}function P(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function I(e){e.P||(e.P=!0,e.l&&I(e.l))}function j(e){e.o||(e.o=m(e.t))}function L(e,t,n){var r=f(t)?b("MapSet").F(t,n):p(t)?b("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:A(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=J;n&&(o=[r],i=$);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):b("ES5").J(t,n);return(n?n.A:A()).p.push(r),r}function N(e){return o(e)||r(22,e),function e(t){if(!i(t))return t;var n,r=t[K],o=s(t);if(r){if(!r.P&&(r.i<4||!b("ES5").K(r)))return r.t;r.I=!0,n=B(t,o),r.I=!1}else n=B(t,o);return a(n,(function(t,o){r&&c(r.t,t)===o||u(n,t,e(o))})),3===o?new Set(n):n}(e)}function B(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return m(e)}function z(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[K];return J.get(t,e)},set:function(t){var n=this[K];J.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][K];if(!o.P)switch(o.i){case 5:r(o)&&I(o);break;case 4:n(o)&&I(o)}}}function n(e){for(var t=e.t,n=e.k,r=Y(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==K){var a=t[i];if(void 0===a&&!l(t,i))return!0;var s=n[i],c=s&&s[K];if(c?c.t!==a:!d(s,a))return!0}}var u=!!t[K];return r.length!==Y(t).length+(u?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;rTe,zD:()=>Be,Z0:()=>Me});var D,F,H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),W="undefined"!=typeof Map,U="undefined"!=typeof Set,V="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,G=H?Symbol.for("immer-nothing"):((D={})["immer-nothing"]=!0,D),q=H?Symbol.for("immer-draftable"):"__$immer_draftable",K=H?Symbol.for("immer-state"):"__$immer_state",X=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),Y="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Q=Object.getOwnPropertyDescriptors||function(e){var t={};return Y(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Z={},J={get:function(e,t){if(t===K)return e;var n=h(e);if(!l(n,t))return function(e,t,n){var r,o=P(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!i(r)?r:r===M(e.t,t)?(j(e),e.o[t]=L(e.A.h,r,e)):r},has:function(e,t){return t in h(e)},ownKeys:function(e){return Reflect.ownKeys(h(e))},set:function(e,t,n){var r=P(h(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=M(h(e),t),i=null==o?void 0:o[K];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(d(n,o)&&(void 0!==n||l(e.t,t)))return!0;j(e),I(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==M(e.t,t)||t in e.t?(e.R[t]=!1,j(e),I(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=h(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){r(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){r(12)}},$={};a(J,(function(e,t){$[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),$.deleteProperty=function(e,t){return $.set.call(this,e,t,void 0)},$.set=function(e,t,n){return J.set.call(this,e[0],t,n,e[0])};var ee=function(){function e(e){var t=this;this.O=V,this.D=!0,this.produce=function(e,n,o){if("function"==typeof e&&"function"!=typeof n){var a=n;n=e;var s=t;return function(e){var t=this;void 0===e&&(e=a);for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=b("Patches").$;return o(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),te=new ee,ne=te.produce;te.produceWithPatches.bind(te),te.setAutoFreeze.bind(te),te.setUseProxies.bind(te),te.applyPatches.bind(te),te.createDraft.bind(te),te.finishDraft.bind(te);const re=ne;var oe=n(58522);function ie(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var ae=ie();ae.withExtraArgument=ie;const se=ae;n(85224);var le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ce=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{e.exports=n(43488)()},12620:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"===typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}},12703:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,BO:()=>a,Yn:()=>i});var r=n(74840),o=n(28286);function i(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){const n="vars.".concat(t).split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function a(e,t,n){let r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||o:i(e,n)||o,t&&(r=t(r,o,e)),r}const s=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:s,transform:l}=e,c=e=>{if(null==e[t])return null;const c=e[t],u=i(e.theme,s)||{};return(0,o.NI)(e,c,(e=>{let o=a(u,l,e);return e===o&&"string"===typeof e&&(o=a(u,l,"".concat(t).concat("default"===e?"":(0,r.A)(e)),e)),!1===n?o:{[n]:o}}))};return c.propTypes={},c.filterProps=[t],c}},12860:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(58168),o=n(98587),i=n(22382),a=n(83628);const s={borderRadius:4};var l=n(47937);var c=n(70505),u=n(98076),d=n(30086);const f=["breakpoints","palette","spacing","shape"];const p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:n={},spacing:p,shape:h={}}=e,m=(0,o.A)(e,f),g=(0,a.A)(t),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=(0,l.LX)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r{const n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return n.mui=!0,n}(p);let y=(0,i.A)({breakpoints:g,direction:"ltr",components:{},palette:(0,r.A)({mode:"light"},n),spacing:v,shape:(0,r.A)({},s,h)},m);y.applyStyles=d.A;for(var b=arguments.length,w=new Array(b>1?b-1:0),A=1;A(0,i.A)(e,t)),y),y.unstable_sxConfig=(0,r.A)({},u.A,null==m?void 0:m.unstable_sxConfig),y.unstable_sx=function(e){return(0,c.A)({sx:e,theme:this})},y}},13292:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9950);const o=e=>{const t=r.useRef({});return r.useEffect((()=>{t.current=e})),t.current}},13372:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(9950).createContext({})},14195:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(59254),c=n(18463),u=n(92455),d=n(13372),f=n(44414);const p=["className"],h=(0,l.Ay)("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"flex-start"===n.alignItems&&t.alignItemsFlexStart]}})((e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===n.alignItems&&{marginTop:8})})),m=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiListItemIcon"}),{className:l}=n,m=(0,r.A)(n,p),g=i.useContext(d.A),v=(0,o.A)({},n,{alignItems:g.alignItems}),y=(e=>{const{alignItems:t,classes:n}=e,r={root:["root","flex-start"===t&&"alignItemsFlexStart"]};return(0,s.A)(r,u.f,n)})(v);return(0,f.jsx)(h,(0,o.A)({className:(0,a.A)(y.root,l),ownerState:v,ref:t},m))}))},14387:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(58168),o=n(98587),i=n(9950);const a=["getTrigger","target"];function s(e,t){const{disableHysteresis:n=!1,threshold:r=100,target:o}=t,i=e.current;return o&&(e.current=void 0!==o.pageYOffset?o.pageYOffset:o.scrollTop),!(!n&&void 0!==i&&e.currentr}const l="undefined"!==typeof window?window:null;function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{getTrigger:t=s,target:n=l}=e,c=(0,o.A)(e,a),u=i.useRef(),[d,f]=i.useState((()=>t(u,c)));return i.useEffect((()=>{const e=()=>{f(t(u,(0,r.A)({target:n},c)))};return e(),n.addEventListener("scroll",e,{passive:!0}),()=>{n.removeEventListener("scroll",e,{passive:!0})}}),[n,t,JSON.stringify(c)]),d}},14759:(e,t,n)=>{var r=n(16658),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},14857:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(9950);var r=n(7148),o=n(60195),i=n(67550);function a(){const e=(0,r.A)(o.A);return e[i.A]||e}},14919:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l,getFunctionName:()=>i});var r=n(86879);const o=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function i(e){const t="".concat(e).match(o);return t&&t[1]||""}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||i(e)||t}function s(e,t,n){const r=a(t);return e.displayName||(""!==r?"".concat(n,"(").concat(r,")"):n)}function l(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return a(e,"Component");if("object"===typeof e)switch(e.$$typeof){case r.vM:return s(e,e.render,"ForwardRef");case r.lD:return s(e,e.type,"memo");default:return}}}},15368:(e,t,n)=>{"use strict";n.d(t,{II:()=>u,v_:()=>s,wm:()=>c});var r=n(90698),o=n(98067),i=n(61664);function a(e){return Math.min(1e3*2**e,3e4)}function s(e){return"online"!==(null!==e&&void 0!==e?e:"online")||o.t.isOnline()}var l=class{constructor(e){this.revert=null===e||void 0===e?void 0:e.revert,this.silent=null===e||void 0===e?void 0:e.silent}};function c(e){return e instanceof l}function u(e){let t,n,c,u=!1,d=0,f=!1;const p=new Promise(((e,t)=>{n=e,c=t})),h=()=>!r.m.isFocused()||"always"!==e.networkMode&&!o.t.isOnline(),m=r=>{var o,i;f||(f=!0,null===(o=e.onSuccess)||void 0===o||o.call(e,r),null===(i=t)||void 0===i||i(),n(r))},g=n=>{var r,o;f||(f=!0,null===(r=e.onError)||void 0===r||r.call(e,n),null===(o=t)||void 0===o||o(),c(n))},v=()=>new Promise((n=>{var r;t=e=>{const t=f||!h();return t&&n(e),t},null===(r=e.onPause)||void 0===r||r.call(e)})).then((()=>{var n;(t=void 0,f)||(null===(n=e.onContinue)||void 0===n||n.call(e))})),y=()=>{if(f)return;let t;try{t=e.fn()}catch(n){t=Promise.reject(n)}Promise.resolve(t).then(m).catch((t=>{var n,r,o;if(f)return;const s=null!==(n=e.retry)&&void 0!==n?n:i.S$?0:3,l=null!==(r=e.retryDelay)&&void 0!==r?r:a,c="function"===typeof l?l(d,t):l,p=!0===s||"number"===typeof s&&d{if(h())return v()})).then((()=>{u?g(t):y()}))):g(t)}))};return s(e.networkMode)?y():v().then(y),{promise:p,cancel:t=>{var n;f||(g(new l(t)),null===(n=e.abort)||void 0===n||n.call(e))},continue:()=>{var e;return(null===(e=t)||void 0===e?void 0:e())?p:Promise.resolve()},cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1}}}},15441:(e,t,n)=>{"use strict";n.d(t,{Ht:()=>a,jE:()=>i});var r=n(9950),o=r.createContext(void 0),i=e=>{const t=r.useContext(o);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},a=e=>{let{client:t,children:n}=e;return r.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),r.createElement(o.Provider,{value:t},n)}},15941:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=e=>setTimeout(e,0);const i=r=>{t?e.push(r):o((()=>{n(r)}))},a=()=>{const t=e;e=[],t.length&&o((()=>{r((()=>{t.forEach((e=>{n(e)}))}))}))};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||a()}return n},batchCalls:e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r{e(...n)}))},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}()},16243:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>c,NL:()=>l,Ww:()=>s,dl:()=>i,ko:()=>o,lG:()=>a,qm:()=>r});const r="/sample-page",o=6,i=260,a={LIGHT:"light",DARK:"dark"},s={VERTICAL:"vertical",HORIZONTAL:"horizontal"},l={LTR:"ltr",RTL:"rtl"},c={fontFamily:"'Public Sans', sans-serif",i18n:"en",menuOrientation:s.VERTICAL,miniDrawer:!1,container:!0,mode:a.LIGHT,presetColor:"default",themeDirection:l.LTR}},16491:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(58168),o=n(98587),i=n(9950),a=n(72004),s=n(28843),l=n(70505),c=n(80237),u=n(7148),d=n(44414);const f=["className","component"];var p=n(41644),h=n(24436),m=n(67550);const g=(0,n(45558).A)("MuiBox",["root"]),v=(0,h.A)(),y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n,defaultClassName:p="MuiBox-root",generateClassName:h}=e,m=(0,s.default)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(l.A);return i.forwardRef((function(e,i){const s=(0,u.A)(n),l=(0,c.A)(e),{className:g,component:v="div"}=l,y=(0,o.A)(l,f);return(0,d.jsx)(m,(0,r.A)({as:v,ref:i,className:(0,a.A)(g,h?h(p):p),theme:t&&s[t]||s},y))}))}({themeId:m.A,defaultTheme:v,defaultClassName:g.root,generateClassName:p.A.generate}),b=y},16658:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},17119:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(38345)},17533:(e,t,n)=>{"use strict";var r=n(24994);t.A=void 0;var o=r(n(79526)),i=n(44414);t.A=(0,o.default)((0,i.jsx)("path",{d:"m17.27 6.73-4.24 10.13-1.32-3.42-.32-.83-.82-.32-3.43-1.33zM21 3 3 10.53v.98l6.84 2.65L12.48 21h.98z"}),"NearMeOutlined")},18463:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});n(9950);var r=n(6171);n(44414);function o(e){return(0,r.b)(e)}},19489:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(58168),o=n(98587),i=n(9950),a=n(67279),s=n(69688),l=n(14857),c=n(70576),u=n(31506),d=n(44414);const f=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],p={entering:{transform:"none"},entered:{transform:"none"}},h=i.forwardRef((function(e,t){const n=(0,l.A)(),h={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:m,appear:g=!0,children:v,easing:y,in:b,onEnter:w,onEntered:A,onEntering:x,onExit:S,onExited:E,onExiting:k,style:C,timeout:O=h,TransitionComponent:T=a.Ay}=e,R=(0,o.A)(e,f),_=i.useRef(null),M=(0,u.A)(_,(0,s.A)(v),t),P=e=>t=>{if(e){const n=_.current;void 0===t?e(n):e(n,t)}},I=P(x),j=P(((e,t)=>{(0,c.q)(e);const r=(0,c.c)({style:C,timeout:O,easing:y},{mode:"enter"});e.style.webkitTransition=n.transitions.create("transform",r),e.style.transition=n.transitions.create("transform",r),w&&w(e,t)})),L=P(A),N=P(k),B=P((e=>{const t=(0,c.c)({style:C,timeout:O,easing:y},{mode:"exit"});e.style.webkitTransition=n.transitions.create("transform",t),e.style.transition=n.transitions.create("transform",t),S&&S(e)})),z=P(E);return(0,d.jsx)(T,(0,r.A)({appear:g,in:b,nodeRef:_,onEnter:j,onEntered:L,onEntering:I,onExit:B,onExited:z,onExiting:N,addEndListener:e=>{m&&m(_.current,e)},timeout:O},R,{children:(e,t)=>i.cloneElement(v,(0,r.A)({style:(0,r.A)({transform:"scale(0)",visibility:"exited"!==e||b?void 0:"hidden"},p[e],C,v.props.style),ref:M},t))}))}))},19608:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(61960);const o=e=>(0,r.A)(e)&&"classes"!==e},19808:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(32228),l=n(51356),c=n(74840),u=n(62161),d=n(70146),f=n(12860),p=n(44414);const h=["className","component","disableGutters","fixed","maxWidth","classes"],m=(0,f.A)(),g=(0,d.A)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t["maxWidth".concat((0,c.A)(String(n.maxWidth)))],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),v=e=>(0,u.A)({props:e,name:"MuiContainer",defaultTheme:m});var y=n(89548),b=n(59254),w=n(18463);const A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createStyledComponent:t=g,useThemeProps:n=v,componentName:u="MuiContainer"}=e,d=t((e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!n.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}})}),(e=>{let{theme:t,ownerState:n}=e;return n.fixed&&Object.keys(t.breakpoints.values).reduce(((e,n)=>{const r=n,o=t.breakpoints.values[r];return 0!==o&&(e[t.breakpoints.up(r)]={maxWidth:"".concat(o).concat(t.breakpoints.unit)}),e}),{})}),(e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({},"xs"===n.maxWidth&&{[t.breakpoints.up("xs")]:{maxWidth:Math.max(t.breakpoints.values.xs,444)}},n.maxWidth&&"xs"!==n.maxWidth&&{[t.breakpoints.up(n.maxWidth)]:{maxWidth:"".concat(t.breakpoints.values[n.maxWidth]).concat(t.breakpoints.unit)}})})),f=i.forwardRef((function(e,t){const i=n(e),{className:f,component:m="div",disableGutters:g=!1,fixed:v=!1,maxWidth:y="lg"}=i,b=(0,r.A)(i,h),w=(0,o.A)({},i,{component:m,disableGutters:g,fixed:v,maxWidth:y}),A=((e,t)=>{const{classes:n,fixed:r,disableGutters:o,maxWidth:i}=e,a={root:["root",i&&"maxWidth".concat((0,c.A)(String(i))),r&&"fixed",o&&"disableGutters"]};return(0,l.A)(a,(e=>(0,s.Ay)(t,e)),n)})(w,u);return(0,p.jsx)(d,(0,o.A)({as:m,ownerState:w,className:(0,a.A)(A.root,f),ref:t},b))}));return f}({createStyledComponent:(0,b.Ay)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t["maxWidth".concat((0,y.A)(String(n.maxWidth)))],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,w.b)({props:e,name:"MuiContainer"})}),x=A},19813:(e,t,n)=>{"use strict";n.d(t,{A:()=>a,Y:()=>i});var r=n(45558),o=n(1614);function i(e){return(0,o.Ay)("MuiListItemButton",e)}const a=(0,r.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"])},19831:(e,t,n)=>{"use strict";n.d(t,{JD:()=>p,M_:()=>f,d4:()=>h});var r=n(11359),o=n(82569),i=n(58522),a=n(68626),s=n(58662),l=n(34805),c=n(93970),u=n(68889);const d=(0,i.HY)({menu:a.Ay,snackbar:s.Ay,fcm:l.Ay,toastSlice:c.Ay,loginUserSlice:u.Ay}),f=(0,r.U1)({reducer:d}),{dispatch:p}=f,h=o.d4},20816:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82284);function o(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=(0,r.A)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},21209:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(97654).A},21538:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;nnull==t?e:function(){for(var n=arguments.length,r=new Array(n),o=0;o{}))}n.d(t,{A:()=>r})},22022:(e,t,n)=>{var r=n(4635),o=n(81581),i=n(65336),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},22382:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,Q:()=>i});var r=n(58168),o=n(9950);function i(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function a(e){if(o.isValidElement(e)||!i(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=a(e[n])})),t}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const l=n.clone?(0,r.A)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((r=>{o.isValidElement(t[r])?l[r]=t[r]:i(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&i(e[r])?l[r]=s(e[r],t[r],n):n.clone?l[r]=i(t[r])?a(t[r]):t[r]:l[r]=t[r]})),l}},23199:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A});var r=n(72950)},23235:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(58168),o=n(9950),i=n(98587),a=n(72004),s=n(3484),l=n(89548),c=n(18463),u=n(59254),d=n(45558),f=n(1614);function p(e){return(0,f.Ay)("MuiSvgIcon",e)}(0,d.A)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var h=n(44414);const m=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],g=(0,u.Ay)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t["color".concat((0,l.A)(n.color))],t["fontSize".concat((0,l.A)(n.fontSize))]]}})((e=>{let{theme:t,ownerState:n}=e;var r,o,i,a,s,l,c,u,d,f,p,h,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:n.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(r=t.transitions)||null==(o=r.create)?void 0:o.call(r,"fill",{duration:null==(i=t.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(a=t.typography)||null==(s=a.pxToRem)?void 0:s.call(a,20))||"1.25rem",medium:(null==(l=t.typography)||null==(c=l.pxToRem)?void 0:c.call(l,24))||"1.5rem",large:(null==(u=t.typography)||null==(d=u.pxToRem)?void 0:d.call(u,35))||"2.1875rem"}[n.fontSize],color:null!=(f=null==(p=(t.vars||t).palette)||null==(p=p[n.color])?void 0:p.main)?f:{action:null==(h=(t.vars||t).palette)||null==(h=h.action)?void 0:h.active,disabled:null==(m=(t.vars||t).palette)||null==(m=m.action)?void 0:m.disabled,inherit:void 0}[n.color]}})),v=o.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiSvgIcon"}),{children:u,className:d,color:f="inherit",component:v="svg",fontSize:y="medium",htmlColor:b,inheritViewBox:w=!1,titleAccess:A,viewBox:x="0 0 24 24"}=n,S=(0,i.A)(n,m),E=o.isValidElement(u)&&"svg"===u.type,k=(0,r.A)({},n,{color:f,component:v,fontSize:y,instanceFontSize:e.fontSize,inheritViewBox:w,viewBox:x,hasSvgAsChild:E}),C={};w||(C.viewBox=x);const O=(e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root","inherit"!==t&&"color".concat((0,l.A)(t)),"fontSize".concat((0,l.A)(n))]};return(0,s.A)(o,p,r)})(k);return(0,h.jsxs)(g,(0,r.A)({as:v,className:(0,a.A)(O.root,d),focusable:"false",color:b,"aria-hidden":!A||void 0,role:A?"img":void 0,ref:t},C,S,E&&u.props,{ownerState:k,children:[E?u.props.children:u,A?(0,h.jsx)("title",{children:A}):null]}))}));v.muiName="SvgIcon";const y=v;function b(e,t){function n(n,o){return(0,h.jsx)(y,(0,r.A)({"data-testid":"".concat(t,"Icon"),ref:o},n,{children:e}))}return n.muiName=y.muiName,o.memo(o.forwardRef(n))}},23876:(e,t,n)=>{"use strict";var r=n(50630),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),g=0;g{"use strict";n.d(t,{A:()=>H});var r=n(58168),o=n(98587),i=n(9950),a=n(72004),s=n(3484),l=n(59254),c=n(18463),u=n(31506),d=n(1976),f=n(52695),p=n(57528),h=n(38166),m=n(88283),g=n(38528),v=n(44414);const y=function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:s,rippleSize:l,in:c,onExited:u,timeout:d}=e,[f,p]=i.useState(!1),h=(0,a.A)(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),m={width:l,height:l,top:-l/2+s,left:-l/2+o},g=(0,a.A)(n.child,f&&n.childLeaving,r&&n.childPulsate);return c||f||p(!0),i.useEffect((()=>{if(!c&&null!=u){const e=setTimeout(u,d);return()=>{clearTimeout(e)}}}),[u,c,d]),(0,v.jsx)("span",{className:h,style:m,children:(0,v.jsx)("span",{className:g})})};var b=n(45558);const w=(0,b.A)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]);var A,x,S,E;const k=["center","classes","className"];let C,O,T,R;const _=(0,m.i7)(C||(C=A||(A=(0,p.A)(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])))),M=(0,m.i7)(O||(O=x||(x=(0,p.A)(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])))),P=(0,m.i7)(T||(T=S||(S=(0,p.A)(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])))),I=(0,l.Ay)("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),j=(0,l.Ay)(y,{name:"MuiTouchRipple",slot:"Ripple"})(R||(R=E||(E=(0,p.A)(["\n opacity: 0;\n position: absolute;\n\n &."," {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n &."," {\n animation-duration: ","ms;\n }\n\n & ."," {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & ."," {\n opacity: 0;\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n & ."," {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ",";\n animation-duration: 2500ms;\n animation-timing-function: ",";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"]))),w.rippleVisible,_,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),w.ripplePulsate,(e=>{let{theme:t}=e;return t.transitions.duration.shorter}),w.child,w.childLeaving,M,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),w.childPulsate,P,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut})),L=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiTouchRipple"}),{center:s=!1,classes:l={},className:u}=n,d=(0,o.A)(n,k),[f,p]=i.useState([]),m=i.useRef(0),y=i.useRef(null);i.useEffect((()=>{y.current&&(y.current(),y.current=null)}),[f]);const b=i.useRef(!1),A=(0,g.A)(),x=i.useRef(null),S=i.useRef(null),E=i.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:i}=e;p((e=>[...e,(0,v.jsx)(j,{classes:{ripple:(0,a.A)(l.ripple,w.ripple),rippleVisible:(0,a.A)(l.rippleVisible,w.rippleVisible),ripplePulsate:(0,a.A)(l.ripplePulsate,w.ripplePulsate),child:(0,a.A)(l.child,w.child),childLeaving:(0,a.A)(l.childLeaving,w.childLeaving),childPulsate:(0,a.A)(l.childPulsate,w.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},m.current)])),m.current+=1,y.current=i}),[l]),C=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:r=!1,center:o=s||t.pulsate,fakeElement:i=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&b.current)return void(b.current=!1);"touchstart"===(null==e?void 0:e.type)&&(b.current=!0);const a=i?null:S.current,l=a?a.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2===0&&(d+=1);else{const e=2*Math.max(Math.abs((a?a.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((a?a.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===x.current&&(x.current=()=>{E({pulsate:r,rippleX:c,rippleY:u,rippleSize:d,cb:n})},A.start(80,(()=>{x.current&&(x.current(),x.current=null)}))):E({pulsate:r,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[s,E,A]),O=i.useCallback((()=>{C({},{pulsate:!0})}),[C]),T=i.useCallback(((e,t)=>{if(A.clear(),"touchend"===(null==e?void 0:e.type)&&x.current)return x.current(),x.current=null,void A.start(0,(()=>{T(e,t)}));x.current=null,p((e=>e.length>0?e.slice(1):e)),y.current=t}),[A]);return i.useImperativeHandle(t,(()=>({pulsate:O,start:C,stop:T})),[O,C,T]),(0,v.jsx)(I,(0,r.A)({className:(0,a.A)(w.root,l.root,u),ref:S},d,{children:(0,v.jsx)(h.A,{component:null,exit:!0,children:f})}))}));var N=n(1614);function B(e){return(0,N.Ay)("MuiButtonBase",e)}const z=(0,b.A)("MuiButtonBase",["root","disabled","focusVisible"]),D=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],F=(0,l.Ay)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},["&.".concat(z.disabled)]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),H=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiButtonBase"}),{action:l,centerRipple:p=!1,children:h,className:m,component:g="button",disabled:y=!1,disableRipple:b=!1,disableTouchRipple:w=!1,focusRipple:A=!1,LinkComponent:x="a",onBlur:S,onClick:E,onContextMenu:k,onDragLeave:C,onFocus:O,onFocusVisible:T,onKeyDown:R,onKeyUp:_,onMouseDown:M,onMouseLeave:P,onMouseUp:I,onTouchEnd:j,onTouchMove:N,onTouchStart:z,tabIndex:H=0,TouchRippleProps:W,touchRippleRef:U,type:V}=n,G=(0,o.A)(n,D),q=i.useRef(null),K=i.useRef(null),X=(0,u.A)(K,U),{isFocusVisibleRef:Y,onFocus:Q,onBlur:Z,ref:J}=(0,f.A)(),[$,ee]=i.useState(!1);y&&$&&ee(!1),i.useImperativeHandle(l,(()=>({focusVisible:()=>{ee(!0),q.current.focus()}})),[]);const[te,ne]=i.useState(!1);i.useEffect((()=>{ne(!0)}),[]);const re=te&&!b&&!y;function oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w;return(0,d.A)((r=>{t&&t(r);return!n&&K.current&&K.current[e](r),!0}))}i.useEffect((()=>{$&&A&&!b&&te&&K.current.pulsate()}),[b,A,$,te]);const ie=oe("start",M),ae=oe("stop",k),se=oe("stop",C),le=oe("stop",I),ce=oe("stop",(e=>{$&&e.preventDefault(),P&&P(e)})),ue=oe("start",z),de=oe("stop",j),fe=oe("stop",N),pe=oe("stop",(e=>{Z(e),!1===Y.current&&ee(!1),S&&S(e)}),!1),he=(0,d.A)((e=>{q.current||(q.current=e.currentTarget),Q(e),!0===Y.current&&(ee(!0),T&&T(e)),O&&O(e)})),me=()=>{const e=q.current;return g&&"button"!==g&&!("A"===e.tagName&&e.href)},ge=i.useRef(!1),ve=(0,d.A)((e=>{A&&!ge.current&&$&&K.current&&" "===e.key&&(ge.current=!0,K.current.stop(e,(()=>{K.current.start(e)}))),e.target===e.currentTarget&&me()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&me()&&"Enter"===e.key&&!y&&(e.preventDefault(),E&&E(e))})),ye=(0,d.A)((e=>{A&&" "===e.key&&K.current&&$&&!e.defaultPrevented&&(ge.current=!1,K.current.stop(e,(()=>{K.current.pulsate(e)}))),_&&_(e),E&&e.target===e.currentTarget&&me()&&" "===e.key&&!e.defaultPrevented&&E(e)}));let be=g;"button"===be&&(G.href||G.to)&&(be=x);const we={};"button"===be?(we.type=void 0===V?"button":V,we.disabled=y):(G.href||G.to||(we.role="button"),y&&(we["aria-disabled"]=y));const Ae=(0,u.A)(t,J,q);const xe=(0,r.A)({},n,{centerRipple:p,component:g,disabled:y,disableRipple:b,disableTouchRipple:w,focusRipple:A,tabIndex:H,focusVisible:$}),Se=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,i={root:["root",t&&"disabled",n&&"focusVisible"]},a=(0,s.A)(i,B,o);return n&&r&&(a.root+=" ".concat(r)),a})(xe);return(0,v.jsxs)(F,(0,r.A)({as:be,className:(0,a.A)(Se.root,m),ownerState:xe,onBlur:pe,onClick:E,onContextMenu:ae,onFocus:he,onKeyDown:ve,onKeyUp:ye,onMouseDown:ie,onMouseLeave:ce,onMouseUp:le,onDragLeave:se,onTouchEnd:de,onTouchMove:fe,onTouchStart:ue,ref:Ae,tabIndex:y?-1:H,type:V},we,G,{children:[h,re?(0,v.jsx)(L,(0,r.A)({ref:X,center:p},W)):null]}))}))},24386:(e,t,n)=>{"use strict";n.d(t,{J:()=>g});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function o(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var i=!1,a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!==typeof e},u=o((function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()})),d=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===r[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"},f="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function p(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return h={name:o.name,styles:o.styles,next:h},o.name;var a=n;if(void 0!==a.styles){var s=a.next;if(void 0!==s)for(;void 0!==s;)h={name:s.name,styles:s.styles,next:h},s=s.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:h}}},24436:(e,t,n)=>{"use strict";n.d(t,{A:()=>j});var r=n(58168),o=n(98587),i=n(37750),a=n(64750),s=n(98076),l=n(70505),c=n(12860);var u=n(99269);const d={black:"#000",white:"#fff"},f={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},p={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},h={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},v={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=["mode","contrastThreshold","tonalOffset"],w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:d.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},A={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function x(e,t,n,r){const o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,u.a)(e.main,o):"dark"===t&&(e.dark=(0,u.e$)(e.main,i)))}function S(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:s=.2}=e,l=(0,o.A)(e,b),c=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[200],light:g[50],dark:g[400]}:{main:g[700],light:g[400],dark:g[800]}}(t),S=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p[200],light:p[50],dark:p[400]}:{main:p[500],light:p[300],dark:p[700]}}(t),E=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h[500],light:h[300],dark:h[700]}:{main:h[700],light:h[400],dark:h[800]}}(t),k=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[400],light:v[300],dark:v[700]}:{main:v[700],light:v[500],dark:v[900]}}(t),C=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[400],light:y[300],dark:y[700]}:{main:y[800],light:y[500],dark:y[900]}}(t),O=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[400],light:m[300],dark:m[700]}:{main:"#ed6c02",light:m[500],dark:m[900]}}(t);function T(e){return(0,u.eM)(e,A.text.primary)>=n?A.text.primary:w.text.primary}const R=e=>{let{color:t,name:n,mainShade:o=500,lightShade:a=300,darkShade:l=700}=e;if(t=(0,r.A)({},t),!t.main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error((0,i.A)(11,n?" (".concat(n,")"):"",o));if("string"!==typeof t.main)throw new Error((0,i.A)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return x(t,"light",a,s),x(t,"dark",l,s),t.contrastText||(t.contrastText=T(t.main)),t},_={dark:A,light:w};return(0,a.A)((0,r.A)({common:(0,r.A)({},d),mode:t,primary:R({color:c,name:"primary"}),secondary:R({color:S,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:R({color:E,name:"error"}),warning:R({color:O,name:"warning"}),info:R({color:k,name:"info"}),success:R({color:C,name:"success"}),grey:f,contrastThreshold:n,getContrastText:T,augmentColor:R,tonalOffset:s},_[t]),l)}const E=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const k={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function O(e,t){const n="function"===typeof t?t(e):t,{fontFamily:i=C,fontSize:s=14,fontWeightLight:l=300,fontWeightRegular:c=400,fontWeightMedium:u=500,fontWeightBold:d=700,htmlFontSize:f=16,allVariants:p,pxToRem:h}=n,m=(0,o.A)(n,E);const g=s/14,v=h||(e=>"".concat(e/f*g,"rem")),y=(e,t,n,o,a)=>{return(0,r.A)({fontFamily:i,fontWeight:e,fontSize:v(t),lineHeight:n},i===C?{letterSpacing:"".concat((s=o/t,Math.round(1e5*s)/1e5),"em")}:{},a,p);var s},b={h1:y(l,96,1.167,-1.5),h2:y(l,60,1.2,-.5),h3:y(c,48,1.167,0),h4:y(c,34,1.235,.25),h5:y(c,24,1.334,0),h6:y(u,20,1.6,.15),subtitle1:y(c,16,1.75,.15),subtitle2:y(u,14,1.57,.1),body1:y(c,16,1.5,.15),body2:y(c,14,1.43,.15),button:y(u,14,1.75,.4,k),caption:y(c,12,1.66,.4),overline:y(c,12,2.66,1,k),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,a.A)((0,r.A)({htmlFontSize:f,pxToRem:v,fontFamily:i,fontSize:s,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:u,fontWeightBold:d},b),m,{clone:!1})}function T(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const R=["none",T(0,2,1,-1,0,1,1,0,0,1,3,0),T(0,3,1,-2,0,2,2,0,0,1,5,0),T(0,3,3,-2,0,3,4,0,0,1,8,0),T(0,2,4,-1,0,4,5,0,0,1,10,0),T(0,3,5,-1,0,5,8,0,0,1,14,0),T(0,3,5,-1,0,6,10,0,0,1,18,0),T(0,4,5,-2,0,7,10,1,0,2,16,1),T(0,5,5,-3,0,8,10,1,0,3,14,2),T(0,5,6,-3,0,9,12,1,0,3,16,2),T(0,6,6,-3,0,10,14,1,0,4,18,3),T(0,6,7,-4,0,11,15,1,0,4,20,3),T(0,7,8,-4,0,12,17,2,0,5,22,4),T(0,7,8,-4,0,13,19,2,0,5,24,4),T(0,7,9,-4,0,14,21,2,0,5,26,4),T(0,8,9,-5,0,15,22,2,0,6,28,5),T(0,8,10,-5,0,16,24,2,0,6,30,5),T(0,8,11,-5,0,17,26,2,0,6,32,5),T(0,9,11,-5,0,18,28,2,0,7,34,6),T(0,9,12,-6,0,19,29,2,0,7,36,6),T(0,10,13,-6,0,20,31,3,0,8,38,7),T(0,10,13,-6,0,21,33,3,0,8,40,7),T(0,10,14,-6,0,22,35,3,0,8,42,7),T(0,11,14,-7,0,23,36,3,0,9,44,8),T(0,11,15,-7,0,24,38,3,0,9,46,8)];var _=n(75361);const M={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},P=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mixins:t={},palette:n={},transitions:u={},typography:d={}}=e,f=(0,o.A)(e,P);if(e.vars)throw new Error((0,i.A)(18));const p=S(n),h=(0,c.A)(e);let m=(0,a.A)(h,{mixins:(g=h.breakpoints,v=t,(0,r.A)({toolbar:{minHeight:56,[g.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[g.up("sm")]:{minHeight:64}}},v)),palette:p,shadows:R.slice(),typography:O(p,d),transitions:(0,_.Ay)(u),zIndex:(0,r.A)({},M)});var g,v;m=(0,a.A)(m,f);for(var y=arguments.length,b=new Array(y>1?y-1:0),w=1;w(0,a.A)(e,t)),m),m.unstable_sxConfig=(0,r.A)({},s.A,null==f?void 0:f.unstable_sxConfig),m.unstable_sx=function(e){return(0,l.A)({sx:e,theme:this})},m}const j=I},24513:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(58168),o=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};var a=n(61187),s=function(e,t){return o.createElement(a.A,(0,r.A)({},e,{ref:t,icon:i}))};const l=o.forwardRef(s)},24567:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},24763:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(58168),o=n(98587),i=n(49456),a=n(83792),s=n(26598),l=n(89449);const c=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],u=["component","slots","slotProps"],d=["component"];function f(e,t){const{className:n,elementType:f,ownerState:p,externalForwardedProps:h,getSlotOwnerState:m,internalForwardedProps:g}=t,v=(0,o.A)(t,c),{component:y,slots:b={[e]:void 0},slotProps:w={[e]:void 0}}=h,A=(0,o.A)(h,u),x=b[e]||f,S=(0,s.A)(w[e],p),E=(0,l.A)((0,r.A)({className:n},v,{externalForwardedProps:"root"===e?A:void 0,externalSlotProps:S})),{props:{component:k},internalRef:C}=E,O=(0,o.A)(E.props,d),T=(0,i.A)(C,null==S?void 0:S.ref,t.ref),R=m?m(O):{},_=(0,r.A)({},p,R),M="root"===e?k||y:k,P=(0,a.A)(x,(0,r.A)({},"root"===e&&!y&&!b[e]&&g,"root"!==e&&!b[e]&&g,O,M&&{as:M},{ref:T}),_);return Object.keys(R).forEach((e=>{delete P[e]})),[x,P]}},24994:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},25277:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(99269),c=n(23235),u=n(44414);const d=(0,c.A)((0,u.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");var f=n(31506),p=n(89548),h=n(24184),m=n(18463),g=n(59254),v=n(45558),y=n(1614);function b(e){return(0,y.Ay)("MuiChip",e)}const w=(0,v.A)("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),A=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],x=(0,g.Ay)("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=n;return[{["& .".concat(w.avatar)]:t.avatar},{["& .".concat(w.avatar)]:t["avatar".concat((0,p.A)(s))]},{["& .".concat(w.avatar)]:t["avatarColor".concat((0,p.A)(r))]},{["& .".concat(w.icon)]:t.icon},{["& .".concat(w.icon)]:t["icon".concat((0,p.A)(s))]},{["& .".concat(w.icon)]:t["iconColor".concat((0,p.A)(o))]},{["& .".concat(w.deleteIcon)]:t.deleteIcon},{["& .".concat(w.deleteIcon)]:t["deleteIcon".concat((0,p.A)(s))]},{["& .".concat(w.deleteIcon)]:t["deleteIconColor".concat((0,p.A)(r))]},{["& .".concat(w.deleteIcon)]:t["deleteIcon".concat((0,p.A)(l),"Color").concat((0,p.A)(r))]},t.root,t["size".concat((0,p.A)(s))],t["color".concat((0,p.A)(r))],i&&t.clickable,i&&"default"!==r&&t["clickableColor".concat((0,p.A)(r),")")],a&&t.deletable,a&&"default"!==r&&t["deletableColor".concat((0,p.A)(r))],t[l],t["".concat(l).concat((0,p.A)(r))]]}})((e=>{let{theme:t,ownerState:n}=e;const r="light"===t.palette.mode?t.palette.grey[700]:t.palette.grey[300];return(0,o.A)({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",["&.".concat(w.disabled)]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},["& .".concat(w.avatar)]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:r,fontSize:t.typography.pxToRem(12)},["& .".concat(w.avatarColorPrimary)]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},["& .".concat(w.avatarColorSecondary)]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},["& .".concat(w.avatarSmall)]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},["& .".concat(w.icon)]:(0,o.A)({marginLeft:5,marginRight:-6},"small"===n.size&&{fontSize:18,marginLeft:4,marginRight:-4},n.iconColor===n.color&&(0,o.A)({color:t.vars?t.vars.palette.Chip.defaultIconColor:r},"default"!==n.color&&{color:"inherit"})),["& .".concat(w.deleteIcon)]:(0,o.A)({WebkitTapHighlightColor:"transparent",color:t.vars?"rgba(".concat(t.vars.palette.text.primaryChannel," / 0.26)"):(0,l.X4)(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?"rgba(".concat(t.vars.palette.text.primaryChannel," / 0.4)"):(0,l.X4)(t.palette.text.primary,.4)}},"small"===n.size&&{fontSize:16,marginRight:4,marginLeft:-4},"default"!==n.color&&{color:t.vars?"rgba(".concat(t.vars.palette[n.color].contrastTextChannel," / 0.7)"):(0,l.X4)(t.palette[n.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n.color].contrastText}})},"small"===n.size&&{height:24},"default"!==n.color&&{backgroundColor:(t.vars||t).palette[n.color].main,color:(t.vars||t).palette[n.color].contrastText},n.onDelete&&{["&.".concat(w.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,l.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},n.onDelete&&"default"!==n.color&&{["&.".concat(w.focusVisible)]:{backgroundColor:(t.vars||t).palette[n.color].dark}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({},n.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.hoverOpacity,"))"):(0,l.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},["&.".concat(w.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.selectedChannel," / calc(").concat(t.vars.palette.action.selectedOpacity," + ").concat(t.vars.palette.action.focusOpacity,"))"):(0,l.X4)(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},n.clickable&&"default"!==n.color&&{["&:hover, &.".concat(w.focusVisible)]:{backgroundColor:(t.vars||t).palette[n.color].dark}})}),(e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({},"outlined"===n.variant&&{backgroundColor:"transparent",border:t.vars?"1px solid ".concat(t.vars.palette.Chip.defaultBorder):"1px solid ".concat("light"===t.palette.mode?t.palette.grey[400]:t.palette.grey[700]),["&.".concat(w.clickable,":hover")]:{backgroundColor:(t.vars||t).palette.action.hover},["&.".concat(w.focusVisible)]:{backgroundColor:(t.vars||t).palette.action.focus},["& .".concat(w.avatar)]:{marginLeft:4},["& .".concat(w.avatarSmall)]:{marginLeft:2},["& .".concat(w.icon)]:{marginLeft:4},["& .".concat(w.iconSmall)]:{marginLeft:2},["& .".concat(w.deleteIcon)]:{marginRight:5},["& .".concat(w.deleteIconSmall)]:{marginRight:3}},"outlined"===n.variant&&"default"!==n.color&&{color:(t.vars||t).palette[n.color].main,border:"1px solid ".concat(t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.7)"):(0,l.X4)(t.palette[n.color].main,.7)),["&.".concat(w.clickable,":hover")]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,l.X4)(t.palette[n.color].main,t.palette.action.hoverOpacity)},["&.".concat(w.focusVisible)]:{backgroundColor:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.focusOpacity,")"):(0,l.X4)(t.palette[n.color].main,t.palette.action.focusOpacity)},["& .".concat(w.deleteIcon)]:{color:t.vars?"rgba(".concat(t.vars.palette[n.color].mainChannel," / 0.7)"):(0,l.X4)(t.palette[n.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n.color].main}}})})),S=(0,g.Ay)("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t["label".concat((0,p.A)(r))]]}})((e=>{let{ownerState:t}=e;return(0,o.A)({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},"outlined"===t.variant&&{paddingLeft:11,paddingRight:11},"small"===t.size&&{paddingLeft:8,paddingRight:8},"small"===t.size&&"outlined"===t.variant&&{paddingLeft:7,paddingRight:7})}));function E(e){return"Backspace"===e.key||"Delete"===e.key}const k=i.forwardRef((function(e,t){const n=(0,m.b)({props:e,name:"MuiChip"}),{avatar:l,className:c,clickable:g,color:v="default",component:y,deleteIcon:w,disabled:k=!1,icon:C,label:O,onClick:T,onDelete:R,onKeyDown:_,onKeyUp:M,size:P="medium",variant:I="filled",tabIndex:j,skipFocusWhenDisabled:L=!1}=n,N=(0,r.A)(n,A),B=i.useRef(null),z=(0,f.A)(B,t),D=e=>{e.stopPropagation(),R&&R(e)},F=!(!1===g||!T)||g,H=F||R?h.A:y||"div",W=(0,o.A)({},n,{component:H,disabled:k,size:P,color:v,iconColor:i.isValidElement(C)&&C.props.color||v,onDelete:!!R,clickable:F,variant:I}),U=(e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:a,clickable:l,variant:c}=e,u={root:["root",c,n&&"disabled","size".concat((0,p.A)(r)),"color".concat((0,p.A)(o)),l&&"clickable",l&&"clickableColor".concat((0,p.A)(o)),a&&"deletable",a&&"deletableColor".concat((0,p.A)(o)),"".concat(c).concat((0,p.A)(o))],label:["label","label".concat((0,p.A)(r))],avatar:["avatar","avatar".concat((0,p.A)(r)),"avatarColor".concat((0,p.A)(o))],icon:["icon","icon".concat((0,p.A)(r)),"iconColor".concat((0,p.A)(i))],deleteIcon:["deleteIcon","deleteIcon".concat((0,p.A)(r)),"deleteIconColor".concat((0,p.A)(o)),"deleteIcon".concat((0,p.A)(c),"Color").concat((0,p.A)(o))]};return(0,s.A)(u,b,t)})(W),V=H===h.A?(0,o.A)({component:y||"div",focusVisibleClassName:U.focusVisible},R&&{disableRipple:!0}):{};let G=null;R&&(G=w&&i.isValidElement(w)?i.cloneElement(w,{className:(0,a.A)(w.props.className,U.deleteIcon),onClick:D}):(0,u.jsx)(d,{className:(0,a.A)(U.deleteIcon),onClick:D}));let q=null;l&&i.isValidElement(l)&&(q=i.cloneElement(l,{className:(0,a.A)(U.avatar,l.props.className)}));let K=null;return C&&i.isValidElement(C)&&(K=i.cloneElement(C,{className:(0,a.A)(U.icon,C.props.className)})),(0,u.jsxs)(x,(0,o.A)({as:H,className:(0,a.A)(U.root,c),disabled:!(!F||!k)||void 0,onClick:T,onKeyDown:e=>{e.currentTarget===e.target&&E(e)&&e.preventDefault(),_&&_(e)},onKeyUp:e=>{e.currentTarget===e.target&&(R&&E(e)?R(e):"Escape"===e.key&&B.current&&B.current.blur()),M&&M(e)},ref:z,tabIndex:L&&k?-1:j,ownerState:W},V,N,{children:[q||K,(0,u.jsx)(S,{className:(0,a.A)(U.label),ownerState:W,children:O}),G]}))}))},25329:(e,t,n)=>{"use strict";t.A=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(9950)),o=n(28843);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}t.A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=r.useContext(o.ThemeContext);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}},25333:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(99269),c=n(59254),u=n(18463),d=n(24184),f=n(89548),p=n(45558),h=n(1614);function m(e){return(0,h.Ay)("MuiIconButton",e)}const g=(0,p.A)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]);var v=n(44414);const y=["edge","children","className","color","disabled","disableFocusRipple","size"],b=(0,c.Ay)(d.A,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t["color".concat((0,f.A)(n.color))],n.edge&&t["edge".concat((0,f.A)(n.edge))],t["size".concat((0,f.A)(n.size))]]}})((e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.activeChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,l.X4)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===n.edge&&{marginLeft:"small"===n.size?-3:-12},"end"===n.edge&&{marginRight:"small"===n.size?-3:-12})}),(e=>{let{theme:t,ownerState:n}=e;var r;const i=null==(r=(t.vars||t).palette)?void 0:r[n.color];return(0,o.A)({},"inherit"===n.color&&{color:"inherit"},"inherit"!==n.color&&"default"!==n.color&&(0,o.A)({color:null==i?void 0:i.main},!n.disableRipple&&{"&:hover":(0,o.A)({},i&&{backgroundColor:t.vars?"rgba(".concat(i.mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,l.X4)(i.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===n.size&&{padding:5,fontSize:t.typography.pxToRem(18)},"large"===n.size&&{padding:12,fontSize:t.typography.pxToRem(28)},{["&.".concat(g.disabled)]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})})),w=i.forwardRef((function(e,t){const n=(0,u.b)({props:e,name:"MuiIconButton"}),{edge:i=!1,children:l,className:c,color:d="default",disabled:p=!1,disableFocusRipple:h=!1,size:g="medium"}=n,w=(0,r.A)(n,y),A=(0,o.A)({},n,{edge:i,color:d,disabled:p,disableFocusRipple:h,size:g}),x=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e,a={root:["root",n&&"disabled","default"!==r&&"color".concat((0,f.A)(r)),o&&"edge".concat((0,f.A)(o)),"size".concat((0,f.A)(i))]};return(0,s.A)(a,m,t)})(A);return(0,v.jsx)(b,(0,o.A)({className:(0,a.A)(x.root,c),centerRipple:!0,focusRipple:!h,disabled:p,ref:t},w,{ownerState:A,children:l}))}))},26562:(e,t,n)=>{"use strict";function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},26590:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,n))}},26598:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t,n){return"function"===typeof e?e(t,n):e}},26910:(e,t,n)=>{"use strict";n.d(t,{A:()=>Mt});var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>fe,hasStandardBrowserEnv:()=>he,hasStandardBrowserWebWorkerEnv:()=>me,navigator:()=>pe,origin:()=>ge});var i=n(85224);const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,l=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>l(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,p=d("undefined");const h=u("ArrayBuffer");const m=d("string"),g=d("function"),v=d("number"),y=e=>null!==e&&"object"===typeof e,b=e=>{if("object"!==l(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},w=u("Date"),A=u("File"),x=u("Blob"),S=u("FileList"),E=u("URLSearchParams"),[k,C,O,T]=["ReadableStream","Request","Response","Headers"].map(u);function R(e,t){let n,r,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),f(e))for(n=0,r=e.length;n0;)if(r=n[o],t===r.toLowerCase())return r;return null}const M="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,P=e=>!p(e)&&e!==M;const I=(j="undefined"!==typeof Uint8Array&&s(Uint8Array),e=>j&&e instanceof j);var j;const L=u("HTMLFormElement"),N=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),B=u("RegExp"),z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};R(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},D="abcdefghijklmnopqrstuvwxyz",F="0123456789",H={DIGIT:F,ALPHA:D,ALPHA_DIGIT:D+D.toUpperCase()+F};const W=u("AsyncFunction"),U=((e,t)=>{return e?setImmediate:t?(n="axios@".concat(Math.random()),r=[],M.addEventListener("message",(e=>{let{source:t,data:o}=e;t===M&&o===n&&r.length&&r.shift()()}),!1),e=>{r.push(e),M.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,g(M.postMessage)),V="undefined"!==typeof queueMicrotask?queueMicrotask.bind(M):"undefined"!==typeof i&&i.nextTick||U,G={isArray:f,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=l(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isReadableStream:k,isRequest:C,isResponse:O,isHeaders:T,isUndefined:p,isDate:w,isFile:A,isBlob:x,isRegExp:B,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:E,isTypedArray:I,isFileList:S,forEach:R,merge:function e(){const{caseless:t}=P(this)&&this||{},n={},r=(r,o)=>{const i=t&&_(n,o)||o;b(n[i])&&b(r)?n[i]=e(n[i],r):b(r)?n[i]=e({},r):f(r)?n[i]=r.slice():n[i]=r};for(let o=0,i=arguments.length;o3&&void 0!==arguments[3]?arguments[3]:{};return R(t,((t,r)=>{n&&g(t)?e[r]=o(t,n):e[r]=t}),{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const l={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!v(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:z,freezeMethods:e=>{z(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_,global:M,isContextDefined:P,ALPHABET:H,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H.ALPHA_DIGIT,n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return R(e,((e,t)=>{const i=n(e,r+1);!p(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:W,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:U,asap:V};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}G.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.status}}});const K=q.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{X[e]={value:e}})),Object.defineProperties(q,X),Object.defineProperty(K,"isAxiosError",{value:!0}),q.from=(e,t,n,r,o,i)=>{const a=Object.create(K);return G.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const Y=q;var Q=n(93325).hp;function Z(e){return G.isPlainObject(e)||G.isArray(e)}function J(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function $(e,t,n){return e?e.concat(t).map((function(e,t){return e=J(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=G.toFlatObject(G,{},null,(function(e){return/^is[A-Z]/.test(e)}));const te=function(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!G.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!==typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(!s&&G.isBlob(e))throw new Y("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?s&&"function"===typeof Blob?new Blob([e]):Q.from(e):e}function c(e,n,o){let s=e;if(e&&!o&&"object"===typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(Z)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(s=G.toArray(e)))return n=J(n),s.forEach((function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===a?$([n],r,i):null===a?n:n+"[]",l(e))})),!1;return!!Z(e)||(t.append($(o,n,i),l(e)),!1)}const u=[],d=Object.assign(ee,{defaultVisitor:c,convertValue:l,isVisitable:Z});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),G.forEach(n,(function(n,i){!0===(!(G.isUndefined(n)||null===n)&&o.call(t,n,G.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t};function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ie=re;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ae;G.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):G.isURLSearchParams(t)?t.toString():new ie(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const le=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ue=n(89379);const de={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},fe="undefined"!==typeof window&&"undefined"!==typeof document,pe="object"===typeof navigator&&navigator||void 0,he=fe&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),me="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,ge=fe&&window.location.href||"http://localhost",ve=(0,ue.A)((0,ue.A)({},r),de);const ye=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&G.isArray(r)?r.length:i,s)return G.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&G.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&G.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const be={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=G.isObject(e);o&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(ye(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e)||G.isReadableStream(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ve.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ve.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||be.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(G.isResponse(e)||G.isReadableStream(e))return e;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(n){if("SyntaxError"===o.name)throw Y.from(o,Y.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],(e=>{be.headers[e]={}}));const we=be,Ae=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xe=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:G.isArray(e)?e.map(Ee):String(e)}function ke(e,t,n,r,o){return G.isFunction(r)?r.call(this,t,n):(o&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}class Ce{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Se(t);if(!o)throw new Error("header name must be a non-empty string");const i=G.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ee(e))}const i=(e,t)=>G.forEach(e,((e,n)=>o(e,n,t)));if(G.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(G.isHeaders(e))for(const[a,s]of e.entries())o(s,a,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Se(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Se(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!ke(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Se(e)){const o=G.findKey(n,e);!o||t&&!ke(0,n[o],o,t)||(delete n[o],r=!0)}}return G.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ke(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,((r,o)=>{const i=G.findKey(n,o);if(i)return t[i]=Ee(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Ee(r),n[a]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,n]=e;return t+": "+n})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;ot.set(e))),t}static accessor(e){const t=(this[xe]=this[xe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Se(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Ce.prototype,((e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[r]=e}}})),G.freezeMethods(Ce);const Oe=Ce;function Te(e,t){const n=this||we,r=t||n,o=Oe.from(r.headers);let i=r.data;return G.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function Re(e){return!(!e||!e.__CANCEL__)}function _e(e,t,n){Y.call(this,null==e?"canceled":e,Y.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(_e,Y,{__CANCEL__:!0});const Me=_e;function Pe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ie=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];o||(o=l),n[i]=s,r[i]=l;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[function(){const e=Date.now(),t=e-o;for(var s=arguments.length,l=new Array(s),c=0;c=i?a(l,e):(n=l,r||(r=setTimeout((()=>{r=null,a(n)}),i-t)))},()=>n&&a(n)]},Le=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0;const o=Ie(50,250);return je((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},Ne=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Be=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;re(...n)))},ze=ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,De=ve.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),G.isString(r)&&a.push("path="+r),G.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Fe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const He=e=>e instanceof Oe?(0,ue.A)({},e):e;function We(e,t){t=t||{};const n={};function r(e,t,n,r){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:r},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function o(e,t,n,o){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!G.isUndefined(t))return r(void 0,t)}function a(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(He(e),He(t),0,!0)};return G.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=l[r]||o,a=i(e[r],t[r],r);G.isUndefined(a)&&i!==s||(n[r]=a)})),n}const Ue=e=>{const t=We({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=Oe.from(s),t.url=se(Fe(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),G.isFormData(r))if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(ve.hasStandardBrowserEnv&&(o&&G.isFunction(o)&&(o=o(t)),o||!1!==o&&ze(t.url))){const e=i&&a&&De.read(a);e&&s.set(i,e)}return t},Ve="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ue(e);let o=r.data;const i=Oe.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Oe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Pe((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Y("Request aborted",Y.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Y(t,o.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&G.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),G.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([l,u]=Le(p,!0),m.addEventListener("progress",l)),f&&m.upload&&([s,c]=Le(f),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new Me(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===ve.protocols.indexOf(v)?n(new Y("Unsupported protocol "+v+":",Y.ERR_BAD_REQUEST,e)):m.send(o||null)}))},Ge=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Y?t:new Me(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new Y("timeout ".concat(t," of ms exceeded"),Y.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:s}=r;return s.unsubscribe=()=>G.asap(a),s}};function qe(e,t){this.v=e,this.k=t}function Ke(e){return function(){return new Xe(e.apply(this,arguments))}}function Xe(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,s=a instanceof qe;Promise.resolve(s?a.v:a).then((function(n){if(s){var l="return"===t?"return":"next";if(!a.k||n.done)return r(l,n);n=e[l](n).value}o(i.done?"return":"normal",n)}),(function(e){r("throw",e)}))}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise((function(i,a){var s={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function Ye(e){return new qe(e,0)}function Qe(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise((function(n){n(e[t](r))})),{done:!1,value:new qe(r,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):r("return",e)}),t}function Ze(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new Je(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Je(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return Je=function(e){this.s=e,this.n=e.next},Je.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new Je(e)}Xe.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Xe.prototype.next=function(e){return this._invoke("next",e)},Xe.prototype.throw=function(e){return this._invoke("throw",e)},Xe.prototype.return=function(e){return this._invoke("return",e)};const $e=function*(e,t){let n=e.byteLength;if(!t||n{const o=et(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},rt="function"===typeof fetch&&"function"===typeof Request&&"function"===typeof Response,ot=rt&&"function"===typeof ReadableStream,it=rt&&("function"===typeof TextEncoder?(at=new TextEncoder,e=>at.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var at;const st=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{let e=!1;const t=new Request(ve.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),ct=ot&&st((()=>G.isReadableStream(new Response("").body))),ut={stream:ct&&(e=>e.body)};var dt;rt&&(dt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!ut[e]&&(ut[e]=G.isFunction(dt[e])?t=>t[e]():(t,n)=>{throw new Y("Response type '".concat(e,"' is not supported"),Y.ERR_NOT_SUPPORT,n)})})));const ft=async(e,t)=>{const n=G.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e)){const t=new Request(ve.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return G.isArrayBufferView(e)||G.isArrayBuffer(e)?e.byteLength:(G.isURLSearchParams(e)&&(e+=""),G.isString(e)?(await it(e)).byteLength:void 0)})(t):n},pt={http:null,xhr:Ve,fetch:rt&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Ue(e);c=c?(c+"").toLowerCase():"text";let p,h=Ge([o,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&<&&"get"!==n&&"head"!==n&&0!==(g=await ft(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(G.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ne(g,Le(Be(l)));r=nt(n.body,65536,e,t)}}G.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,(0,ue.A)((0,ue.A)({},f),{},{signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0}));let i=await fetch(p);const a=ct&&("stream"===c||"response"===c);if(ct&&(s||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=G.toFiniteNumber(i.headers.get("content-length")),[n,r]=s&&Ne(t,Le(Be(s),!0))||[];i=new Response(nt(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let v=await ut[G.findKey(ut,c)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{Pe(t,n,{data:v,headers:Oe.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(v){if(m&&m(),v&&"TypeError"===v.name&&/fetch/i.test(v.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,e,p),{cause:v.cause||v});throw Y.from(v,v&&v.code,e,p)}})};G.forEach(pt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const ht=e=>"- ".concat(e),mt=e=>G.isFunction(e)||null===e||!1===e,gt=e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i{let[t,n]=e;return"adapter ".concat(t," ")+(!1===n?"is not supported by the environment":"is not available in the build")}));let n=t?e.length>1?"since :\n"+e.map(ht).join("\n"):" "+ht(e[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function vt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Me(null,e)}function yt(e){vt(e),e.headers=Oe.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return gt(e.adapter||we.adapter)(e).then((function(t){return vt(e),t.data=Te.call(e,e.transformResponse,t),t.headers=Oe.from(t.headers),t}),(function(t){return Re(t)||(vt(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=Oe.from(t.response.headers))),Promise.reject(t)}))}const bt="1.7.9",wt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{wt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const At={};wt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Y(r(o," has been removed"+(t?" in "+t:"")),Y.ERR_DEPRECATED);return t&&!At[o]&&(At[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},wt.spelling=function(e){return(t,n)=>(console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0)};const xt={assertOptions:function(e,t,n){if("object"!==typeof e)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Y("option "+i+" must be "+n,Y.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Y("Unknown option "+i,Y.ERR_BAD_OPTION)}},validators:wt},St=xt.validators;class Et{constructor(e){this.defaults=e,this.interceptors={request:new le,response:new le}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=We(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&xt.assertOptions(n,{silentJSONParsing:St.transitional(St.boolean),forcedJSONParsing:St.transitional(St.boolean),clarifyTimeoutError:St.transitional(St.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:xt.assertOptions(r,{encode:St.function,serialize:St.function},!0)),xt.assertOptions(t,{baseUrl:St.spelling("baseURL"),withXsrfToken:St.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&G.merge(o.common,o[t.method]);o&&G.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Oe.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!s){const e=[yt.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Me(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ct((function(t){e=t})),cancel:e}}}const Ot=Ct;const Tt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tt).forEach((e=>{let[t,n]=e;Tt[n]=t}));const Rt=Tt;const _t=function e(t){const n=new kt(t),r=o(kt.prototype.request,n);return G.extend(r,kt.prototype,n,{allOwnKeys:!0}),G.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(We(t,n))},r}(we);_t.Axios=kt,_t.CanceledError=Me,_t.CancelToken=Ot,_t.isCancel=Re,_t.VERSION=bt,_t.toFormData=te,_t.AxiosError=Y,_t.Cancel=_t.CanceledError,_t.all=function(e){return Promise.all(e)},_t.spread=function(e){return function(t){return e.apply(null,t)}},_t.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},_t.mergeConfig=We,_t.AxiosHeaders=Oe,_t.formToJSON=e=>ye(G.isHTMLForm(e)?new FormData(e):e),_t.getAdapter=gt,_t.HttpStatusCode=Rt,_t.default=_t;const Mt=_t},27402:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(61262).A},27800:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(43145);function o(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},28286:(e,t,n)=>{"use strict";n.d(t,{EU:()=>s,NI:()=>a,iZ:()=>c,kW:()=>u,vf:()=>l,zu:()=>o});var r=n(22382);const o={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(o[e],"px)")};function a(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||i;return t.reduce(((r,o,i)=>(r[e.up(e.keys[i])]=n(t[i]),r)),{})}if("object"===typeof t){const e=r.breakpoints||i;return Object.keys(t).reduce(((r,i)=>{if(-1!==Object.keys(e.values||o).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r}),{})}return n(t)}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;return(null==(t=e.keys)?void 0:t.reduce(((t,n)=>(t[e.up(n)]={},t)),{}))||{}}function l(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function c(e){const t=s(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i(0,r.A)(e,t)),{});return l(Object.keys(t),a)}function u(e){let{values:t,breakpoints:n,base:r}=e;const o=r||function(e,t){if("object"!==typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r{null!=e[t]&&(n[t]=!0)})),n}(t,n),i=Object.keys(o);if(0===i.length)return t;let a;return i.reduce(((e,n,r)=>(Array.isArray(t)?(e[n]=null!=t[r]?t[r]:t[a],a=r):"object"===typeof t?(e[n]=null!=t[n]?t[n]:t[a],a=n):e[n]=t,e)),{})}},28429:(e,t,n)=>{"use strict";var r;n.d(t,{$P:()=>p,Ix:()=>N,V8:()=>j,Ye:()=>w,Zp:()=>v,jb:()=>c,sv:()=>L,x$:()=>b,zy:()=>m});var o=n(9950),i=n(1018);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0})),o.useCallback((function(r,o){void 0===o&&(o={}),n.current&&("number"===typeof r?e.navigate(r):e.navigate(r,a({fromRouteId:t},o)))}),[e,t])}():function(){h()||(0,i.Oi)(!1);let e=o.useContext(s),{basename:t,future:n,navigator:r}=o.useContext(c),{matches:a}=o.useContext(d),{pathname:l}=m(),u=JSON.stringify((0,i.yD)(a,n.v7_relativeSplatPath)),f=o.useRef(!1);return g((()=>{f.current=!0})),o.useCallback((function(n,o){if(void 0===o&&(o={}),!f.current)return;if("number"===typeof n)return void r.go(n);let a=(0,i.Gh)(n,JSON.parse(u),l,"path"===o.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:(0,i.HS)([t,a.pathname])),(o.replace?r.replace:r.push)(a,o.state,o)}),[t,r,u,l,e])}()}const y=o.createContext(null);function b(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=o.useContext(c),{matches:a}=o.useContext(d),{pathname:s}=m(),l=JSON.stringify((0,i.yD)(a,r.v7_relativeSplatPath));return o.useMemo((()=>(0,i.Gh)(e,JSON.parse(l),s,"path"===n)),[e,l,s,n])}function w(e,t){return A(e,t)}function A(e,t,n,r){h()||(0,i.Oi)(!1);let{navigator:s,static:l}=o.useContext(c),{matches:f}=o.useContext(d),p=f[f.length-1],g=p?p.params:{},v=(p&&p.pathname,p?p.pathnameBase:"/");p&&p.route;let y,b=m();if(t){var w;let e="string"===typeof t?(0,i.Rr)(t):t;"/"===v||(null==(w=e.pathname)?void 0:w.startsWith(v))||(0,i.Oi)(!1),y=e}else y=b;let A=y.pathname||"/",x=A;if("/"!==v){let e=v.replace(/^\//,"").split("/");x="/"+A.replace(/^\//,"").split("/").slice(e.length).join("/")}let S=!l&&n&&n.matches&&n.matches.length>0?n.matches:(0,i.ue)(e,{pathname:x});let E=C(S&&S.map((e=>Object.assign({},e,{params:Object.assign({},g,e.params),pathname:(0,i.HS)([v,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?v:(0,i.HS)([v,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),f,n,r);return t&&E?o.createElement(u.Provider,{value:{location:a({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:i.rc.Pop}},E):E}function x(){let e=function(){var e;let t=o.useContext(f),n=_(T.UseRouteError),r=M(T.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=(0,i.pX)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r};return o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),n?o.createElement("pre",{style:a},n):null,null)}const S=o.createElement(x,null);class E extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?o.createElement(d.Provider,{value:this.props.routeContext},o.createElement(f.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function k(e){let{routeContext:t,match:n,children:r}=e,i=o.useContext(s);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),o.createElement(d.Provider,{value:t},r)}function C(e,t,n,r){var a;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var s;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(s=r)&&s.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let l=e,c=null==(a=n)?void 0:a.errors;if(null!=c){let e=l.findIndex((e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id])));e>=0||(0,i.Oi)(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let o=0;o=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,i)=>{let a,s=!1,f=null,p=null;var h;n&&(a=c&&r.route.id?c[r.route.id]:void 0,f=r.route.errorElement||S,u&&(d<0&&0===i?(h="route-fallback",!1||P[h]||(P[h]=!0),s=!0,p=null):d===i&&(s=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,i+1)),g=()=>{let t;return t=a?f:s?p:r.route.Component?o.createElement(r.route.Component,null):r.route.element?r.route.element:e,o.createElement(k,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?o.createElement(E,{location:n.location,revalidation:n.revalidation,component:f,error:a,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}var O=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(O||{}),T=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(T||{});function R(e){let t=o.useContext(s);return t||(0,i.Oi)(!1),t}function _(e){let t=o.useContext(l);return t||(0,i.Oi)(!1),t}function M(e){let t=function(){let e=o.useContext(d);return e||(0,i.Oi)(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||(0,i.Oi)(!1),n.route.id}const P={};const I=(e,t,n)=>{};function j(e,t){void 0===(null==e?void 0:e.v7_startTransition)&&I("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),void 0!==(null==e?void 0:e.v7_relativeSplatPath)||t&&t.v7_relativeSplatPath||I("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(void 0===t.v7_fetcherPersist&&I("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===t.v7_normalizeFormMethod&&I("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===t.v7_partialHydration&&I("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===t.v7_skipActionErrorRevalidation&&I("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}(r||(r=n.t(o,2))).startTransition;function L(e){return function(e){let t=o.useContext(d).outlet;return t?o.createElement(y.Provider,{value:e},t):t}(e.context)}function N(e){let{basename:t="/",children:n=null,location:r,navigationType:s=i.rc.Pop,navigator:l,static:d=!1,future:f}=e;h()&&(0,i.Oi)(!1);let p=t.replace(/^\/*/,"/"),m=o.useMemo((()=>({basename:p,navigator:l,static:d,future:a({v7_relativeSplatPath:!1},f)})),[p,f,l,d]);"string"===typeof r&&(r=(0,i.Rr)(r));let{pathname:g="/",search:v="",hash:y="",state:b=null,key:w="default"}=r,A=o.useMemo((()=>{let e=(0,i.pb)(g,p);return null==e?null:{location:{pathname:e,search:v,hash:y,state:b,key:w},navigationType:s}}),[p,g,v,y,b,w,s]);return null==A?null:o.createElement(c.Provider,{value:m},o.createElement(u.Provider,{children:n,value:A}))}new Promise((()=>{}));o.Component},28555:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(9950).createContext(null)},28807:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.A,extendSxProp:()=>o.A,unstable_createStyleFunctionSx:()=>r.k,unstable_defaultSxConfig:()=>i.A});var r=n(70505),o=n(80237),i=n(98076)},28810:(e,t,n)=>{"use strict";n.d(t,{A:()=>x});var r=n(58168),o=n(98587),i=n(9950),a=n(72004),s=n(13292),l=n(3484),c=n(70134);const u=function(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:o=!1}=e,i=(0,s.A)({badgeContent:t,max:r});let a=n;!1!==n||0!==t||o||(a=!0);const{badgeContent:l,max:c=r}=a?i:e;return{badgeContent:l,invisible:a,max:c,displayValue:l&&Number(l)>c?"".concat(c,"+"):l}};var d=n(59254),f=n(18463),p=n(89548),h=n(45558),m=n(1614);function g(e){return(0,m.Ay)("MuiBadge",e)}const v=(0,h.A)("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]);var y=n(44414);const b=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],w=(0,d.Ay)("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),A=(0,d.Ay)("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t["anchorOrigin".concat((0,p.A)(n.anchorOrigin.vertical)).concat((0,p.A)(n.anchorOrigin.horizontal)).concat((0,p.A)(n.overlap))],"default"!==n.color&&t["color".concat((0,p.A)(n.color))],n.invisible&&t.invisible]}})((e=>{let{theme:t}=e;var n;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:20,lineHeight:1,padding:"0 6px",height:20,borderRadius:10,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.keys((null!=(n=t.vars)?n:t).palette).filter((e=>{var n,r;return(null!=(n=t.vars)?n:t).palette[e].main&&(null!=(r=t.vars)?r:t).palette[e].contrastText})).map((e=>({props:{color:e},style:{backgroundColor:(t.vars||t).palette[e].main,color:(t.vars||t).palette[e].contrastText}}))),{props:{variant:"dot"},style:{borderRadius:4,height:8,minWidth:8,padding:0}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical&&"right"===t.anchorOrigin.horizontal&&"rectangular"===t.overlap},style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(50%, -50%)"}}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchorOrigin.vertical&&"right"===t.anchorOrigin.horizontal&&"rectangular"===t.overlap},style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(50%, 50%)"}}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical&&"left"===t.anchorOrigin.horizontal&&"rectangular"===t.overlap},style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchorOrigin.vertical&&"left"===t.anchorOrigin.horizontal&&"rectangular"===t.overlap},style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical&&"right"===t.anchorOrigin.horizontal&&"circular"===t.overlap},style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(50%, -50%)"}}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchorOrigin.vertical&&"right"===t.anchorOrigin.horizontal&&"circular"===t.overlap},style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(50%, 50%)"}}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical&&"left"===t.anchorOrigin.horizontal&&"circular"===t.overlap},style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchorOrigin.vertical&&"left"===t.anchorOrigin.horizontal&&"circular"===t.overlap},style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",["&.".concat(v.invisible)]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]}})),x=i.forwardRef((function(e,t){var n,i,d,h,m,v;const x=(0,f.b)({props:e,name:"MuiBadge"}),{anchorOrigin:S={vertical:"top",horizontal:"right"},className:E,component:k,components:C={},componentsProps:O={},children:T,overlap:R="rectangular",color:_="default",invisible:M=!1,max:P=99,badgeContent:I,slots:j,slotProps:L,showZero:N=!1,variant:B="standard"}=x,z=(0,o.A)(x,b),{badgeContent:D,invisible:F,max:H,displayValue:W}=u({max:P,invisible:M,badgeContent:I,showZero:N}),U=(0,s.A)({anchorOrigin:S,color:_,overlap:R,variant:B,badgeContent:I}),V=F||null==D&&"dot"!==B,{color:G=_,overlap:q=R,anchorOrigin:K=S,variant:X=B}=V?U:x,Y="dot"!==X?W:void 0,Q=(0,r.A)({},x,{badgeContent:D,invisible:V,max:H,displayValue:Y,showZero:N,anchorOrigin:K,color:G,overlap:q,variant:X}),Z=(e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:o,variant:i,classes:a={}}=e,s={root:["root"],badge:["badge",i,r&&"invisible","anchorOrigin".concat((0,p.A)(n.vertical)).concat((0,p.A)(n.horizontal)),"anchorOrigin".concat((0,p.A)(n.vertical)).concat((0,p.A)(n.horizontal)).concat((0,p.A)(o)),"overlap".concat((0,p.A)(o)),"default"!==t&&"color".concat((0,p.A)(t))]};return(0,l.A)(s,g,a)})(Q),J=null!=(n=null!=(i=null==j?void 0:j.root)?i:C.Root)?n:w,$=null!=(d=null!=(h=null==j?void 0:j.badge)?h:C.Badge)?d:A,ee=null!=(m=null==L?void 0:L.root)?m:O.root,te=null!=(v=null==L?void 0:L.badge)?v:O.badge,ne=(0,c.A)({elementType:J,externalSlotProps:ee,externalForwardedProps:z,additionalProps:{ref:t,as:k},ownerState:Q,className:(0,a.A)(null==ee?void 0:ee.className,Z.root,E)}),re=(0,c.A)({elementType:$,externalSlotProps:te,ownerState:Q,className:(0,a.A)(Z.badge,null==te?void 0:te.className)});return(0,y.jsxs)(J,(0,r.A)({},ne,{children:[T,(0,y.jsx)($,(0,r.A)({},re,{children:Y}))]}))}))},28843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GlobalStyles:()=>A.A,StyledEngineProvider:()=>w.A,ThemeContext:()=>s.T,css:()=>b.AH,default:()=>x,internal_processStyles:()=>S,keyframes:()=>b.i7});var r=n(9950),o=n(58168);var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const a=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var s=n(70151),l=n(71783),c=n(24386),u=n(96477),d=a,f=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?d:f},h=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},m=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;(0,l.SF)(t,n,r);(0,u.s)((function(){return(0,l.sk)(t,n,r)}));return null};const g=function e(t,n){var i,a,u=t.__emotion_real===t,d=u&&t.__emotion_base||t;void 0!==n&&(i=n.label,a=n.target);var f=h(t,n,u),g=f||p(d),v=!g("as");return function(){var y=arguments,b=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&b.push("label:"+i+";"),null==y[0]||void 0===y[0].raw)b.push.apply(b,y);else{0,b.push(y[0][0]);for(var w=y.length,A=1;A{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},29120:(e,t,n)=>{"use strict";n.d(t,{A:()=>L});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(3484),l=n(70134),c=n(98370),u=n(96039),d=n(59254),f=n(18463),p=n(55158),h=n(49456),m=n(61262),g=n(59520),v=n(21538),y=n(12620),b=n(89222),w=n(52478);function A(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function x(e){return parseInt((0,b.A)(e).getComputedStyle(e).paddingRight,10)||0}function S(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,(e=>{const t=-1===i.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&A(e,o)}))}function E(e,t){let n=-1;return e.some(((e,r)=>!!t(e)&&(n=r,!0))),n}function k(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=(0,m.A)(e);return t.body===e?(0,b.A)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=(0,w.A)((0,m.A)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight="".concat(x(r)+e,"px");const t=(0,m.A)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight="".concat(x(t)+e,"px")}))}let e;if(r.parentNode instanceof DocumentFragment)e=(0,m.A)(r).body;else{const t=r.parentElement,n=(0,b.A)(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((e=>{let{value:t,el:n,property:r}=e;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}const C=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&A(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);S(t,e.mount,e.modalRef,r,!0);const o=E(this.containers,(e=>e.container===t));return-1!==o?(this.containers[o].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=E(this.containers,(t=>-1!==t.modals.indexOf(e))),r=this.containers[n];r.restore||(r.restore=k(r,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.modals.indexOf(e);if(-1===n)return n;const r=E(this.containers,(t=>-1!==t.modals.indexOf(e))),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(n,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&A(e.modalRef,t),S(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&A(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const O=function(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:a=C,closeAfterTransition:s=!1,onTransitionEnter:l,onTransitionExited:c,children:u,onClose:d,open:f,rootRef:p}=e,b=i.useRef({}),w=i.useRef(null),x=i.useRef(null),S=(0,h.A)(x,p),[E,k]=i.useState(!f),O=function(e){return!!e&&e.props.hasOwnProperty("in")}(u);let T=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(T=!1);const R=()=>(b.current.modalRef=x.current,b.current.mount=w.current,b.current),_=()=>{a.mount(R(),{disableScrollLock:r}),x.current&&(x.current.scrollTop=0)},M=(0,g.A)((()=>{const e=function(e){return"function"===typeof e?e():e}(t)||(0,m.A)(w.current).body;a.add(R(),e),x.current&&_()})),P=i.useCallback((()=>a.isTopModal(R())),[a]),I=(0,g.A)((e=>{w.current=e,e&&(f&&P()?_():x.current&&A(x.current,T))})),j=i.useCallback((()=>{a.remove(R(),T)}),[T,a]);i.useEffect((()=>()=>{j()}),[j]),i.useEffect((()=>{f?M():O&&s||j()}),[f,j,O,s,M]);const L=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&P()&&(n||(t.stopPropagation(),d&&d(t,"escapeKeyDown")))},N=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&d&&d(t,"backdropClick")};return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,y.A)(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r=(0,o.A)({},n,t);return(0,o.A)({role:"presentation"},r,{onKeyDown:L(r),ref:S})},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.A)({"aria-hidden":!0},e,{onClick:N(e),open:f})},getTransitionProps:()=>({onEnter:(0,v.A)((()=>{k(!1),l&&l()}),null==u?void 0:u.props.onEnter),onExited:(0,v.A)((()=>{k(!0),c&&c(),s&&j()}),null==u?void 0:u.props.onExited)}),rootRef:S,portalRef:I,isTopModal:P,exited:E,hasTransition:O}};var T=n(45558),R=n(1614);function _(e){return(0,R.Ay)("MuiModal",e)}(0,T.A)("MuiModal",["root","hidden","backdrop"]);var M=n(44414);const P=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],I=(0,d.Ay)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!n.open&&n.exited&&{visibility:"hidden"})})),j=(0,d.Ay)(p.A,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),L=i.forwardRef((function(e,t){var n,d,p,h,m,g;const v=(0,f.b)({name:"MuiModal",props:e}),{BackdropComponent:y=j,BackdropProps:b,className:w,closeAfterTransition:A=!1,children:x,container:S,component:E,components:k={},componentsProps:C={},disableAutoFocus:T=!1,disableEnforceFocus:R=!1,disableEscapeKeyDown:L=!1,disablePortal:N=!1,disableRestoreFocus:B=!1,disableScrollLock:z=!1,hideBackdrop:D=!1,keepMounted:F=!1,onBackdropClick:H,open:W,slotProps:U,slots:V}=v,G=(0,r.A)(v,P),q=(0,o.A)({},v,{closeAfterTransition:A,disableAutoFocus:T,disableEnforceFocus:R,disableEscapeKeyDown:L,disablePortal:N,disableRestoreFocus:B,disableScrollLock:z,hideBackdrop:D,keepMounted:F}),{getRootProps:K,getBackdropProps:X,getTransitionProps:Y,portalRef:Q,isTopModal:Z,exited:J,hasTransition:$}=O((0,o.A)({},q,{rootRef:t})),ee=(0,o.A)({},q,{exited:J}),te=(e=>{const{open:t,exited:n,classes:r}=e,o={root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]};return(0,s.A)(o,_,r)})(ee),ne={};if(void 0===x.props.tabIndex&&(ne.tabIndex="-1"),$){const{onEnter:e,onExited:t}=Y();ne.onEnter=e,ne.onExited=t}const re=null!=(n=null!=(d=null==V?void 0:V.root)?d:k.Root)?n:I,oe=null!=(p=null!=(h=null==V?void 0:V.backdrop)?h:k.Backdrop)?p:y,ie=null!=(m=null==U?void 0:U.root)?m:C.root,ae=null!=(g=null==U?void 0:U.backdrop)?g:C.backdrop,se=(0,l.A)({elementType:re,externalSlotProps:ie,externalForwardedProps:G,getSlotProps:K,additionalProps:{ref:t,as:E},ownerState:ee,className:(0,a.A)(w,null==ie?void 0:ie.className,null==te?void 0:te.root,!ee.open&&ee.exited&&(null==te?void 0:te.hidden))}),le=(0,l.A)({elementType:oe,externalSlotProps:ae,additionalProps:b,getSlotProps:e=>X((0,o.A)({},e,{onClick:t=>{H&&H(t),null!=e&&e.onClick&&e.onClick(t)}})),className:(0,a.A)(null==ae?void 0:ae.className,null==b?void 0:b.className,null==te?void 0:te.backdrop),ownerState:ee});return F||W||$&&!J?(0,M.jsx)(u.A,{ref:Q,container:S,disablePortal:N,children:(0,M.jsxs)(re,(0,o.A)({},se,{children:[!D&&y?(0,M.jsx)(oe,(0,o.A)({},le)):null,(0,M.jsx)(c.A,{disableEnforceFocus:R,disableAutoFocus:T,disableRestoreFocus:B,isEnabled:Z,open:W,children:i.cloneElement(x,ne)})]}))}):null}))},30086:(e,t,n)=>{"use strict";function r(e,t){const n=this;if(n.vars&&"function"===typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}n.d(t,{A:()=>r})},30099:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});n(9950);var r=n(23235),o=n(44414);const i=(0,r.A)((0,o.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft")},31014:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(95014).A},31506:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(49456).A},31761:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[r];if(!(0>>1;ri(l,n))ci(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(ci(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function A(e){if(g=!1,w(e),!m)if(null!==r(c))m=!0,I(x);else{var t=r(u);null!==t&&j(A,t.startTime-e)}}function x(e,n){m=!1,g&&(g=!1,y(C),C=-1),h=!0;var i=p;try{for(w(n),f=r(c);null!==f&&(!(f.expirationTime>n)||e&&!R());){var a=f.callback;if("function"===typeof a){f.callback=null,p=f.priorityLevel;var s=a(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?f.callback=s:f===r(c)&&o(c),w(n)}else o(c);f=r(c)}if(null!==f)var l=!0;else{var d=r(u);null!==d&&j(A,d.startTime-n),l=!1}return l}finally{f=null,p=i,h=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,k=null,C=-1,O=5,T=-1;function R(){return!(t.unstable_now()-Te||125a?(e.sortIndex=i,n(u,e),null===r(c)&&e===r(u)&&(g?(y(C),C=-1):g=!0,j(A,i-a))):(e.sortIndex=s,n(c,e),m||h||(m=!0,I(x))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},32049:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var w=b.prototype=new y;w.constructor=b,m(w,v.prototype),w.isPureReactComponent=!0;var A=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,o)&&!E.hasOwnProperty(o)&&(i[o]=t[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1{"use strict";n.d(t,{Ay:()=>a});const r=e=>e,o=(()=>{let e=r;return{configure(t){e=t},generate:t=>e(t),reset(){e=r}}})(),i={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const r=i[t];return r?"".concat(n,"-").concat(r):"".concat(o.generate(e),"-").concat(t)}},32654:(e,t,n)=>{"use strict";var r=n(9950),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},33158:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});n(9950);var r=n(88283),o=n(44414);function i(e){const{styles:t,defaultTheme:n={}}=e,i="function"===typeof t?e=>{return t(void 0===(r=e)||null===r||0===Object.keys(r).length?n:e);var r}:t;return(0,o.jsx)(r.mL,{styles:i})}},33738:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var r=n(98587),o=n(58168),i=n(9950),a=n(72004),s=n(67279),l=n(38528),c=n(3484),u=n(59254),d=n(18463),f=n(75361),p=n(70576),h=n(14857),m=n(31506),g=n(45558),v=n(1614);function y(e){return(0,v.Ay)("MuiCollapse",e)}(0,g.A)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var b=n(44414);const w=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],A=(0,u.Ay)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],"entered"===n.state&&t.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&t.hidden]}})((e=>{let{theme:t,ownerState:n}=e;return(0,o.A)({height:0,overflow:"hidden",transition:t.transitions.create("height")},"horizontal"===n.orientation&&{height:"auto",width:0,transition:t.transitions.create("width")},"entered"===n.state&&(0,o.A)({height:"auto",overflow:"visible"},"horizontal"===n.orientation&&{width:"auto"}),"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&{visibility:"hidden"})})),x=(0,u.Ay)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})((e=>{let{ownerState:t}=e;return(0,o.A)({display:"flex",width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),S=(0,u.Ay)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})((e=>{let{ownerState:t}=e;return(0,o.A)({width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),E=i.forwardRef((function(e,t){const n=(0,d.b)({props:e,name:"MuiCollapse"}),{addEndListener:u,children:g,className:v,collapsedSize:E="0px",component:k,easing:C,in:O,onEnter:T,onEntered:R,onEntering:_,onExit:M,onExited:P,onExiting:I,orientation:j="vertical",style:L,timeout:N=f.p0.standard,TransitionComponent:B=s.Ay}=n,z=(0,r.A)(n,w),D=(0,o.A)({},n,{orientation:j,collapsedSize:E}),F=(e=>{const{orientation:t,classes:n}=e,r={root:["root","".concat(t)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(t)],wrapperInner:["wrapperInner","".concat(t)]};return(0,c.A)(r,y,n)})(D),H=(0,h.A)(),W=(0,l.A)(),U=i.useRef(null),V=i.useRef(),G="number"===typeof E?"".concat(E,"px"):E,q="horizontal"===j,K=q?"width":"height",X=i.useRef(null),Y=(0,m.A)(t,X),Q=e=>t=>{if(e){const n=X.current;void 0===t?e(n):e(n,t)}},Z=()=>U.current?U.current[q?"clientWidth":"clientHeight"]:0,J=Q(((e,t)=>{U.current&&q&&(U.current.style.position="absolute"),e.style[K]=G,T&&T(e,t)})),$=Q(((e,t)=>{const n=Z();U.current&&q&&(U.current.style.position="");const{duration:r,easing:o}=(0,p.c)({style:L,timeout:N,easing:C},{mode:"enter"});if("auto"===N){const t=H.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(t,"ms"),V.current=t}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style[K]="".concat(n,"px"),e.style.transitionTimingFunction=o,_&&_(e,t)})),ee=Q(((e,t)=>{e.style[K]="auto",R&&R(e,t)})),te=Q((e=>{e.style[K]="".concat(Z(),"px"),M&&M(e)})),ne=Q(P),re=Q((e=>{const t=Z(),{duration:n,easing:r}=(0,p.c)({style:L,timeout:N,easing:C},{mode:"exit"});if("auto"===N){const n=H.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(n,"ms"),V.current=n}else e.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");e.style[K]=G,e.style.transitionTimingFunction=r,I&&I(e)}));return(0,b.jsx)(B,(0,o.A)({in:O,onEnter:J,onEntered:ee,onEntering:$,onExit:te,onExited:ne,onExiting:re,addEndListener:e=>{"auto"===N&&W.start(V.current||0,e),u&&u(X.current,e)},nodeRef:X,timeout:"auto"===N?null:N},z,{children:(e,t)=>(0,b.jsx)(A,(0,o.A)({as:k,className:(0,a.A)(F.root,v,{entered:F.entered,exited:!O&&"0px"===G&&F.hidden}[e]),style:(0,o.A)({[q?"minWidth":"minHeight"]:G},L),ref:Y},t,{ownerState:(0,o.A)({},D,{state:e}),children:(0,b.jsx)(x,{ownerState:(0,o.A)({},D,{state:e}),className:F.wrapper,ref:U,children:(0,b.jsx)(S,{ownerState:(0,o.A)({},D,{state:e}),className:F.wrapperInner,children:g})})}))}))}));E.muiSupportAuto=!0;const k=E},34378:(e,t,n)=>{var r=n(14759);e.exports=function(){return r.Date.now()}},34677:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var r=n(64467);const o=Math.round;function i(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map((e=>parseFloat(e)));for(let o=0;o<3;o+=1)r[o]=t(r[o]||0,n[o]||"",o);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const a=(e,t,n)=>0===n?e:e/100;function s(e,t){const n=t||255;return e>n?n:e<0?0:e}class l{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if((0,r.A)(this,"isValid",!0),(0,r.A)(this,"r",0),(0,r.A)(this,"g",0),(0,r.A)(this,"b",0),(0,r.A)(this,"a",1),(0,r.A)(this,"_h",void 0),(0,r.A)(this,"_s",void 0),(0,r.A)(this,"_l",void 0),(0,r.A)(this,"_v",void 0),(0,r.A)(this,"_max",void 0),(0,r.A)(this,"_min",void 0),(0,r.A)(this,"_brightness",void 0),e)if("string"===typeof e){const n=e.trim();function o(e){return n.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(n)?this.fromHexString(n):o("rgb")?this.fromRgbString(n):o("hsl")?this.fromHslString(n):(o("hsv")||o("hsb"))&&this.fromHsvString(n)}else if(e instanceof l)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=s(e.r),this.g=s(e.g),this.b=s(e.b),this.a="number"===typeof e.a?s(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else{if(!t("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e));this.fromHsv(e)}else;}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return.2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if("undefined"===typeof this._h){const e=this.getMax()-this.getMin();this._h=0===e?0:o(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g0&&void 0!==arguments[0]?arguments[0]:10;const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:o(i("r")),g:o(i("g")),b:o(i("b")),a:o(100*i("a"))/100};return this._c(a)}tint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:255,g:255,b:255,a:1},e)}shade(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>o((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;const n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;const r=(this.b||0).toString(16);if(e+=2===r.length?r:"0"+r,"number"===typeof this.a&&this.a>=0&&this.a<1){const t=o(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=o(100*this.getSaturation()),n=o(100*this.getLightness());return 1!==this.a?"hsla(".concat(e,",").concat(t,"%,").concat(n,"%,").concat(this.a,")"):"hsl(".concat(e,",").concat(t,"%,").concat(n,"%)")}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=s(t,n),r}_c(e){return new this.constructor(e)}getMax(){return"undefined"===typeof this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return"undefined"===typeof this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl(e){let{h:t,s:n,l:r,a:i}=e;if(this._h=t%360,this._s=n,this._l=r,this.a="number"===typeof i?i:1,n<=0){const e=o(255*r);this.r=e,this.g=e,this.b=e}let a=0,s=0,l=0;const c=t/60,u=(1-Math.abs(2*r-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(a=u,s=d):c>=1&&c<2?(a=d,s=u):c>=2&&c<3?(s=u,l=d):c>=3&&c<4?(s=d,l=u):c>=4&&c<5?(a=d,l=u):c>=5&&c<6&&(a=u,l=d);const f=r-u/2;this.r=o(255*(a+f)),this.g=o(255*(s+f)),this.b=o(255*(l+f))}fromHsv(e){let{h:t,s:n,v:r,a:i}=e;this._h=t%360,this._s=n,this._v=r,this.a="number"===typeof i?i:1;const a=o(255*r);if(this.r=a,this.g=a,this.b=a,n<=0)return;const s=t/60,l=Math.floor(s),c=s-l,u=o(r*(1-n)*255),d=o(r*(1-n*c)*255),f=o(r*(1-n*(1-c))*255);switch(l){case 0:this.g=f,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=f;break;case 3:this.r=u,this.g=d;break;case 4:this.r=f,this.g=u;break;default:this.g=u,this.b=d}}fromHsvString(e){const t=i(e,a);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=i(e,a);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=i(e,((e,t)=>t.includes("%")?o(e/100*255):e));this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}},34805:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,MR:()=>o,Rg:()=>i,cR:()=>a});const r=(0,n(11359).Z0)({name:"fcm",initialState:{permission:null,token:null},reducers:{setFcmToken(e,t){e.token=t.payload},clearFcmToken(e){e.token=null},setFcmPermission(e,t){e.permission=t.payload}}}),{setFcmToken:o,clearFcmToken:i,setFcmPermission:a}=r.actions,s=r.reducer},36658:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9950);const o=function(e,t){var n,o;return r.isValidElement(e)&&-1!==t.indexOf(null!=(n=e.type.muiName)?n:null==(o=e.type)||null==(o=o._payload)||null==(o=o.value)?void 0:o.muiName)}},36889:(e,t,n)=>{"use strict";n.d(t,{z1:()=>k,cM:()=>m,u$:()=>V,UA:()=>_,uy:()=>g});var r=n(34677),o=2,i=.16,a=.05,s=.05,l=.15,c=5,u=4,d=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function f(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-o*t:Math.round(e.h)+o*t:n?Math.round(e.h)+o*t:Math.round(e.h)-o*t)<0?r+=360:r>=360&&(r-=360),r}function p(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-i*t:t===u?e.s+i:e.s+a*t)>1&&(r=1),n&&t===c&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(100*r)/100);var r}function h(e,t,n){var r;return r=n?e.v+s*t:e.v-l*t,r=Math.max(0,Math.min(1,r)),Math.round(100*r)/100}function m(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],o=new r.Y(e),i=o.toHsv(),a=c;a>0;a-=1){var s=new r.Y({h:f(i,a,!0),s:p(i,a,!0),v:h(i,a,!0)});n.push(s)}n.push(o);for(var l=1;l<=u;l+=1){var m=new r.Y({h:f(i,l),s:p(i,l),v:h(i,l)});n.push(m)}return"dark"===t.theme?d.map((function(e){var o=e.index,i=e.amount;return new r.Y(t.backgroundColor||"#141414").mix(n[o],i).toHexString()})):n.map((function(e){return e.toHexString()}))}var g={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},v=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];v.primary=v[5];var y=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];y.primary=y[5];var b=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];b.primary=b[5];var w=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];w.primary=w[5];var A=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];A.primary=A[5];var x=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];x.primary=x[5];var S=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];S.primary=S[5];var E=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];E.primary=E[5];var k=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];k.primary=k[5];var C=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];C.primary=C[5];var O=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];O.primary=O[5];var T=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];T.primary=T[5];var R=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];R.primary=R[5];var _={red:v,volcano:y,orange:b,gold:w,yellow:A,lime:x,green:S,cyan:E,blue:k,geekblue:C,purple:O,magenta:T,grey:R},M=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];M.primary=M[5];var P=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];P.primary=P[5];var I=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];I.primary=I[5];var j=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];j.primary=j[5];var L=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];L.primary=L[5];var N=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];N.primary=N[5];var B=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];B.primary=B[5];var z=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];z.primary=z[5];var D=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];D.primary=D[5];var F=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];F.primary=F[5];var H=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];H.primary=H[5];var W=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];W.primary=W[5];var U=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];U.primary=U[5];var V={red:M,volcano:P,orange:I,gold:j,yellow:L,lime:N,green:B,cyan:z,blue:D,geekblue:F,purple:H,magenta:W,grey:U}},37295:(e,t,n)=>{"use strict";var r=n(24994);t.Ay=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:n=m,rootShouldForwardProp:r=h,slotShouldForwardProp:l=h}=e,u=e=>(0,c.default)((0,o.default)({},e,{theme:v((0,o.default)({},e,{defaultTheme:n,themeId:t}))}));return u.__mui_systemSx=!0,function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:d,slot:p,skipVariantsResolver:m,skipSx:w,overridesResolver:A=y(g(p))}=c,x=(0,i.default)(c,f),S=void 0!==m?m:p&&"Root"!==p&&"root"!==p||!1,E=w||!1;let k=h;"Root"===p||"root"===p?k=r:p?k=l:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(k=void 0);const C=(0,a.default)(e,(0,o.default)({shouldForwardProp:k,label:undefined},x)),O=e=>"function"===typeof e&&e.__emotion_real!==e||(0,s.isPlainObject)(e)?r=>b(e,(0,o.default)({},r,{theme:v({theme:r.theme,defaultTheme:n,themeId:t})})):e,T=function(r){let i=O(r);for(var a=arguments.length,s=new Array(a>1?a-1:0),l=1;l{const r=v((0,o.default)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[d]||!r.components[d].styleOverrides)return null;const i=r.components[d].styleOverrides,a={};return Object.entries(i).forEach((t=>{let[n,i]=t;a[n]=b(i,(0,o.default)({},e,{theme:r}))})),A(e,a)})),d&&!S&&c.push((e=>{var r;const i=v((0,o.default)({},e,{defaultTheme:n,themeId:t}));return b({variants:null==i||null==(r=i.components)||null==(r=r[d])?void 0:r.variants},(0,o.default)({},e,{theme:i}))})),E||c.push(u);const f=c.length-s.length;if(Array.isArray(r)&&f>0){const e=new Array(f).fill("");i=[...r,...e],i.raw=[...r.raw,...e]}const p=C(i,...c);return e.muiName&&(p.muiName=e.muiName),p};return C.withConfig&&(T.withConfig=C.withConfig),T}};var o=r(n(94634)),i=r(n(54893)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}(n(28843)),s=n(78600),l=(r(n(69848)),r(n(14919)),r(n(49904))),c=r(n(28807));const u=["ownerState"],d=["variants"],f=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function h(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const m=(0,l.default)(),g=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function v(e){let{defaultTheme:t,theme:n,themeId:r}=e;return o=n,0===Object.keys(o).length?t:n[r]||n;var o}function y(e){return e?(t,n)=>n[e]:null}function b(e,t){let{ownerState:n}=t,r=(0,i.default)(t,u);const a="function"===typeof e?e((0,o.default)({ownerState:n},r)):e;if(Array.isArray(a))return a.flatMap((e=>b(e,(0,o.default)({ownerState:n},r))));if(a&&"object"===typeof a&&Array.isArray(a.variants)){const{variants:e=[]}=a;let t=(0,i.default)(a,d);return e.forEach((e=>{let i=!0;"function"===typeof e.props?i=e.props((0,o.default)({ownerState:n},r,n)):Object.keys(e.props).forEach((t=>{(null==n?void 0:n[t])!==e.props[t]&&r[t]!==e.props[t]&&(i=!1)})),i&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,o.default)({ownerState:n},r,n)):e.style))})),t}return a}},37476:(e,t,n)=>{"use strict";n.d(t,{A:()=>h,s:()=>m});var r=n(89379),o=n(80045),i=n(9950),a=n(16491),s=n(40165),l=n(33738),c=n(57191),u=n(48205),d=n(19489),f=n(44414);const p=["children","position","type","direction"],h=(0,i.forwardRef)(((e,t)=>{let{children:n,position:i="top-left",type:h="grow",direction:m="up"}=e,g=(0,o.A)(e,p),v={transformOrigin:"0 0 0"};switch(i){case"top-right":v={transformOrigin:"top right"};break;case"top":v={transformOrigin:"top"};break;case"bottom-left":v={transformOrigin:"bottom left"};break;case"bottom-right":v={transformOrigin:"bottom right"};break;case"bottom":v={transformOrigin:"bottom"};break;default:v={transformOrigin:"0 0 0"}}return(0,f.jsxs)(a.A,{ref:t,children:["grow"===h&&(0,f.jsx)(s.A,(0,r.A)((0,r.A)({},g),{},{timeout:{appear:0,enter:150,exit:150},children:(0,f.jsx)(a.A,{sx:v,children:n})})),"collapse"===h&&(0,f.jsx)(l.A,(0,r.A)((0,r.A)({},g),{},{sx:v,children:n})),"fade"===h&&(0,f.jsx)(c.A,(0,r.A)((0,r.A)({},g),{},{timeout:{appear:0,enter:300,exit:150},children:(0,f.jsx)(a.A,{sx:v,children:n})})),"slide"===h&&(0,f.jsx)(u.A,(0,r.A)((0,r.A)({},g),{},{timeout:{appear:0,enter:150,exit:150},direction:m,children:(0,f.jsx)(a.A,{sx:v,children:n})})),"zoom"===h&&(0,f.jsx)(d.A,(0,r.A)((0,r.A)({},g),{},{children:(0,f.jsx)(a.A,{sx:v,children:n})}))]})})),m=(0,i.forwardRef)((function(e,t){return(0,f.jsx)(d.A,(0,r.A)({ref:t,timeout:200},e))}))},37750:(e,t,n)=>{"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;nr})},38166:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(98587),o=n(58168),i=n(9417),a=n(77387),s=n(9950),l=n(28555);function c(e,t){var n=Object.create(null);return e&&s.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&(0,s.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var r=c(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var s={};for(var l in t){if(o[l])for(r=0;r{"use strict";var r=n(9950),o=n(75340);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n