I ended up cutting a bunch of times this morning

Things are getting kind of scary. I completely understand my cutting when I'm extremely depressed but not this. I haven't been depressed for about 2 weeks actually. I'm angry at myself because I wasn't able to sleep at all for about 4 days, was wide awake and happy so I shouldn't be cutting but I was afraid I was never going to get any sleep. I have panic attacks and not being able to sleep only makes them happen more often and worse. I ended up pacing around outside last night in the rain till the morning trying to get myself to come back to reality and feel normal, I felt like I was completely insane and losing touch with reality. I'm just now staring to feel tired tonight. I come inside and look in the mirror and look like I'm going crazy. I didn't want to cut, I tried everything to stop whatever was going on and make myself sleep, I just felt wide awake, dissociated and was scared and had to feel something. I thought taking a shower, putting ice on my face would help, pinching myself, nothing I could barley feel anything so I started cutting a bunch of times as a last resort, I know I shouldn't have though