Insider accounts detail the late-night negotiating, tech giant tug-of-war and last-minute interventions that brought the first-in-nation measure to life.