PageSourceSearch

https://khmercare.com/_next/static/chunks/4964-ea752b650759d123.js

js khmercare.com collected 2026-10-02 00:00:24 UTC 11,776 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4964,3770,3201,2830],{3682:function(e,t,n){var r=n(85893),a=n(86010),l=n(67294),i=n(16109),o=n(76402);t.Z=function(e){let{type:t="text",className:n,style:s,helperText:c,pattern:d,refs:u,disabled:m,readOnly:h=!1,onChange:p,onClick:f,value:v,placeholder:g,showLabel:x=!1,isRequired:y=!1,isDetail:w=!1,label:b="",autoComplete:j="off"}=e,[E,N]=(0,l.useState)(!1);return(0,r.jsxs)("div",{className:(0,a.Z)("admin-input-container",n),style:s,children:[(0,r.jsxs)(i.Z.Label,{className:(0,a.Z)(E||v||0==v?"label-shrink":null,w&&m&&"admin-form-label-detail"),children:[g||b,y&&(0,r.jsx)("span",{className:"ms-1 admin-required-icon",children:"*"})]}),(0,r.jsx)("input",{onKeyPress:e=>{"number"==t&&(0,o.zL)(e,!1)},type:t,value:v,pattern:d,onChange:p,ref:u,disabled:m,readOnly:h,autoComplete:j,onFocus:e=>{h||N((null==e?void 0:e.type)==="focus")},onClick:f,onBlur:e=>{N((null==e?void 0:e.type)!=="blur")},className:(0,a.Z)("form-control admin-input pt-3",w&&m&&"admin-form-detail")}),c&&(0,r.jsx)("p",{className:"form-text-error",children:c})]})}},75210:function(e,t,n){n.d(t,{P:function(){return p},Z:function(){return f}});var r=n(85893),a=n(75548),l=n(86010),i=n(67294),o=n(96120),s=n.n(o),c=n(53201);function d(e){let{onClose:t,onSubmitCrop:n,isShow:a=!1,src:l="",originalFile:o,circularCrop:d=!1,aspect:u=1}=e,[m,h]=(0,i.useState)({unit:"%",width:100,aspect:u}),p=(0,i.useRef)(),[f,v]=(0,i.useState)(),g=async e=>{if(p&&e.width&&e.height){let t=await x(p.current,e,null==o?void 0:o.fileName);v(t)}},x=(e,t,n)=>{let r=document.createElement("canvas"),a=window.devicePixelRatio,l=e.naturalWidth/e.width,i=e.naturalHeight/e.height,s=r.getContext("2d");return r.width=t.width*a*l,r.height=t.height*a*i,s.setTransform(a,0,0,a,0,0),s.imageSmoothingQuality="high",s.drawImage(e,t.x*l,t.y*i,t.width*l,t.height*i,0,0,t.width*l,t.height*i),new Promise((e,t)=>{r.toBlob(r=>{if(!r){t(Error("Cannot crop the image."));return}r.name=n;let a=window.URL.createObjectURL(r);e({blobFile:r,blobUrl:a})},(null==o?void 0:o.type)||"image/jpeg",1)})};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.default,{onClose:t,hasHeader:!0,isShow:a,size:"xl",title:"Crop Image",children:[(0,r.jsx)(c.default.Body,{children:(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-center",style:{minHeight:"300px"},children:(0,r.jsx)(s(),{src:l,crop:m,ruleOfThirds:!0,onImageLoaded:e=>p.current=e,onComplete:e=>g(e),onChange:e=>h(e),circularCrop:d})})}),(0,r.jsx)(c.default.Footer,{className:"text-center",children:(0,r.jsx)("button",{className:"admin-btn-crop-img",onClick:()=>{t(),n(f)},children:"Crop"})})]})})}var u=n(45646),m=n(73930),h=n(81534);let p=e=>{let{children:t,className:n,helperText:a,disabled:i=!1,isDetail:o=!1}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:(0,l.Z)("admin-upload-img-card",i&&o?"border-0 p-0":"",n),children:t}),(0,r.jsx)("p",{className:"invalid-feedback text-error d-block",children:a})]})};function f(e){let{label:t="",src:n="",type:o=m.U.SQUARE,className:s="",style:c,placeholder:p="Upload Image",onChange:f,onRemove:v,helperText:g,disabled:x=!1,aspectWidth:y=1,aspectHeight:w=1,circularCrop:b=!1,isDetail:j=!1,limitSize:E}=e,[N,C]=(0,i.useState)(),[L,I]=(0,i.useState)(!1),[U,Z]=(0,i.useState)(!1),R=1048576*E,k=e=>{if(!e)return;let t=new FormData;U&&(t.append("filename",null==e?void 0:e.blobFile,null==U?void 0:U.name),a.Z.uploadImageV2(t).then(t=>{f&&f({...null==t?void 0:t.data,blobUrl:null==e?void 0:e.blobUrl})}).catch(e=>h.ZP.error(e)))};return(0,i.useEffect)(()=>{N&&I(!0)},[N]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"d-block mb-1 web-fz-12",children:t}),(0,r.jsxs)("div",{className:(0,l.Z)("admin-upload-img",null==o?void 0:o.toLowerCase(),s),style:c,children:[!n&&(0,r.jsx)("div",{className:"w-100 h-100 d-flex flex-wrap align-items-center justify-content-center p-2 text-center",children:p}),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{className:"uploaded-img",src:n}),!x&&(0,r.jsx)("i",{className:"fa fa-times remove-btn","aria-hidden":"true",onClick:()=>v&&v(null)})]}),(0,r.jsx)("input",{accept:"image/*",className:(0,l.Z)("input-upload",null==o?void 0:o.toLowerCase()),type:"file",onChange:e=>{var t;let n=null===(t=e.target.files[0])||void 0===t?void 0:t.size;if(n>R)f({error:"Photo size should not be greater than ".concat(E," MB")}
1),Z(!1);else if(e.target.files&&e.target.files.length>0){let t=e.target.files[0];Z(t);let n=new FileReader;n.addEventListener("load",()=>C(n.result)),n.readAsDataURL(t)}},title:"",disabled:x,value:""})]}),(0,r.jsx)(d,{src:N,originalFile:U,isShow:L,onClose:()=>{I(!1),C("")},onSubmitCrop:e=>k(e),circularCrop:b,aspect:y/w}),g&&(0,r.jsx)("p",{className:"invalid-feedback text-error d-block",children:g})]})}},45646:function(e,t,n){var r=n(85893),a=n(25675),l=n.n(a),i=n(67294),o=n(97254);t.Z=e=>{let{brokenImgUrl:t=o.Z.EMPTY_IMG,width:n=0,height:a=0,...s}=e,{src:c,...d}=s,[u,m]=(0,i.useState)(!1);return(0,r.jsx)(l(),{...d,priority:!0,src:c&&!u?c+"":t,unoptimized:!0,onError:e=>{m((null==e?void 0:e.type)==="error")},width:n,height:a,style:{maxWidth:"100%",height:"auto"},alt:"image"})}},73930:function(e,t,n){n.d(t,{U:function(){return s}});var r=n(85893),a=n(97254),l=n(86010),i=n(25675),o=n.n(i);n(67294),n(45646);let s={CIRCLE:"CIRCLE",RECTANGLE:"RECTANGLE",SQUARE:"SQUARE",FULL_WIDTH:"FULL-WIDTH"};t.Z=e=>{let{src:t=a.Z.EMPTY_IMG,type:n=s.SQUARE,className:i}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:(0,l.Z)("app-table-img position-relative",null==n?void 0:n.toLowerCase(),i),children:(0,r.jsx)(o(),{src:t,width:53,height:53,style:{maxWidth:"100%",height:"100%",objectFit:"contain"},alt:"image"})})})}},51813:function(e,t,n){n.d(t,{o:function(){return a}});var r=n(96486);let a={getErrorMessage:(e,t,n,a)=>{var l;let i=r.get(e,"".concat(t,".type"));if(i)switch(i){case"required":return"".concat(n," is required");case"minLength":case"maxLength":return a||"".concat(n," should contain 8 characters");case"pattern":return a||"".concat(n," is invalid");case"manual":return"".concat(null==e?void 0:e[t].message);case"min":return a||"".concat(n," cannot be less than 0");case"max":return a||"".concat(n," cannot be greater than 100");case"validate":return(null===(l=e[t])||void 0===l?void 0:l.message)||a;default:return""}}}},75548:function(e,t,n){var r=n(95147);let a="v2/uploads/images";t.Z=new class{async uploadFile(e){try{let t=await r.default.post("v2/uploads/files",e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadMultiFiles(e){try{let t=await r.default.post("v2/uploads/all-type/multiple",e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadImageV2(e){try{let t=await r.default.post("".concat(a),e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadVideo(e){try{let t=await r.default.post("v1/uploads/video",e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadVideoV2(e){try{let t=await r.default.post("v2/uploads/video",e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadMultipleImage(e){try{let t=await r.default.post("v1/uploads/images/multiple",e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}async uploadMultipleImageV2(e){try{let t=await r.default.post("".concat(a,"/mulit"),e);return{...t,isError:!1}}catch(e){return{...e,isError:!0}}}}},53201:function(e,t,n){n.r(t);var r=n(85893),a=n(86010);n(67294);var l=n(10019);function i(e){let{backdrop:t="static",children:n,className:i,contentClassName:o,dialogClassName:s,hint:c,isShow:d,hasBack:u=!1,size:m,backButton:h,title:p,onClose:f,closeButton:v=!0,hasHeader:g=!0,
1centered:x=!0}=e;return(0,r.jsxs)(l.Z,{className:(0,a.Z)("base-modal",i),contentClassName:(0,a.Z)(o),show:d,onHide:f,centered:x,dialogClassName:(0,a.Z)(s),backdrop:t,size:m,"aria-labelledby":"contained-modal-title-vcenter",children:[g&&(0,r.jsxs)(l.Z.Header,{className:"border-0 text-center position-relative",closeButton:v,children:[u&&(0,r.jsx)("div",{className:"position-absolute ",onClick:h,children:(0,r.jsxs)("h6",{children:[(0,r.jsx)("div",{className:"color-green d-inline-flex",children:"❮"}),(0,r.jsx)("span",{className:"ms-1 custom-back-text",children:"Back"})]})}),(0,r.jsx)(l.Z.Title,{className:"w-100 center",children:(0,r.jsx)("h5",{className:"header-title",children:p})})]}),n]})}n(5152),i.Body=e=>{let{children:t,className:n,style:l,hasHeader:i=!0}=e;return(0,r.jsx)("div",{className:(0,a.Z)("modal-body",i?"px-5 py-4":"p-0 modal-body-top-radius modal-body-bottom-radius",n),style:l,children:t})},i.Footer=e=>{let{children:t,className:n,style:l}=e;return(0,r.jsx)("div",{className:(0,a.Z)("modal-footer d-flex justify-content-center px-5",n),style:l,children:t})},t.default=i},97254:function(e,t,n){n.d(t,{Z:function(){return r}});let r={EMPTY_IMG:"/assets/empty-photo.png",EMPTY_PROFILE:"/assets/icon/profile-empty.png"}},76402:function(e,t,n){n.d(t,{IL:function(){return u},JO:function(){return c},Wc:function(){return h},lm:function(){return s},nz:function(){return o},q4:function(){return i},w4:function(){return d},zL:function(){return m}});var r=n(95147);n(81534);var a=n(96486),l=n.n(a);let i={PENDING:"PENDING",SUCCESS:"SUCCESS",FAILED:"FAILED",INITIAL:"INITIAL"},o=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Donation Report",a=arguments.length>2?arguments[2]:void 0,o=null===(t=e?.categoryIds||[])||void 0===t?void 0:t.join("|"),c={...l().omit(e,"categoryIds"),categoryIds:o,limit:0,offset:0};a(i.PENDING),r.default.get("/v2/admin/stories/transactions/exports",{params:c,responseType:"arraybuffer",headers:{Accept:"application/octet-stream"}}).then(e=>{s(e.data,n,"xlsx"),a(i.SUCCESS)}).catch(e=>{a(i.FAILED)})},s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jpg",r=new Blob([e]),a=window.URL.createObjectURL(r),l=document.createElement("a");document.body.appendChild(l),l.setAttribute("style","display: none"),l.href=a,l.download="".concat(t,".").concat(n),l.click(),window.URL.revokeObjectURL(a),l.remove()};function c(e,t,n){return new Promise((r,a)=>{try{(function(e,t,n){let r=new Blob([e]),a=window.URL.createObjectURL(r),l=document.createElement("a");document.body.appendChild(l),l.setAttribute("style","display: none"),l.href=a,l.download="".concat(t,".").concat(n),l.click(),window.URL.revokeObjectURL(a),l.remove()})(e,t,n),r({file:e,filename:t,extension:n})}catch(e){a(e)}})}function d(e,t){let n=document.createElement("a");document.body.appendChild(n),n.setAttribute("style","display: none"),n.href=e,n.download="".concat(t),n.target="_blank",n.click(),window.URL.revokeObjectURL(e),n.remove()}function u(e){return new Promise((t,n)=>{let a=new FormData;for(let t=0;t<(null==e?void 0:e.length);t++)a.append("filenames",e[t]);r.default.post("v2/uploads/all-type/multiple",a).then(e=>{t(e)}).catch(e=>{var t,r;null==e||null===(r=e.response)||void 0===r||null===(t=r.data)||void 0===t||t.message,n(e)})})}function m(e){var t,n,r,a,l,i,o,s,c,d,u;let m=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=e||window.event;let h=(null===(t=e)||void 0===t?void 0:t.which)?null===(n=e)||void 0===n?void 0:n.which:null===(r=e)||void 0===r?void 0:r.keyCode;if(m){if(46===h&&((null===(i=e)||void 0===i?void 0:null===(l=i.target)||void 0===l?void 0:null===(a=l.value)||void 0===a?void 0:a.length)===0||(null===(c=e)||void 0===c?void 0:null===(s=c.target)||void 0===s?void 0:null===(o=s.value)||void 0===o?void 0:o.indexOf("."))!==-1)){e.preventDefault();return}if(h>31&&(h<48||h>57)&&46!==h)return null===(d=e)||void 0===d||d.preventDefault(),!1}else if(h>31&&(h<48||h>57))return null===(u=e)||void 0===u||u.preventDefault(),!1}function h(e,t,n){let r=Array.from(e),[a]=r.splice(t,1);return r.splice(n,0,a),r}}}]);

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.