Render an ASCII maze look! It's an ASCII maze! Soo coolzors, amazeballs and stuff.

+-+-----+---+
| |     |   |
| |  ++   | |
| |  ++ +-+ |
|       |   |
+-------+ | |
|         | |
+---------+-+


But, but, but... it's a pain to work out which direction all the parts of the maze are going. I just want to draw the layout and the maze make itself sooper kul without loads of time.

What if I could just draw this in...

#############
# #     #   #
# #  ##   # #
# #  ## ### #
#       #   #
######### # #
#         # #
#############


That would be soo sweet!



The rules (Because rules is cools):


Write code to convert a string into an ascii maze and output the result.
Any non-whitespace character will be read as a wall.
Each char of wall will decide which character to be based on it's neighbours (only in North, South, East and West directions).


If a char has no non-whitespace neighbours, it will be a plus sign (+).
If a char has neighbours in both vertical (North-South) and horizontal (East-West) directions, it will be a plus sign (+).
If a char has neighbours only in a vertical (North-South) direction, it will be a pipe symbol (|).
If a char has neighbours only in a horizontal (East-West) direction, it will be a minus sign (-).

The Input can be a single string (with lines separated by newline characters, or an array of strings).
All input characters will be printable ASCII characters, you don't need to deal with extended charsets.
Use any old language you please.
If there is white space before a line, it should be the same amount on each line. Any white space after each line of output is fine.
Attempt to solve it with the smallest number of bytes.




Test cases:

1: Frame

Input:

##########
#        #
#        #
#        #
##########


Output:

+--------+
|        |
|        |
|        |
+--------+


2: Classic maze

Input:

#################
        #       #
# ##### # ##### #
#   # # #     # #
# # # # ##### # #
#   # #       # # 
### # ####### # #
#   # #    #  # # 
# ### # ## # ##
#     # ##    #  
#################


Output: 

--------+-------+
        |       |
| --+-+ | ----+ |
|   | | |     | |
| + | | +---- | |
|   | |       | | 
+-- | +----+- | |
|   | |    |  | | 
| --+ | ++ | -+
|     | ++    |  
+-----+-++----+--


3: Green eggs, man.

Input:

I do not like green eggs and ham.
I do not like them, sam I am.
Would you like them here or there?
I would not like them anywhere!


Output:

| ++ +++ ++++ +++++ +++- -++ ----
| ++ +++ ++++ +++++ +++ + +++
+-+++ +++ ++++ ++++ ++++ ++ +++---
| +++-+ +++ ++++ ++-+ +++++++++


4: Icicles

Input:

Word Icicle!
Word Icicle 
Word  cicle 
 ord  cicle 
 ord   icle 
 ord   i le 
 or    i le 
 or    i l  
 or      l  
 or         
  r         


Output:

++++ ++++++-
++++ ++++++ 
++++  +++++ 
 +++  +++++ 
 +++   ++++ 
 +++   | ++ 
 ++    | ++ 
 ++    | |  
 ++      |  
 ++         
  |
APL (Dyalog Unicode), 57 35 bytesSBCS

–22 thanks to a novel solution by ngn.
Anonymous tacit function taking a character matrix as argument.
{⊃'+-|+'↓⍨2⊥5 4 2⊃¨⊂⍱∘⌽⍨' '≠,⍵}⌺3 3

Try it online!
{…}⌺3 3 on each 3-by-3 neighbourhood, apply the following function:
 ,⍵ ravel (flatten)
 ' '≠ Boolean where non-space
 ⍱∘⌽⍨ that NOR it's reverse (incl. neither top NOR bottom, neither left NOR right)
 5 4 2⊃¨⊂ pick 5th, 4th, and 2nd element from that entire list
  i.e. empty self, no vertical, no horizontal
 2⊥ evaluate in base-2 (binary)
  i.e. ≥4:empty self; 3:no neighbours; 2:no horizontal neighbours; 1:no vertical; 0: has both
 '+-|+'↓⍨ drop that many elements from this string
  i.e. empty self:; alone:+; vertical neighbour(s) only:|+; horizontal:-|+; both:+-|+
 ⊃ pick the first element (pad with space if non are available)
  i.e. empty self: ; alone:+; vertical neighbour(s) only:|; horizontal:-; both:+

Old solution
Anonymous tacit function taking a character matrix as argument.
{' +-|+'⊃⍨1⍳⍨(' '=5⊃,⍵),(∧/,⊢)∨/2 2⍴1⌽' '≠(9⍴0 1)/,⍵}⌺3 3

Try it online!
{…}⌺3 3 on each 3-by-3 neighbourhood, apply the following function:
 ,⍵ ravel (flatten)
 (…)/ filter using the following mask:
  9⍴0 1 cyclically reshape [0,1] to length 9 (selects N, W, E, S)
 ' '≠ Boolean where non-space
 1⌽ rotate one step left; [W,E,S,N]
 2 2⍴ reshape to 2-by-2 matrix; [[W,E],[S,N]]
 ∨/ row-wise OR reduction: [horizontal,vertical]
 (…) apply the following tacit function:
  ⊢ the identity; [horizontal,vertical]
  ∧/, preceded by its AND reduction; [both,horizontal,vertical]
 (…), prepend the following:
  ,⍵ ravel (flatten) the neighbourhood
  5⊃ pick the 5th element (itself)
  ' '= Boolean if space (i.e. empty)
 Now we have [empty,both,horizontal,vertical]
 1⍳⍨ index of leftmost 1 (gives 5 if no neighbours at all)
 ' +-|+'⊃⍨ use that to pick symbol