An object of mass $m$ starts from rest and slides a distance $d$ down a frictionless incline of angle $\theta .$ While sliding, it contacts an unstressed spring of negligible mass as shown in Figure $\mathrm{P} 7.16 .$ The object slides an additional distance $x$ as it is brought momentarily to rest by compression of the spring (of force constant $k$ ). Find the initial separation $d$ between the object and the spring.