PageSourceSearch

https://cessna.org/_next/static/chunks/2243-1746612a27809541.js

js cessna.org collected 2026-10-02 11:41:58 UTC 6,208 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2243],{22243:(e,t,o)=>{o.r(t),o.d(t,{default:()=>z});var r=o(37876),l=o(14232),s=o(74613),n=o(56720),i=o(97719),a=o(64838),d=o(94998),c=o(7001),u=o(60929),h=o(47191),x=o(18242),p=o(2509),g=o.n(p),m=o(31777),f=o(3751),j=o(40525),y=o(6226),v=o(24146),A=o(54587),b=o.n(A),w=o(2491),C=o.n(w),k=o(93385),N=o(28408);let S=l.forwardRef((e,t)=>{let{children:o,onClick:l}=e;return(0,r.jsx)("div",{ref:t,onClick:e=>{e.preventDefault(),l(e)},style:{cursor:"pointer",background:"rgba(0,0,0,0.6)",borderRadius:"4px",padding:"2px 5px",display:"flex",alignItems:"center"},children:o})});S.displayName="CustomToggle";let z=e=>{var t,o;let{refreshKey:p}=e,A=(0,m.wA)(),{user:w}=(0,m.d4)(e=>e.profile),{user:z,token:B}=(0,m.d4)(e=>e.auth),[P,D]=l.useState([]),[T,I]=l.useState(!0),E=(null==z||null==(t=z.data)?void 0:t.id)===(null==w||null==(o=w.user)?void 0:o.id),[R,_]=l.useState([]),[F,G]=l.useState(!1),[Y,M]=l.useState(0),[K,U]=l.useState(!1),[H,W]=l.useState(!1),q=l.useCallback(async()=>{try{var e;I(!0);let t=await j.A.get("/user/photo/getAllPhotos?userId=".concat(w.user.id));D((null==(e=t.data)?void 0:e.data)||[])}catch(e){console.error("Error fetching photos:",e)}finally{I(!1)}},[w]);l.useEffect(()=>{var e;(null==w||null==(e=w.user)?void 0:e.id)&&q()},[w,p,q]);let J=e=>{R.length>0||(M(e),G(!0))},L=P.length>0&&R.length===P.length,O=R.length>0,Q=e=>{_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},V=async e=>{if(!e||0===e.length)return;let t="Are you sure you want to delete these ".concat(e.length," photos? This action cannot be undone.");if((await C().fire({title:"Are you sure?",text:t,icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:"#3085d6",confirmButtonText:"Yes, delete it!"})).isConfirmed){var o,r,l;try{let t=await j.A.delete("/user/photo/delete",{data:{ids:e},headers:{Authorization:"Bearer ".concat(B)}});q(),_([]),A((0,f.A3)()),C().fire("Deleted!",null==(o=t.data)?void 0:o.msg,"success")}catch(e){console.error("Delete failed",e),C().fire("Error!",null==(l=e.response)||null==(r=l.data)?void 0:r.msg,"error")}}},X=async e=>{if((await C().fire({title:"Are you sure?",text:"Are you sure you want to delete this photo? This action cannot be undone.",icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:"#3085d6",confirmButtonText:"Yes, delete it!"})).isConfirmed){var t,o,r;try{let o=await j.A.delete("/user/photo/delete",{data:{ids:[e]},headers:{Authorization:"Bearer ".concat(B)}});q(),A((0,f.A3)()),C().fire("Deleted!",null==(t=o.data)?void 0:t.msg,"success")}catch(e){console.error("Delete failed",e),C().fire("Error!",(null==(r=e.response)||null==(o=r.data)?void 0:o.msg)||"Failed to delete","error")}}};return(0,r.jsxs)(r.Fragment,{children:[E&&P.length>0&&(0,r.jsxs)("div",{className:"d-flex justify-content-end mb-3 gap-3 align-items-center",children:[O&&R.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.A,{placement:"top",overlay:(0,r.jsx)(n.A,{children:"Delete"}),children:(0,r.jsx)("div",{style:{cursor:"pointer"},onClick:()=>V(R),children:(0,r.jsx)(v.dW_,{size:24,color:"#dc3545"})})})}),(0,r.jsx)(s.A,{placement:"top",overlay:(0,r.jsx)(n.A,{children:"Select All"}),children:(0,r.jsx)("div",{onClick:()=>{L?_([]):_(P.map(e=>e.id))},style:{cursor:"pointer",color:L?"#3d5afe":"#ccc"},children:L?(0,r.jsx)(v.G3G,{size:24}):(0,r.jsx)(v.KYr,{size:24})})})]}),(0,r.jsx)(i.A,{children:T?(0,r.jsx)("div",{className:"text-center w-100 py-5",children:(0,r.jsx)(a.A,{animation:"border"})}):0===P.length?(0,r.jsxs)(d.A,{className:"mb-3 mt-5",children:[(0,r.jsx)(d.A.Text,{id:"basic-addon1",style:{backgroundColor:"#00447c"},children:(0,r.jsx)(y.nP3,{style:{color:"#fff"}})}),(0,r.jsx)(c.A.Control,{as:"textarea",rows:1,className:"bg-white",disabled:!0,style:{resize:"none"},value:"Sorry, no photos were found."})]}):(0,r.jsx)(i.A,{className:"g-3",children:P.map((e,t)=>{let o=R.includes(e.id);return(0,r.jsx)(u.A,{md:3,sm:6,xs:12,children:(0,r.jsx)(h.A,{className:"".concat(g().infoCard," ").concat(g().photoCard),style:{border:"none",boxShadow:"none",background:"transparent"},children:(0,r.jsx)(h.A.Body,{p:0,className:"p-0",children:(0,r.jsxs)("div",{className:g().galleryContainer,style:{position:"relative"},children:[(0,r.jsx)(b(),{src:(null==e?void 0:e.imagePath.includes("uploads"))?"".concat("https://api.cessna.org","/").concat(null==e?void 0:e.imagePath):null==e?void 0:e.imagePath,alt:null==e?void 0:e.title,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",border:"none"},width:300,height:300,unoptimized:!0,onClick:()=>O?Q(e.id):J(t)}),E&&(0,r.jsx)("div",{className:o?void 0:g().moreActions,onClick:()=>{O?Q(e.id):J(t)},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:o?"rgba(0,0,0,0.4)":"rgba(0,0,0,0.1)",borderRadius:"10px",cursor:"pointer",display:"flex",justifyContent:"flex-start",alignItems:"flex-start",padding:"10px"},children:(0,r.jsx)(s.A,{placement:"top",overlay:(0,r.jsx)(n.A,{children:o?"Unselect":"Select"}),children:(0,r.jsx)("div",{onClick:t=>{t.stopPropagation(),Q(e.id)},children:o?(0,r.jsx)(v.G3G,{size:24,color:"#3d5afe",style:{background:"white",borderRadius:"50%"}}):(0,r.jsx)(v.KYr,{size:24,color:"white",style:{background:"rgba(0,0,0,0.3)",borderRadius:"50%"}})})})}),E&&!O&&(0,r.jsx)("div",{className:g().moreActions,style:{position:"absolute",top:"10px",right:"10px",zIndex:10},onClick:e=>e.stopPropagation(),children:(0,r.jsxs)(x.A,{align:"end",children:[(0,r.jsx)(s.A,{placement:"top",overlay:(0,r.jsx)(n.A,{children:"More actions"}),children:(0,r.jsx)(x.A.Toggle,{as:S,children:(0,r.jsx)(v.g84,{c
1olor:"white",size:20})})}),(0,r.jsxs)(x.A.Menu,{children:[(0,r.jsx)(x.A.Item,{onClick:()=>{var t;return t=[e.id],void(W(P.filter(e=>t.includes(e.id))),U(!0))},children:"Move"}),(0,r.jsx)(x.A.Item,{onClick:()=>V([e.id]),className:"text-danger",children:"Delete"})]})]})})]})})})},e.id||t)})})}),K&&(0,r.jsx)(k.default,{show:K,onClose:()=>U(!1),selectedPhotos:H,onSuccess:()=>{q(),_([])}}),(0,r.jsx)(N.A,{show:F,onHide:()=>G(!1),photos:P,initialIndex:Y,onDelete:X,targetType:"userPhoto",onDescriptionUpdate:(e,t)=>{D(o=>o.map(o=>o.id===e?{...o,description:t}:o))}})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.