Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.116.27.225
(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{1130:function(e,t,n){"use strict";n.r(t);var a=n(3),r=n(41),l=n.n(r),o=n(68),s=n(99),i=n(100),c=n(102),u=n(101),d=n(103),m=n(1),p=n.n(m),f=n(858),h=n(1139),v=n(1106),g=n(272),E=n(1101),w=n(1098),k=n(1100),b=n(104),C=n(269),y=n(266),O=function(e){return console.log("from edit",e),function(){var t=Object(o.a)(l.a.mark(function t(n,a){var r,o;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"SET_LOADER"}),r=a(),t.next=4,C.a.post("/app.php?a=getAllRemainders&univcode="+r.univ.funivcode,{frmdby:e});case 4:o=t.sent,n({type:"UNSET_LOADER"}),console.log("response",o,typeof o.data),"object"!==typeof o.data.data?n({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):n({type:"ALL_REMINDER_DATA",payload:o.data});case 8:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},S=n(270),R=n(1135),D=n(273),x=n.n(D),j=(n(514),function(e){function t(){var e,n;Object(s.a)(this,t);for(var a=arguments.length,r=new Array(a),l=0;l<a;l++)r[l]=arguments[l];return(n=Object(c.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(r)))).state={newstatus:"",newReply:""},n.handlesubmit=function(){var e={fid:n.props.coldata.fid,reply:n.state.newReply,status:n.state.newstatus,frmddetl:n.props.coldata.frmddetl};console.log(e),n.props.addCommentOnReminder(e)},n}return Object(d.a)(t,e),Object(i.a)(t,[{key:"render",value:function(){var e=this;console.log("asasasa",this.props);return p.a.createElement("div",null,p.a.createElement("div",{className:"col-md-12 col-lg-12 col-sm-10 col-xs-12"},p.a.createElement(R.a,{as:"h3",icon:!0,textAlign:"center"},p.a.createElement(R.a.Content,null,"Reply To Reminder")),p.a.createElement(E.a,{padded:"very"},p.a.createElement(E.a.Body,null,p.a.createElement(E.a.Row,null),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Reminded By"),p.a.createElement(E.a.Cell,null,p.a.createElement("b",null,this.props.name))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Reminded On"),p.a.createElement(E.a.Cell,null,p.a.createElement("b",null,this.props.coldata.fcrdate," "))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Expriry Date "),p.a.createElement(E.a.Cell,null,p.a.createElement("b",null,this.props.coldata.fexpdate," "))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Subject"),p.a.createElement(E.a.Cell,null,p.a.createElement("b",null,this.props.coldata.frmdsub))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Deatils"),p.a.createElement(E.a.Cell,null,p.a.createElement("b",null,this.props.coldata.frmddetl))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Reply"),p.a.createElement(E.a.Cell,null,p.a.createElement(w.a.TextArea,{width:16,style:{width:"300px"},onChange:function(t){e.setState({newReply:t.target.value})},name:"frmddetl",placeholder:"Reply"}))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,"Status"),p.a.createElement(E.a.Cell,null,p.a.createElement(k.a,{placeholder:"Reminder To",fluid:!0,onChange:function(t,n){n.name;var a=n.value;e.setState({newstatus:a})},search:!0,label:"Enter Reminder To",selection:!0,value:this.state.newstatus,name:"frmdto",options:[{key:1,value:"1",text:"1"},{key:2,value:"2",text:"2"},{key:3,value:"3",text:"3"},{key:4,value:"4",text:"4"},{key:5,value:"5",text:"5"}]}))),p.a.createElement(E.a.Row,null,p.a.createElement(E.a.Cell,null,p.a.createElement(v.a,{basic:!0,color:"green",onClick:this.handlesubmit,content:"Save",icon:"file"})),p.a.createElement(E.a.Cell,null))))))}}]),t}(m.Component)),M=Object(b.b)(function(e){return{reminderList:e.ALLReminderTask,memberData:e.taskReminderData,replyData:e.changeDataReminder}},{addCommentOnReminder:function(e){return console.log("from edit",e),function(){var t=Object(o.a)(l.a.mark(function t(n,a){var r,o,s,i,c;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"SET_LOADER"}),r=a(),t.next=4,C.a.post("/app.php?a=addCommentOnReminder&univcode="+r.univ.funivcode,{data:e});case 4:o=t.sent,n({type:"UNSET_LOADER"}),console.log("msgmsgmsg",o.data.data.msg),"object"!==typeof o.data?(s={header:"Error",content:"Something went wrong"},n(Object(y.w)(s))):-1===o.data.error_code?(i={header:"Error",content:o.data.data.msg},n(Object(y.w)(i))):(c={header:"Success",content:o.data.data.msg},n(Object(y.w)(c)));case 8:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},changeDataReminder:function(e,t){return{type:"CHANGE_DATA_REMINDER",payload:{name:e,value:t}}},TaskList:O})(j),I=function(e){function t(){var e,n;Object(s.a)(this,t);for(var r=arguments.length,i=new Array(r),d=0;d<r;d++)i[d]=arguments[d];return(n=Object(c.a)(this,(e=Object(u.a)(t)).call.apply(e,[this].concat(i)))).state={code:"",name:"",left:"col-md-12",right:"col-md-6",showright:!1,Fname:"",newReminder:!1},n.handleChange=function(){var e=Object(o.a)(l.a.mark(function e(t,a){var r,o;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=a.name,o=a.value,console.log("{ name, value ",r,o),n.props.changeData(r,o);case 3:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),n.handleChangeDate=function(){var e=Object(o.a)(l.a.mark(function e(t,a){return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n.props.changeData(t,a);case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),n.saveReminder=function(){var e={frmdby:n.props.loginUser.fuserid,fexpdate:n.props.memberData.fexdate,fpriority:n.props.memberData.fpriority,frmddetl:n.props.memberData.frmddetl,frmdsub:n.props.memberData.frmdsub,frmdto:n.props.memberData.frmdto};n.props.SaveReminderData(e),console.log("this.",e)},n.componentDidMount=function(){n.props.taskReminderUser();n.props.TaskList(n.props.loginUser.fuserid)},n.renderHeader=function(){return p.a.createElement(h.a.Header,{style:{display:"flex"}},p.a.createElement("h3",null,"Task Reminder"),p.a.createElement("div",{className:"ml-auto"},p.a.createElement(v.a,{basic:!0,color:"blue",onClick:function(){n.setState({newReminder:!0,showright:!1})},content:"New",icon:"add"}),p.a.createElement(v.a,{basic:!0,color:"black",icon:"ban",onClick:function(){n.setState({newReminder:!1,showright:!1})},content:"Cancel"}),p.a.createElement(f.a,{to:"/dashboard"},p.a.createElement(v.a,{basic:!0,color:"red",content:"Exit",icon:"home"}))))},n.renderForm=function(){var e=[],t=Object(S.i)();return console.log("daatfina",n.props.memberData,n.props.loginUser),e=[],n.props.memberData.data.map(function(t){return t.fregno!=n.props.loginUser.fuserid&&e.push({key:t.fregno,value:t.fregno,text:"".concat(t.fregno," ").concat(t.fname)}),null}),p.a.createElement("div",{className:"animated fadeIn"},p.a.createElement(h.a,{fluid:!0},p.a.createElement(h.a.Content,null,n.renderHeader(),p.a.createElement(g.a,null),p.a.createElement(h.a.Description,{style:{overflowY:"auto",height:"".concat(t,"px")}},p.a.createElement("div",{className:"row",style:{margin:"0px",padding:"0px"}},!n.state.newReminder&&p.a.createElement("div",{className:n.state.showright?n.state.right:n.state.left},p.a.createElement("div",null,p.a.createElement("br",null),p.a.createElement(h.a.Header,{style:{display:"flex"}},p.a.createElement("h3",null,"Task Reminder"),p.a.createElement("div",{className:"ml-auto"})),p.a.createElement(h.a.Content,null,p.a.createElement(g.a,null),p.a.createElement(h.a.Description,null,p.a.createElement(E.a,{celled:!0,padded:!0,selectable:!0,size:"small",color:"olive",className:"tbl sticky"},p.a.createElement(E.a.Header,null,p.a.createElement(E.a.Row,{textAlign:"center"},p.a.createElement(E.a.HeaderCell,null,"Sl.No."),p.a.createElement(E.a.HeaderCell,null,"Reminded By"),p.a.createElement(E.a.HeaderCell,null,"Reminded On"," "),p.a.createElement(E.a.HeaderCell,null," Subject"),p.a.createElement(E.a.HeaderCell,null,"Status"),p.a.createElement(E.a.HeaderCell,null,"Priority"))),p.a.createElement(E.a.Body,null,n.props.reminderList.length>0&&n.props.reminderList.map(function(e,t){return p.a.createElement(E.a.Row,{onClick:Object(o.a)(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setState({showright:!0,code:e.frmdto,Fname:e.FNAME,reminon:e.fcrdate,coldata:e});case 2:case"end":return t.stop()}},t)})),key:t,style:{overflow:"hidden"}},p.a.createElement(E.a.Cell,{textAlign:"center"},t+1),p.a.createElement(E.a.Cell,null,e.FNAME),p.a.createElement(E.a.Cell,null,e.fcrdate),p.a.createElement(E.a.Cell,null,e.frmdsub),p.a.createElement(E.a.Cell,null,e.fstatus),p.a.createElement(E.a.Cell,null,e.fpriority))}))))))),n.state.showright&&p.a.createElement("div",{className:n.state.right},p.a.createElement(M,{name:n.state.Fname,coldata:n.state.coldata,code:n.state.code}))),n.state.newReminder&&p.a.createElement("div",{className:"col-md-12"},p.a.createElement(w.a,null,p.a.createElement(w.a.Group,{width:16},p.a.createElement(w.a.Input,{width:16,readOnly:!0,placeholder:"College Code",value:"".concat(n.props.loginUser.fuserid," ").concat(n.props.loginUser.fname),label:"Enter Reminder By",name:"frmdby"})),p.a.createElement(w.a.Group,null,p.a.createElement(w.a.Field,{width:16},p.a.createElement("label",null,"Reminder To"),p.a.createElement(k.a,{placeholder:"Reminder To",fluid:!0,search:!0,label:"Enter Reminder To",selection:!0,onChange:n.handleChange,name:"frmdto",options:e}))),p.a.createElement(w.a.Group,{width:16},p.a.createElement(w.a.Input,{onChange:n.handleChange,width:16,placeholder:"Reminder Subject",label:"Reminder Subject",name:"frmdsub"})),p.a.createElement(w.a.Group,{width:16},p.a.createElement(w.a.TextArea,Object(a.a)({width:16,onChange:n.handleChange,placeholder:"College Code",label:"Reminder Details",name:"frmddetl"},"placeholder","Tell us more"))),p.a.createElement(w.a.Group,null,p.a.createElement(w.a.Field,{width:16},p.a.createElement("label",null,"Task Periority"),p.a.createElement(k.a,{placeholder:"Select Priority",fluid:!0,search:!0,label:"Enter Reminder To",selection:!0,onChange:n.handleChange,name:"fpriority",options:[{key:1,value:"1",text:"1"},{key:2,value:"2",text:"2"},{key:3,value:"3",text:"3"},{key:4,value:"4",text:"4"},{key:5,value:"5",text:"5"}]}))),p.a.createElement(w.a.Group,{width:16},p.a.createElement(w.a.Field,{width:16},p.a.createElement("label",null,"Reminder Expire Date "),p.a.createElement(x.a,{type:"text",placeholder:"Expire Date",name:"fexdate",mask:"ed/nm/zyyy",formatChars:{n:"[0-1]",m:"[0-9]",e:"[0-3]",d:"[0-9]",z:"[1-2]",y:"[0-9]"},onChange:function(e){n.handleChangeDate(e.target.name,e.target.value)}}))),p.a.createElement(v.a,{basic:!0,color:"green",onClick:function(){n.saveReminder()},content:"save",icon:"file"}),p.a.createElement(v.a,{basic:!0,color:"red",onClick:function(){n.setState({newReminder:!1})},content:"Cancel"})))))))},n}return Object(d.a)(t,e),Object(i.a)(t,[{key:"render",value:function(){return this.renderForm()}}]),t}(m.Component);t.default=Object(b.b)(function(e){return{memberData:e.taskReminderData,loginUser:e.user,reminderList:e.ALLReminderTask}},{taskReminderUser:function(e){return function(){var e=Object(o.a)(l.a.mark(function e(t,n){var a,r;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=n(),t({type:"SET_LOADER"}),e.next=4,C.a.post("/app.php?a=getUserTypes&univcode="+a.univ.funivcode);case 4:r=e.sent,t({type:"UNSET_LOADER"}),"object"!==typeof r.data.data?t({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):t({type:"REMINDER_MEMEBER_LIST",payload:r.data});case 7:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()},changeData:function(e,t){return{type:"CHANGE_DATA",payload:{name:e,value:t}}},SaveReminderData:function(e){return console.log("from edit",e),function(){var t=Object(o.a)(l.a.mark(function t(n,a){var r,o,s,i,c;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n({type:"SET_LOADER"}),r=a(),t.next=4,C.a.post("/app.php?a=getReminderDet&univcode="+r.univ.funivcode,{data:e});case 4:o=t.sent,n({type:"UNSET_LOADER"}),console.log("response",o,typeof o.data),"object"!==typeof o.data?(s={header:"Error",content:"Something went wrong"},n(Object(y.w)(s))):-1===o.data.error_code?(i={header:"Error",content:o.data.data.msg},n(Object(y.w)(i))):(c={header:"Success",content:o.data.data.msg},n(Object(y.w)(c)));case 8:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},TaskList:O})(I)},272:function(e,t,n){"use strict";var a=n(268),r=n.n(a),l=n(265),o=n.n(l),s=n(1),i=n.n(s),c=n(333),u=n(551),d=n(549),m=n(267);function p(e){var t=e.children,n=e.className,a=e.clearing,l=e.content,s=e.fitted,f=e.hidden,h=e.horizontal,v=e.inverted,g=e.section,E=e.vertical,w=o()("ui",Object(c.a)(a,"clearing"),Object(c.a)(s,"fitted"),Object(c.a)(f,"hidden"),Object(c.a)(h,"horizontal"),Object(c.a)(v,"inverted"),Object(c.a)(g,"section"),Object(c.a)(E,"vertical"),"divider",n),k=Object(u.a)(p,e),b=Object(d.a)(p,e);return i.a.createElement(b,r()({},k,{className:w}),m.a.isNil(t)?l:t)}p.handledProps=["as","children","className","clearing","content","fitted","hidden","horizontal","inverted","section","vertical"],p.propTypes={},t.a=p},273:function(e,t,n){e.exports=n(274)},274:function(e,t,n){"use strict";var a,r=(a=n(1))&&"object"==typeof a&&"default"in a?a.default:a,l=n(105);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),function(e,t){for(var n=Object.getOwnPropertyNames(t),a=0;a<n.length;a++){var r=n[a],l=Object.getOwnPropertyDescriptor(t,r);l&&l.configurable&&void 0===e[r]&&Object.defineProperty(e,r,l)}}(e.prototype.constructor=e,t)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var c=function(e,t,n,a,r,l,o,s){if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,a,r,l,o,s],u=0;(i=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw i.framesToPop=1,i}};function u(e,t,n){if("selectionStart"in e&&"selectionEnd"in e)e.selectionStart=t,e.selectionEnd=n;else{var a=e.createTextRange();a.collapse(!0),a.moveStart("character",t),a.moveEnd("character",n-t),a.select()}}var d={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},m="_";function p(e,t,n){var a="",r="",l=null,o=[];if(void 0===t&&(t=m),null==n&&(n=d),!e||"string"!=typeof e)return{maskChar:t,formatChars:n,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var s=!1;return e.split("").forEach(function(e){s=!s&&"\\"===e||(s||!n[e]?(o.push(a.length),a.length===o.length-1&&(r+=e)):l=a.length+1,a+=e,!1)}),{maskChar:t,formatChars:n,prefix:r,mask:a,lastEditablePosition:l,permanents:o}}function f(e,t){return-1!==e.permanents.indexOf(t)}function h(e,t,n){var a=e.mask,r=e.formatChars;if(!n)return!1;if(f(e,t))return a[t]===n;var l=r[a[t]];return new RegExp(l).test(n)}function v(e,t){return t.split("").every(function(t,n){return f(e,n)||!h(e,n,t)})}function g(e,t){var n=e.maskChar,a=e.prefix;if(!n){for(;t.length>a.length&&f(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var r=a.length,l=t.length;l>=a.length;l--){var o=t[l];if(!f(e,l)&&h(e,l,o)){r=l+1;break}}return r}function E(e,t){return g(e,t)===e.mask.length}function w(e,t){var n=e.maskChar,a=e.mask,r=e.prefix;if(!n){for((t=k(e,"",t,0)).length<r.length&&(t=r);t.length<a.length&&f(e,t.length);)t+=a[t.length];return t}if(t)return k(e,w(e,""),t,0);for(var l=0;l<a.length;l++)f(e,l)?t+=a[l]:t+=n;return t}function k(e,t,n,a){var r=e.mask,l=e.maskChar,o=e.prefix,s=n.split(""),i=E(e,t);return!l&&a>t.length&&(t+=r.slice(t.length,a)),s.every(function(n){for(;u=n,f(e,c=a)&&u!==r[c];){if(a>=t.length&&(t+=r[a]),s=n,l&&f(e,a)&&s===l)return!0;if(++a>=r.length)return!1}var s,c,u;return!h(e,a,n)&&n!==l||(a<t.length?t=l||i||a<o.length?t.slice(0,a)+n+t.slice(a+1):(t=t.slice(0,a)+n+t.slice(a),w(e,t)):l||(t+=n),++a<r.length)}),t}function b(e,t){for(var n=e.mask,a=t;a<n.length;++a)if(!f(e,a))return a;return null}function C(e){return e||0===e?e+"":""}function y(e,t,n,a,r){var l=e.mask,o=e.prefix,s=e.lastEditablePosition,i=t,c="",u=0,d=0,m=Math.min(r.start,n.start);return n.end>r.start?d=(u=function(e,t,n,a){var r=e.mask,l=e.maskChar,o=n.split(""),s=a;return o.every(function(t){for(;o=t,f(e,n=a)&&o!==r[n];)if(++a>=r.length)return!1;var n,o;return(h(e,a,t)||t===l)&&a++,a<r.length}),a-s}(e,0,c=i.slice(r.start,n.end),m))?r.length:0:i.length<a.length&&(d=a.length-i.length),i=a,d&&(1!==d||r.length||(m=r.start===n.start?b(e,n.start):function(e,t){for(var n=t;0<=n;--n)if(!f(e,n))return n;return null}(e,n.start)),i=function(e,t,n,a){var r=n+a,l=e.maskChar,o=e.mask,s=e.prefix,i=t.split("");if(l)return i.map(function(t,a){return a<n||r<=a?t:f(e,a)?o[a]:l}).join("");for(var c=r;c<i.length;c++)f(e,c)&&(i[c]="");return n=Math.max(s.length,n),i.splice(n,r-n),t=i.join(""),w(e,t)}(e,i,m,d)),i=k(e,i,c,m),(m+=u)>=l.length?m=l.length:m<o.length&&!u?m=o.length:m>=o.length&&m<s&&u&&(m=b(e,m)),c||(c=null),{value:i=w(e,i),enteredString:c,selection:{start:m,end:m}}}function O(e){return"function"==typeof e}function S(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function R(e){return(S()?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame:function(){return setTimeout(e,1e3/60)})(e)}function D(e){(S()||clearTimeout)(e)}var x=function(e){function t(t){var n=e.call(this,t)||this;n.focused=!1,n.mounted=!1,n.previousSelection=null,n.selectionDeferId=null,n.saveSelectionLoopDeferId=null,n.saveSelectionLoop=function(){n.previousSelection=n.getSelection(),n.saveSelectionLoopDeferId=R(n.saveSelectionLoop)},n.runSaveSelectionLoop=function(){null===n.saveSelectionLoopDeferId&&n.saveSelectionLoop()},n.stopSaveSelectionLoop=function(){null!==n.saveSelectionLoopDeferId&&(D(n.saveSelectionLoopDeferId),n.saveSelectionLoopDeferId=null,n.previousSelection=null)},n.getInputDOMNode=function(){if(!n.mounted)return null;var e=l.findDOMNode(i(i(n))),t="undefined"!=typeof window&&e instanceof window.Element;if(e&&!t)return null;if("INPUT"!==e.nodeName&&(e=e.querySelector("input")),!e)throw new Error("react-input-mask: inputComponent doesn't contain input node");return e},n.getInputValue=function(){var e=n.getInputDOMNode();return e?e.value:null},n.setInputValue=function(e){var t=n.getInputDOMNode();t&&(n.value=e,t.value=e)},n.setCursorToEnd=function(){var e=g(n.maskOptions,n.value),t=b(n.maskOptions,e);null!==t&&n.setCursorPosition(t)},n.setSelection=function(e,t,a){void 0===a&&(a={});var r=n.getInputDOMNode(),l=n.isFocused();r&&l&&(a.deferred||u(r,e,t),null!==n.selectionDeferId&&D(n.selectionDeferId),n.selectionDeferId=R(function(){n.selectionDeferId=null,u(r,e,t)}),n.previousSelection={start:e,end:t,length:Math.abs(t-e)})},n.getSelection=function(){return function(e){var t=0,n=0;if("selectionStart"in e&&"selectionEnd"in e)t=e.selectionStart,n=e.selectionEnd;else{var a=document.selection.createRange();a.parentElement()===e&&(t=-a.moveStart("character",-e.value.length),n=-a.moveEnd("character",-e.value.length))}return{start:t,end:n,length:n-t}}(n.getInputDOMNode())},n.getCursorPosition=function(){return n.getSelection().start},n.setCursorPosition=function(e){n.setSelection(e,e)},n.isFocused=function(){return n.focused},n.getBeforeMaskedValueChangeConfig=function(){var e=n.maskOptions,t=e.mask,a=e.maskChar,r=e.permanents,l=e.formatChars;return{mask:t,maskChar:a,permanents:r,alwaysShowMask:!!n.props.alwaysShowMask,formatChars:l}},n.isInputAutofilled=function(e,t,a,r){var l=n.getInputDOMNode();try{if(l.matches(":-webkit-autofill"))return!0}catch(c){}return!n.focused||r.end<a.length&&t.end===e.length},n.onChange=function(e){var t=i(i(n)).beforePasteState,a=i(i(n)).previousSelection,r=n.props.beforeMaskedValueChange,l=n.getInputValue(),o=n.value,s=n.getSelection();n.isInputAutofilled(l,s,o,a)&&(o=w(n.maskOptions,""),a={start:0,end:0,length:0}),t&&(a=t.selection,o=t.value,s={start:a.start+l.length,end:a.start+l.length,length:0},l=o.slice(0,a.start)+l+o.slice(a.end),n.beforePasteState=null);var c=y(n.maskOptions,l,s,o,a),u=c.enteredString,d=c.selection,m=c.value;if(O(r)){var p=r({value:m,selection:d},{value:o,selection:a},u,n.getBeforeMaskedValueChangeConfig());m=p.value,d=p.selection}n.setInputValue(m),O(n.props.onChange)&&n.props.onChange(e),n.isWindowsPhoneBrowser?n.setSelection(d.start,d.end,{deferred:!0}):n.setSelection(d.start,d.end)},n.onFocus=function(e){var t=n.props.beforeMaskedValueChange,a=n.maskOptions,r=a.mask,l=a.prefix;if(n.focused=!0,n.mounted=!0,r){if(n.value)g(n.maskOptions,n.value)<n.maskOptions.mask.length&&n.setCursorToEnd();else{var o=w(n.maskOptions,l),s=w(n.maskOptions,o),i=g(n.maskOptions,s),c=b(n.maskOptions,i),u={start:c,end:c};if(O(t)){var d=t({value:s,selection:u},{value:n.value,selection:null},null,n.getBeforeMaskedValueChangeConfig());s=d.value,u=d.selection}var m=s!==n.getInputValue();m&&n.setInputValue(s),m&&O(n.props.onChange)&&n.props.onChange(e),n.setSelection(u.start,u.end)}n.runSaveSelectionLoop()}O(n.props.onFocus)&&n.props.onFocus(e)},n.onBlur=function(e){var t=n.props.beforeMaskedValueChange,a=n.maskOptions.mask;if(n.stopSaveSelectionLoop(),n.focused=!1,a&&!n.props.alwaysShowMask&&v(n.maskOptions,n.value)){var r="";O(t)&&(r=t({value:r,selection:null},{value:n.value,selection:n.previousSelection},null,n.getBeforeMaskedValueChangeConfig()).value);var l=r!==n.getInputValue();l&&n.setInputValue(r),l&&O(n.props.onChange)&&n.props.onChange(e)}O(n.props.onBlur)&&n.props.onBlur(e)},n.onMouseDown=function(e){if(!n.focused&&document.addEventListener){n.mouseDownX=e.clientX,n.mouseDownY=e.clientY,n.mouseDownTime=(new Date).getTime();document.addEventListener("mouseup",function e(t){if(document.removeEventListener("mouseup",e),n.focused){var a=Math.abs(t.clientX-n.mouseDownX),r=Math.abs(t.clientY-n.mouseDownY),l=Math.max(a,r),o=(new Date).getTime()-n.mouseDownTime;(l<=10&&o<=200||l<=5&&o<=300)&&n.setCursorToEnd()}})}O(n.props.onMouseDown)&&n.props.onMouseDown(e)},n.onPaste=function(e){O(n.props.onPaste)&&n.props.onPaste(e),e.defaultPrevented||(n.beforePasteState={value:n.getInputValue(),selection:n.getSelection()},n.setInputValue(""))},n.handleRef=function(e){null==n.props.children&&O(n.props.inputRef)&&n.props.inputRef(e)};var a=t.mask,r=t.maskChar,o=t.formatChars,s=t.alwaysShowMask,c=t.beforeMaskedValueChange,d=t.defaultValue,m=t.value;n.maskOptions=p(a,r,o),null==d&&(d=""),null==m&&(m=d);var f=C(m);if(n.maskOptions.mask&&(s||f)&&(f=w(n.maskOptions,f),O(c))){var h=t.value;null==t.value&&(h=d),f=c({value:f,selection:null},{value:h=C(h),selection:null},null,n.getBeforeMaskedValueChangeConfig()).value}return n.value=f,n}s(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=function(){var e=new RegExp("windows","i"),t=new RegExp("phone","i"),n=navigator.userAgent;return e.test(n)&&t.test(n)}(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},n.componentDidUpdate=function(){var e=this.previousSelection,t=this.props,n=t.beforeMaskedValueChange,a=t.alwaysShowMask,r=t.mask,l=t.maskChar,o=t.formatChars,s=this.maskOptions,i=a||this.isFocused(),c=null!=this.props.value,u=c?C(this.props.value):this.value,d=e?e.start:null;if(this.maskOptions=p(r,l,o),this.maskOptions.mask){!s.mask&&this.isFocused()&&this.runSaveSelectionLoop();var m=this.maskOptions.mask&&this.maskOptions.mask!==s.mask;if(s.mask||c||(u=this.getInputValue()),(m||this.maskOptions.mask&&(u||i))&&(u=w(this.maskOptions,u)),m){var f=g(this.maskOptions,u);(null===d||f<d)&&(d=E(this.maskOptions,u)?f:b(this.maskOptions,f))}!this.maskOptions.mask||!v(this.maskOptions,u)||i||c&&this.props.value||(u="");var h={start:d,end:d};if(O(n)){var k=n({value:u,selection:h},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());u=k.value,h=k.selection}this.value=u;var y=this.getInputValue()!==this.value;y?(this.setInputValue(this.value),this.forceUpdate()):m&&this.forceUpdate();var S=!1;null!=h.start&&null!=h.end&&(S=!e||e.start!==h.start||e.end!==h.end),(S||y)&&this.setSelection(h.start,h.end)}else s.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},n.componentWillUnmount=function(){this.mounted=!1,null!==this.selectionDeferId&&D(this.selectionDeferId),this.stopSaveSelectionLoop()},n.render=function(){var e,t=this.props,n=(t.mask,t.alwaysShowMask,t.maskChar,t.formatChars,t.inputRef,t.beforeMaskedValueChange,t.children),a=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],0<=t.indexOf(n)||(r[n]=e[n]);return r}(t,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(n){O(n)||c(!1);var l=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],s=o({},a);l.forEach(function(e){return delete s[e]}),e=n(s),l.filter(function(t){return null!=e.props[t]&&e.props[t]!==a[t]}).length&&c(!1)}else e=r.createElement("input",o({ref:this.handleRef},a));var i={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(a.disabled||a.readOnly||(i.onChange=this.onChange,i.onPaste=this.onPaste,i.onMouseDown=this.onMouseDown),null!=a.value&&(i.value=this.value)),e=r.cloneElement(e,i)},t}(r.Component);e.exports=x}}]);
//# sourceMappingURL=91.254f5ca7.chunk.js.map
|