Assuming that I have access to a replicator without any security restrictions, could I replicate a phaser with the replicator? Would it be replicated charged, or would I have to charge it?
Yes, absolutely you can.
In the episode TNG: Samaritan Snare, the Pakled take Geordi's phaser from him and replicate several more.
Quoting from the screenplay
REGINOD: (re: the phaser) We can make more.
Geordi reacts, realizing:
GEORDI: You have a replicator?
GREBNEDLOG: (with pride) It is not broken.
GEORDI: I didn't come here to give you weapons.
GREBNEDLOG: (re: the phaser, points it at Geordi) You will make more.
then shortly afterwards...
The viewscreen comes alive with the image of Grebnedlog holding Geordi's phaser in his mitt. Reginod and the other Pakleds all hold replicated versions of the original now. Geordi is in the background, slowly struggling to his feet once again, propped up by Reginod as other Pakleds play recklessly with their phasers. One of them takes a shot at his comrade, missing him, like children playing with dangerous toys. Grebnedlog turns to face the viewscreen
Since the Pakled lack a basic understanding of how the phasers work, it seems vanishingly unlikely that they could work out how to charge them. They must have come out of the replicator fully charged.
Most probably yes
The Memory Alpha page on replicators explains that replicator technology uses:
transporter technology to dematerialize quantities of matter and then rematerialize that matter in another form
Hence, I don't see any reason why a fully-operational phaser couldn't be replicated. I doubt that it would be replicated charged though; I expect it would need to be charged manually.
Also consider the following quote:
On Starfleet installations and starships, if a person in custody is confined to quarters, it is standard policy to disable the replicators that the person has access to, in order to ensure that a weapon cannot be replicated. (DS9: "Inquisition"; VOY: "Counterpoint")
Bear in mind that it is probably physically capable of producing a phaser; one would need to program one into the replicator itself.
If the replication pattern for a weapon exists it can presumably be replicated. However the energy needed to charge it consumes vastly more energy than a evening dinner. In the Voyager episode "Counterpoint" Janeway alots quarters to a new arrival but shutsdown the replicator in his quarters as a safety precaution. *JANEWAY: I'm afraid that won't be possible. I had your replicator taken offline. KASHYK: In case I decided to replicate a weapon. JANEWAY: A safety precaution. You understand. KASHYK: Better than anyone. *
In the TNG episode "The Mind's Eye" The Federation is accused by Klingon delegation of providing weapons to Klingon colony independence seekers. Upon analysis the rifle being examined shows instances of being charged with an alternative power supply.
- VAGH: Romulan replications using stolen Federation technology
If the Romulans can replicate a Federation style weapon so could the federation. But like the TR-116 it's replication pattern is secured presumably that only starfleet officers could utilize and make one.