Šoštanj v stoletjih trške avtonomije